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.
| ParserBuilder (ExprManager *exprManager, const std::string &filename, const Options &options)
Parser * | build () throw (InputStreamException)
| Build the parser, using the current settings.
ParserBuilder & | withChecks (bool flag=true)
| Should semantic checks be enabled in the parser? (Default: yes)
ParserBuilder & | withExprManager (ExprManager *exprManager)
| Set the ExprManager to use with the parser.
ParserBuilder & | withFileInput ()
| Set the parser to read a file for its input.
ParserBuilder & | withFilename (const std::string &filename)
| Set the filename for use by the parser.
ParserBuilder & | withInputLanguage (InputLanguage lang)
| Set the input language to be used by the 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.
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.
ParserBuilder & | withOptions (const Options &options)
| Derive settings from the given options.
ParserBuilder & | withStrictMode (bool flag=true)
| Should the parser use strict mode?
ParserBuilder & | withIncludeFile (bool flag=true)
| Should the include-file commands be enabled?
ParserBuilder & | withStreamInput (std::istream &input)
| Set the parser to use the given stream for its input.
ParserBuilder & | withLineBufferedStreamInput (std::istream &input)
| Set the parser to use the given stream for its input.
ParserBuilder & | withStringInput (const std::string &input)
| Set the parser to use the given string for its input.
ParserBuilder & | withForcedLogic (const std::string &logic)
| Set the parser to use the given logic string.

## 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

## ParserBuilder() [1/2]

CVC4::parser::ParserBuilder::ParserBuilder | ( | ExprManager * | exprManager,
|  | const std::string & | filename )

Create a parser builder using the given ExprManager and filename.

## ParserBuilder() [2/2]

CVC4::parser::ParserBuilder::ParserBuilder | ( | ExprManager * | exprManager,
|  | const std::string & | filename,
|  | const Options & | options )

## Member Function Documentation

## build()

Parser * CVC4::parser::ParserBuilder::build | ( |  | ) |
throw | ( | InputStreamException ) |  |  |

Build the parser, using the current settings.

## withChecks()

ParserBuilder & CVC4::parser::ParserBuilder::withChecks | ( | bool | flag = true | ) |

Should semantic checks be enabled in the parser? (Default: yes)

## withExprManager()

ParserBuilder & CVC4::parser::ParserBuilder::withExprManager | ( | ExprManager * | exprManager | ) |

Set the ExprManager to use with the parser.

## withFileInput()

ParserBuilder & CVC4::parser::ParserBuilder::withFileInput | ( |  | ) |

Set the parser to read a file for its input.

(Default)

## withFilename()

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.

## withForcedLogic()

ParserBuilder & CVC4::parser::ParserBuilder::withForcedLogic | ( | const std::string & | logic | ) |

Set the parser to use the given logic string.

## withIncludeFile()

ParserBuilder & CVC4::parser::ParserBuilder::withIncludeFile | ( | bool | flag = true | ) |

Should the include-file commands be enabled?

(Default: yes)

## withInputLanguage()

ParserBuilder & CVC4::parser::ParserBuilder::withInputLanguage | ( | InputLanguage | lang | ) |

Set the input language to be used by the parser.

(Default: LANG_AUTO)

## withLineBufferedStreamInput()

ParserBuilder & CVC4::parser::ParserBuilder::withLineBufferedStreamInput | ( | std::istream & | input | ) |

Set the parser to use the given stream for its input.

## withMmap()

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)

## withOptions()

ParserBuilder & CVC4::parser::ParserBuilder::withOptions | ( | const Options & | options | ) |

Derive settings from the given options.

## withParseOnly()

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).

## withStreamInput()

ParserBuilder & CVC4::parser::ParserBuilder::withStreamInput | ( | std::istream & | input | ) |

Set the parser to use the given stream for its input.

## withStrictMode()

ParserBuilder & CVC4::parser::ParserBuilder::withStrictMode | ( | bool | flag = true | ) |

Should the parser use strict mode?

(Default: no)

## withStringInput()

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:

- src/parser/parser_builder.h