A reference counted LexerInputState object.
A reference counted ParserInputState.
typedef TokenRefCount<Token> antlr::RefToken |
std::string antlr::charName | ( | int | ch | ) |
Convert character to readable string
std ::istream& antlr::eatwhite | ( | std::istream & | is | ) |
Eat whitespace from the input stream
is | the stream to read from |
std ::string antlr::emptyString | ( | "" | ) |
std::string antlr::operator+ | ( | const std::string & | lhs, | |
size_t | rhs | |||
) |
std::string antlr::operator+ | ( | const std::string & | lhs, | |
const int | rhs | |||
) |
void antlr::read_AttributeNValue | ( | std::istream & | in, | |
std::string & | attribute, | |||
std::string & | value | |||
) |
Read a attribute="value" thing. Leading whitespace is skipped. Between attribute and '=' no whitespace is allowed. After the '=' it is permitted.
in | the istream to read from. | |
attribute | string the attribute name is put in | |
value | string the value of the attribute is put in |
IOException | if something is fishy. E.g. malformed quoting or missing '=' |
std ::string antlr::read_identifier | ( | std::istream & | in | ) |
std ::string antlr::read_string | ( | std::istream & | in | ) |
Read a string enclosed by '"' from a stream. Also handles escaping of \". Skips leading whitespace.
in | the istream to read from. |
IOException | if string is badly formatted |
bool antlr::DEBUG_PARSER = false |
A generic ANTLR parser (LL(k) for k>=1) containing a bunch of utility routines useful at any lookahead depth. We distinguish between the LL(1) and LL(k) parsers because of efficiency. This may not be necessary in the near future.
Each parser object contains the state of the parse including a lookahead cache (the form of which is determined by the subclass), whether or not the parser is in guess mode, where tokens come from, etc...
During guess mode, the current lookahead token(s) and token type(s) cache must be saved because the token stream may not have been informed to save the token (via mark
) before the try
block. Guessing is started by:
After guessing, the parser state is restored by:
AST* const antlr::nullASTptr = 0 |