cvc4-1.4
|
A builder for input language parsers. More...
#include <parser_builder.h>
Public Member Functions | |
ParserBuilder (ExprManager *exprManager, const std::string &filename) | |
Create a parser builder using the given ExprManager and filename. More... | |
ParserBuilder (ExprManager *exprManager, const std::string &filename, const Options &options) | |
Parser * | build () throw (InputStreamException) |
Build the parser, using the current settings. More... | |
ParserBuilder & | withChecks (bool flag=true) |
Should semantic checks be enabled in the parser? (Default: yes) More... | |
ParserBuilder & | withExprManager (ExprManager *exprManager) |
Set the ExprManager to use with the parser. More... | |
ParserBuilder & | withFileInput () |
Set the parser to read a file for its input. More... | |
ParserBuilder & | withFilename (const std::string &filename) |
Set the filename for use by the parser. More... | |
ParserBuilder & | withInputLanguage (InputLanguage lang) |
Set the input language to be used by the parser. More... | |
ParserBuilder & | withMmap (bool flag=true) |
Should the parser memory-map its input? This is only relevant if the parser will have a file input. More... | |
ParserBuilder & | withParseOnly (bool flag=true) |
Are we only parsing, or doing something with the resulting commands and expressions? This setting affects whether the parser will raise certain errors about unimplemented features, even if there isn't a parsing error, because the result of the parse would otherwise be an incorrect parse tree and the error would go undetected. More... | |
ParserBuilder & | withOptions (const Options &options) |
Derive settings from the given options. More... | |
ParserBuilder & | withStrictMode (bool flag=true) |
Should the parser use strict mode? More... | |
ParserBuilder & | withIncludeFile (bool flag=true) |
Should the include-file commands be enabled? More... | |
ParserBuilder & | withStreamInput (std::istream &input) |
Set the parser to use the given stream for its input. More... | |
ParserBuilder & | withLineBufferedStreamInput (std::istream &input) |
Set the parser to use the given stream for its input. More... | |
ParserBuilder & | withStringInput (const std::string &input) |
Set the parser to use the given string for its input. More... | |
ParserBuilder & | withForcedLogic (const std::string &logic) |
Set the parser to use the given logic string. More... | |
A builder for input language parsers.
build()
can be called any number of times on an instance and will generate a fresh parser each time.
Definition at line 42 of file parser_builder.h.
CVC4::parser::ParserBuilder::ParserBuilder | ( | ExprManager * | exprManager, |
const std::string & | filename | ||
) |
Create a parser builder using the given ExprManager and filename.
CVC4::parser::ParserBuilder::ParserBuilder | ( | ExprManager * | exprManager, |
const std::string & | filename, | ||
const Options & | options | ||
) |
Parser* CVC4::parser::ParserBuilder::build | ( | ) | ||
throw | ( | InputStreamException | ||
) |
Build the parser, using the current settings.
ParserBuilder& CVC4::parser::ParserBuilder::withChecks | ( | bool | flag = true | ) |
Should semantic checks be enabled in the parser? (Default: yes)
ParserBuilder& CVC4::parser::ParserBuilder::withExprManager | ( | ExprManager * | exprManager | ) |
Set the ExprManager to use with the parser.
ParserBuilder& CVC4::parser::ParserBuilder::withFileInput | ( | ) |
Set the parser to read a file for its input.
(Default)
ParserBuilder& CVC4::parser::ParserBuilder::withFilename | ( | const std::string & | filename | ) |
Set the filename for use by the parser.
If file input is used, this file will be opened and read by the parser. Otherwise, the filename string (possibly a non-existent path) will only be used in error messages.
ParserBuilder& CVC4::parser::ParserBuilder::withForcedLogic | ( | const std::string & | logic | ) |
Set the parser to use the given logic string.
ParserBuilder& CVC4::parser::ParserBuilder::withIncludeFile | ( | bool | flag = true | ) |
Should the include-file commands be enabled?
(Default: yes)
ParserBuilder& CVC4::parser::ParserBuilder::withInputLanguage | ( | InputLanguage | lang | ) |
Set the input language to be used by the parser.
(Default: LANG_AUTO)
ParserBuilder& CVC4::parser::ParserBuilder::withLineBufferedStreamInput | ( | std::istream & | input | ) |
Set the parser to use the given stream for its input.
ParserBuilder& CVC4::parser::ParserBuilder::withMmap | ( | bool | flag = true | ) |
Should the parser memory-map its input? This is only relevant if the parser will have a file input.
(Default: no)
ParserBuilder& CVC4::parser::ParserBuilder::withOptions | ( | const Options & | options | ) |
Derive settings from the given options.
ParserBuilder& CVC4::parser::ParserBuilder::withParseOnly | ( | bool | flag = true | ) |
Are we only parsing, or doing something with the resulting commands and expressions? This setting affects whether the parser will raise certain errors about unimplemented features, even if there isn't a parsing error, because the result of the parse would otherwise be an incorrect parse tree and the error would go undetected.
This is specifically for circumstances where the parser is ahead of the functionality present elsewhere in CVC4 (such as quantifiers, subtypes, records, etc. in the CVC language parser).
ParserBuilder& CVC4::parser::ParserBuilder::withStreamInput | ( | std::istream & | input | ) |
Set the parser to use the given stream for its input.
ParserBuilder& CVC4::parser::ParserBuilder::withStrictMode | ( | bool | flag = true | ) |
Should the parser use strict mode?
(Default: no)
ParserBuilder& CVC4::parser::ParserBuilder::withStringInput | ( | const std::string & | input | ) |
Set the parser to use the given string for its input.