public abstract class BaseRawASTokenizer extends BaseRawTokenizer<ASToken>
Modifier and Type | Field and Description |
---|---|
protected ASToken |
bufferToken
token that we may need to return for rules that may return more than one
token
|
protected boolean |
collectComments
Flag to indicate we should collect comments
|
protected int |
docTypeLevel
Nested '<' bracket level (for
|
protected int |
e4xBraceBalance
The depth of the braces in E4X content.
|
protected int |
e4xReturnState
State to return to from E4X.
|
protected int |
e4xTagDepth
The depth of open tags, used to determine if we're still in E4X content.
|
protected boolean |
isInCloseTag
Tracks if we are in a close tag.
|
protected int |
typedDepth
Depth of typed collection constructs.
|
aggregateContents, aggregateStart, aggregateStartColumn, aggregateStartLine
Constructor and Description |
---|
BaseRawASTokenizer() |
Modifier and Type | Method and Description |
---|---|
protected void |
aggregateEscapedUnicodeChar(String escapeSequence)
Convert the unicode escape sequence and append the unicode character to
text buffer.
|
protected abstract char[] |
buffer()
returns the current active buffer. this will change and is not constant
|
ASToken |
buildAggregateToken(int type)
Build a token from the aggregation buffer.
|
protected ASToken |
buildE4XTextToken(int type)
Build an e4x text token from a given entity type.
|
protected void |
continueAggregate()
Add the current yytext() to the current aggregate
|
protected static int |
decodeEscapedUnicode(String escapedUnicode)
Convert escaped unicode sequence such as
ÿ and \xFF
to unicode code point. |
protected String |
escapedUnicodeToHtmlEntity(String escapedUnicode)
Convert escaped unicode sequence such as
ÿ and \xFF
to HTML entities like ÿ . |
protected void |
fillBuffer(StringBuilder builder) |
ASToken |
getBufferToken() |
boolean |
hasBufferToken() |
protected ASToken[] |
initTokenPool() |
boolean |
isCollectingComments() |
boolean |
isInE4XDatabinding() |
boolean |
isInXML() |
protected abstract int |
markedPosition()
returns the marked position in the current read
|
protected ASToken |
newToken(int type,
int start,
int end,
int line,
int column,
CharSequence text) |
protected abstract int |
readEnd()
returns the end of the current read
|
protected abstract int |
readStart()
returns the start of the current read
|
protected void |
reportInvalidLineTerminatorInStringLiteral()
Report unexpected line terminators in a string literal.
|
protected void |
reportUnclosedASDoc()
Report syntax error: input ended before ASDoc is closed.
|
protected void |
reportUnclosedStringLiteral()
Report syntax error: input ended before reaching the closing quotation
mark for a string literal.
|
void |
reset() |
protected abstract void |
setAllowLTInE4XStringLiterals(boolean allow)
in E4X,
< is allowed in char and string literals. |
void |
setCollectComments(boolean collect)
True if we want to collect comments, besides ASDoc.
|
protected abstract void |
yybegin(int state)
begins the current state in the lexer
|
protected abstract char |
yycharat(int pos)
returns a char at the given offset into the internal char buffer
|
protected abstract int |
yylength()
returns the length of the current read
|
addBadCharacterProblem, buildToken, buildToken, buildToken, continueAggregate, continueAggregate, continueAggregate, continueAggregate, fetchToken, getColumn, getContext, getCurrentSourceLocation, getLastTokenText, getLastTokenType, getLine, getOffset, getProblems, getSourcePath, hasAggregateContents, hasProblems, setLastToken, setReuseLastToken, setSourcePath, startAggregate, startAggregate, yytext
protected boolean isInCloseTag
protected int e4xTagDepth
protected int e4xBraceBalance
protected int e4xReturnState
protected int typedDepth
protected int docTypeLevel
protected boolean collectComments
protected ASToken bufferToken
protected void continueAggregate()
BaseRawTokenizer
continueAggregate
in class BaseRawTokenizer<ASToken>
protected final void aggregateEscapedUnicodeChar(String escapeSequence)
escapeSequence
- Unicode escape sequence like ÿ
or
\xFF
.public final ASToken buildAggregateToken(int type)
buildAggregateToken
in class BaseRawTokenizer<ASToken>
type
- Type of the new token.protected final ASToken buildE4XTextToken(int type)
protected final void fillBuffer(StringBuilder builder)
fillBuffer
in class BaseRawTokenizer<ASToken>
protected abstract int readStart()
protected abstract int markedPosition()
protected abstract int readEnd()
protected abstract char[] buffer()
public void setCollectComments(boolean collect)
collect
- true
false to ignore them.protected abstract void setAllowLTInE4XStringLiterals(boolean allow)
<
is allowed in char and string literals.allow
- true if <
is allowedprotected ASToken[] initTokenPool()
initTokenPool
in class BaseRawTokenizer<ASToken>
public boolean isInXML()
public boolean isInE4XDatabinding()
protected abstract void yybegin(int state)
state
- the state to beginprotected abstract char yycharat(int pos)
pos
- the offset into the bufferprotected abstract int yylength()
protected final ASToken newToken(int type, int start, int end, int line, int column, CharSequence text)
newToken
in class BaseRawTokenizer<ASToken>
public final boolean isCollectingComments()
public final ASToken getBufferToken()
public final boolean hasBufferToken()
public void reset()
reset
in class BaseRawTokenizer<ASToken>