cvc4-1.4
CVC4::parser::ParserBuilder Class Reference

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)
 
Parserbuild () throw (InputStreamException)
 Build the parser, using the current settings. More...
 
ParserBuilderwithChecks (bool flag=true)
 Should semantic checks be enabled in the parser? (Default: yes) More...
 
ParserBuilderwithExprManager (ExprManager *exprManager)
 Set the ExprManager to use with the parser. More...
 
ParserBuilderwithFileInput ()
 Set the parser to read a file for its input. More...
 
ParserBuilderwithFilename (const std::string &filename)
 Set the filename for use by the parser. More...
 
ParserBuilderwithInputLanguage (InputLanguage lang)
 Set the input language to be used by the parser. More...
 
ParserBuilderwithMmap (bool flag=true)
 Should the parser memory-map its input? This is only relevant if the parser will have a file input. More...
 
ParserBuilderwithParseOnly (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...
 
ParserBuilderwithOptions (const Options &options)
 Derive settings from the given options. More...
 
ParserBuilderwithStrictMode (bool flag=true)
 Should the parser use strict mode? More...
 
ParserBuilderwithIncludeFile (bool flag=true)
 Should the include-file commands be enabled? More...
 
ParserBuilderwithStreamInput (std::istream &input)
 Set the parser to use the given stream for its input. More...
 
ParserBuilderwithLineBufferedStreamInput (std::istream &input)
 Set the parser to use the given stream for its input. More...
 
ParserBuilderwithStringInput (const std::string &input)
 Set the parser to use the given string for its input. More...
 
ParserBuilderwithForcedLogic (const std::string &logic)
 Set the parser to use the given logic string. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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 
)

Member Function Documentation

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.


The documentation for this class was generated from the following file: