cvc4-1.4
|
An input to be parsed. More...
#include <input.h>
Public Member Functions | |
virtual | ~Input () |
Destructor. More... | |
virtual std::string | getUnparsedText ()=0 |
Retrieve the remaining text in this input. More... | |
virtual InputLanguage | getLanguage () const =0 throw () |
Get the language that this Input is reading. More... | |
const std::string | getInputStreamName () |
Retrieve the name of the input stream. More... | |
Static Public Member Functions | |
static Input * | newFileInput (InputLanguage lang, const std::string &filename, bool useMmap=false) throw (InputStreamException) |
Create an input for the given file. More... | |
static Input * | newStreamInput (InputLanguage lang, std::istream &input, const std::string &name, bool lineBuffered=false) throw (InputStreamException) |
Create an input for the given stream. More... | |
static Input * | newStringInput (InputLanguage lang, const std::string &input, const std::string &name) throw (InputStreamException) |
Create an input for the given string. More... | |
Protected Member Functions | |
Input (InputStream &inputStream) | |
Create an input. More... | |
InputStream * | getInputStream () |
Retrieve the input stream for this parser. More... | |
virtual Command * | parseCommand ()=0 |
Parse a command from the input by invoking the implementation-specific parsing method. More... | |
virtual void | warning (const std::string &msg)=0 |
Issue a warning to the user, with source file, line, and column info. More... | |
virtual void | parseError (const std::string &msg, bool eofException=false)=0 throw (ParserException) |
Throws a ParserException with the given message. More... | |
virtual Expr | parseExpr ()=0 |
Parse an expression from the input by invoking the implementation-specific parsing method. More... | |
virtual void | setParser (Parser &parser)=0 |
Set the Parser object for this input. More... | |
Friends | |
class | Parser |
class | ParserBuilder |
An input to be parsed.
The static factory methods in this class (e.g., newFileInput
, newStringInput
) create a parser for the given input language and attach it to an input source of the appropriate type.
|
virtual |
Destructor.
Frees the input stream and closes the input.
|
protected |
Create an input.
inputStream | the input stream |
|
protected |
Retrieve the input stream for this parser.
|
inline |
|
pure virtual |
Get the language that this Input is reading.
|
pure virtual |
Retrieve the remaining text in this input.
|
static |
Create an input for the given file.
lang | the input language |
filename | the input filename |
useMmap | true if the parser should use memory-mapped I/O (default: false) |
|
static |
|
static |
Create an input for the given string.
lang | the input language |
input | the input string |
name | the name of the stream, for use in error messages |
|
protectedpure virtual |
Parse a command from the input by invoking the implementation-specific parsing method.
Returns NULL
if there is no command there to parse.
ParserException | if an error is encountered during parsing. |
|
protectedpure virtual |
Throws a ParserException
with the given message.
Referenced by CVC4::parser::Parser::parseError(), and CVC4::parser::Parser::unexpectedEOF().
|
protectedpure virtual |
Parse an expression from the input by invoking the implementation-specific parsing method.
Returns a null Expr
if there is no expression there to parse.
ParserException | if an error is encountered during parsing. |
|
protectedpure virtual |
Set the Parser object for this input.
Referenced by CVC4::parser::Parser::setInput().
|
protectedpure virtual |
Issue a warning to the user, with source file, line, and column info.
Referenced by CVC4::parser::Parser::warning().
|
friend |