parser_builder.h
Go to the documentation of this file.
/********************* */
#include "cvc4parser_public.h"
#ifndef __CVC4__PARSER__PARSER_BUILDER_H
#define __CVC4__PARSER__PARSER_BUILDER_H
#include <string>
#include "parser/input.h"
#include "util/language.h"
namespace CVC4 {
class ExprManager;
class Options;
namespace parser {
class Parser;
class CVC4_PUBLIC ParserBuilder {
enum InputType {
FILE_INPUT,
LINE_BUFFERED_STREAM_INPUT,
STREAM_INPUT,
STRING_INPUT
};
InputType d_inputType;
InputLanguage d_lang;
std::string d_filename;
std::string d_stringInput;
std::istream* d_streamInput;
ExprManager* d_exprManager;
bool d_checksEnabled;
bool d_strictMode;
bool d_canIncludeFile;
bool d_mmap;
bool d_parseOnly;
bool d_logicIsForced;
std::string d_forcedLogic;
void init(ExprManager* exprManager, const std::string& filename);
public:
ParserBuilder(ExprManager* exprManager, const std::string& filename);
ParserBuilder(ExprManager* exprManager, const std::string& filename,
const Options& options);
Parser *build() throw (InputStreamException);
ParserBuilder& withChecks(bool flag = true);
ParserBuilder& withExprManager(ExprManager* exprManager);
ParserBuilder& withFileInput();
ParserBuilder& withFilename(const std::string& filename);
ParserBuilder& withInputLanguage(InputLanguage lang);
ParserBuilder& withMmap(bool flag = true);
ParserBuilder& withParseOnly(bool flag = true);
ParserBuilder& withOptions(const Options& options);
ParserBuilder& withStrictMode(bool flag = true);
ParserBuilder& withIncludeFile(bool flag = true);
ParserBuilder& withStreamInput(std::istream& input);
ParserBuilder& withLineBufferedStreamInput(std::istream& input);
ParserBuilder& withStringInput(const std::string& input);
ParserBuilder& withForcedLogic(const std::string& logic);
};/* class ParserBuilder */
}/* CVC4::parser namespace */
}/* CVC4 namespace */
#endif /* __CVC4__PARSER__PARSER_BUILDER_H */
ExprManager
void * ExprManager
Definition c_interface_defs.h:43
CVC4::ExprManager
Definition expr_manager.h:124
CVC4::Options
Definition options.h:43
CVC4::parser::InputStreamException
Definition input.h:40
CVC4::parser::ParserBuilder
A builder for input language parsers.
Definition parser_builder.h:42
CVC4::parser::ParserBuilder::build
Parser * build()
Build the parser, using the current settings.
CVC4::parser::ParserBuilder::ParserBuilder
ParserBuilder(ExprManager *exprManager, const std::string &filename)
Create a parser builder using the given ExprManager and filename.
CVC4::parser::ParserBuilder::ParserBuilder
ParserBuilder(ExprManager *exprManager, const std::string &filename, const Options &options)
CVC4::parser::Parser
This class encapsulates all of the state of a parser, including the name of the file,...
Definition parser.h:106
CVC4_PUBLIC
#define CVC4_PUBLIC
Definition cvc4_public.h:30
cvc4parser_public.h
Macros that should be defined everywhere during the building of the libraries and driver binary,...
input.h
Base for parser inputs.
language.h
Definition of input and output languages.
CVC4::language::input::Language
Language
Definition language.h:33
CVC4
Definition expr.h:106
std
STL namespace.