public class BracesLexer extends antlr.CharScanner implements PreprocTokenTypes, antlr.TokenStream
There is only a single context for this lexer as no comments are honored inside the braces and strings are treated in a special way: only double quoted strings are recognized, they can be adjacent to text and even unclosed.
BracesParser
Modifier and Type | Field and Description |
---|---|
static antlr.collections.impl.BitSet |
_tokenSet_0 |
static antlr.collections.impl.BitSet |
_tokenSet_1 |
static antlr.collections.impl.BitSet |
_tokenSet_2 |
private Environment |
env
keeps the reference to the shared environment
|
private boolean |
isUnixEscapes
Flag to denote if the backslash is honored as an escape sequence.
|
_returnToken, caseSensitive, caseSensitiveLiterals, commitToPath, EOF_CHAR, hashString, inputState, literals, saveConsumedInput, tabsize, text, tokenObjectClass, traceDepth
AELSE, AELSEIF, AENDIF, AGLOBAL, AIF, ALPHA, AMESSAGE, AMPER, APOST, ARESUME, ASCOPED, ASTMT, ASTRING, ASUSPEND, ATHEN, AUNDEFINE, CODE, COMM_CLOSE, COMM_OPEN, COMMENT, DIGIT, DIGITS, EOF, EQUALS, LBRACE, NL, NULL_TREE_LOOKAHEAD, PPNAME, QSTRING, QUOTE, RBRACE, SLASH_SLASH, SPECIAL, STAR, STRING, TAB, WS, XAPOST, XQUOTE
Constructor and Description |
---|
BracesLexer(Environment env)
Constructor.
|
BracesLexer(antlr.InputBuffer ib) |
BracesLexer(java.io.InputStream in) |
BracesLexer(antlr.LexerSharedInputState state) |
BracesLexer(java.io.Reader in) |
Modifier and Type | Method and Description |
---|---|
void |
mAMPER(boolean _createToken)
Matches a single ampersand character.
|
void |
mCODE(boolean _createToken)
Matches a preprocessor input that has no other interpretation.
|
protected void |
mDIGIT(boolean _createToken)
Matches a single decimal digit on input.
|
void |
mDIGITS(boolean _createToken)
Matches any number of successive decimal digits on input.
|
void |
mEQUALS(boolean _createToken)
Matches a single equal character.
|
private static long[] |
mk_tokenSet_0() |
private static long[] |
mk_tokenSet_1() |
private static long[] |
mk_tokenSet_2() |
void |
mQUOTE(boolean _createToken)
Matches a single quote (not apostrophe) character.
|
void |
mSTAR(boolean _createToken)
Matches a single asterisk character.
|
void |
mWS(boolean _createToken)
Matches any amount of whitespace on input.
|
antlr.Token |
nextToken() |
append, append, commit, consume, consumeUntil, consumeUntil, getCaseSensitive, getCaseSensitiveLiterals, getColumn, getCommitToPath, getFilename, getInputBuffer, getInputState, getLine, getTabSize, getText, getTokenObject, LA, makeToken, mark, match, match, match, matchNot, matchRange, newline, panic, panic, reportError, reportError, reportWarning, resetText, rewind, setCaseSensitive, setColumn, setCommitToPath, setFilename, setInputState, setLine, setTabSize, setText, setTokenObjectClass, tab, testLiteralsTable, testLiteralsTable, toLower, traceIn, traceIndent, traceOut, uponEOF
private Environment env
private boolean isUnixEscapes
public static final antlr.collections.impl.BitSet _tokenSet_0
public static final antlr.collections.impl.BitSet _tokenSet_1
public static final antlr.collections.impl.BitSet _tokenSet_2
public BracesLexer(Environment env)
env
- Shared preprocessor environment.public BracesLexer(java.io.InputStream in)
public BracesLexer(java.io.Reader in)
public BracesLexer(antlr.InputBuffer ib)
public BracesLexer(antlr.LexerSharedInputState state)
public antlr.Token nextToken() throws antlr.TokenStreamException
nextToken
in interface antlr.TokenStream
antlr.TokenStreamException
public final void mWS(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
Spaces, tabs and newlines are all matched. This is a top level lexer rule
which means that there is an associated WS
token.
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
public final void mEQUALS(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
This is a top level lexer rule which means that there is an associated
EQUALS
token.
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
public final void mSTAR(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
This is a top level lexer rule which means that there is an associated
STAR
token.
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
public final void mAMPER(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
This is a top level lexer rule which means that there is an associated
AMPER
token.
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
public final void mQUOTE(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
This is a top level lexer rule which means that there is an associated
QUOTE
token.
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
public final void mDIGITS(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
This is a top level lexer rule which means that there is an associated
DIGITS
token.
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
protected final void mDIGIT(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
public final void mCODE(boolean _createToken) throws antlr.RecognitionException, antlr.CharStreamException, antlr.TokenStreamException
RBRACE
token. Note that the
ClearStream
implementation returns the escape character instead
of "eating" it when it is parsing braces. The escape character is either
tilde or backslash (but backslash is only honored if UNIX escapes are
honored) and must be detected here to differentiate between text and
the RBRACE
. If an escaped right brace is matched, note that
the escape character is dropped unless we are parsing inside a string
literal (further up the stack).
This is a top level lexer rule which means that there is an associated
CODE
token.
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException
private static final long[] mk_tokenSet_0()
private static final long[] mk_tokenSet_1()
private static final long[] mk_tokenSet_2()