Methods |
Add filter that can intercept and reject Mapper report line before the
line is processed by the lexer during getToken .
- Parameters:
aFilter - line filter to add.
public void addLineFilter(com.arsi.mj.maprpt.lexer.MaprptLexer.LineFilter aFilter)
|
Add resolver to handle references to Mapper reports encountered by lexer
during getToken .
- Parameters:
aResolver - Mapper report reference resolver to add.
public void addMaprptRefResolver(com.arsi.mj.maprpt.lexer.MaprptReferenceResolver aResolver)
|
Get number of cabinet of Mapper report being parsed. public final int cabinetNumber()
|
Get letter of drawer of Mapper report being parsed. public final char drawerLetter()
|
Force the next Mapper report line read by the lexer to be ignored. This is a
one-shot setting that must be set again before the next line is parsed.
- Parameters:
aCallback - required callback that is invoked to report the ignore line.
public void forceIgnoreOfNextLine(com.arsi.mj.maprpt.lexer.MaprptLexer.IgnoreRunLineCallback aCallback)
|
Get the characters remaining in the input buffer for this at-sign line after the
last command token parsed. The characters in the buffer are raw input (no token
replacement applied). Command tokens already parsed but pushed back are included
in the buffer as text, but token replacement has occurred for such pushed-back text.
- Returns:
- copy of characters remaining in the raw input buffer (changes are not
reflected in the input buffer), or NULL if none remaining.
public char getCopyOfRemainingRawInputBuffer()
|
Get number of nested calls from another lexer to this instance, i.e., as occurs
with the :INCLUDE statement.
- Returns:
- number of nested calls, zero indicates no nested references to this lexer.
public final int getNestingLevel()
|
Perform lexical analysis to get next token from parse unit created from Mapper report.
- Throws:
MJTranslateException - if an unexpected parsing error occurs.
- Returns:
- a token, which is either a content token (some kind of content other than a RUN command, e.g.,
text, column headings, data tuples) or a command token (the token is the smallest lexical
unit that can can be parsed from a Mapper command on an at-sign line). NULL is returned
when no more tokens are available in the parse unit.
public com.arsi.mj.maprpt.lexer.tokens.IMaprptToken getNextToken() throws com.arsi.mj.MJTranslateException
|
Get character that is the re-defined "quoted" string delimiter, if any.
- Returns:
- character that is the re-defined quoted string delimiter or null if
quoted string delimiter was not re-defined.
public java.lang.Character getRedefinedQuotedStringDelimiter()
|
Get the characters remaining in the input buffer for this at-sign line after the
last command token parsed, and advance to the next line. The characters in the buffer
are raw input (no token replacement applied). Command tokens already parsed but pushed
back are included in the buffer as text, but token replacement has occurred for such
pushed-back text.
- Returns:
- characters remaining in the raw input buffer after the last command token parsed,
and until the end of the current at-sign line, or NULL if none remaining.
public char getRemainingRawInputBufferAndAdvanceToNextLine()
|
Get starting line of label table (":L" lines) embedded in Mapper report, if any.
- Returns:
- line number of first line in label table, or -1 if none.
public final int getStartingLineOfLabelTable()
|
Get token replacement context that contains token replacements (token name and
replacement value) extracted from :DEFINEs while parsing the Mapper report.
- Returns:
- token replacement context.
public final com.arsi.mj.maprpt.lexer.TokenReplacementContext getTokenReplacementContext()
|
Find all occurrences of column headings as column metadata in the parsed
Mapper report lines as a prerequisite to lexical analysis of tokens. public void initializeColumnMetadata()
|
Determine if specified command token the first token parsed from the at-sign line
undergoing parsing.
- Parameters:
aCmdToken - token to check as first parsed token.
- Returns:
- true if first token parsed from at-sign line, false if not.
public boolean isFirstCommandTokenParsedFromLine(com.arsi.mj.maprpt.lexer.tokens.ICommandToken aCmdToken)
|
Parse the rest of a double quoted string literal from an input at-sign line,
where a token representing the opening double quote was the very last command
token returned by the lexer.
- Throws:
MJTranslateException - if a dangling double quote is detected.
- Returns:
- a quoted string token.
public com.arsi.mj.maprpt.lexer.tokens.cmd.QuotedStringToken parseRemainingDoubleQuotedString() throws com.arsi.mj.MJTranslateException
|
Push token back to lexer so that getting the next token returns the pushed back token
instead of parsing a new token from the input.
- Parameters:
aToken - token to push back.
public void pushbackToken(com.arsi.mj.maprpt.lexer.tokens.IMaprptToken aToken)
|
Read ahead to find index of left bracket in input that starts an array dimension,
useful primarily when parsing an array declaration (e.g., LDA command).
- Parameters:
aCmdLexerState - object that holds state while parsing command tokens from at-sign line.
- Returns:
- index of left bracket that starts an array dimension, where index matches the
token index of the left bracket token that would eventually be returned by calling
getNextToken on this lexer, or -1 if none found before array declaration
is presumed to end (e.g., found blank., period or end-of-line).
public int readAheadForArrayDimension(com.arsi.mj.maprpt.lexer.tokens.IMaprptToken anInitialToken) throws com.arsi.mj.MJTranslateException
|
Re-define the character that delimits "quoted" strings, i.e., causes a
QuotedStringToken token to be recognized, parsed and returned
by getNextToken .
- Parameters:
aDelimChar - character that delimits "quoted" strings.
public void redefineQuotedStringDelimiter(char aDelimChar)
|
Get number of Mapper report being parsed. public final int reportNumber()
|
Clear any re-definition of the character that delimits "quoted" strings,
restoring a single quote as the quoted string delimiter. public void resetQuotedStringDelimiter()
|
Set whether a single quote typically used to delimited a quoted string is escaped
by doubling the single quote (e.g., 'Wayne''s World').
- Parameters:
anEscapeByDoublingFlag - true to escape single quote by doubling up, or false if not escaping by doubling up.
public void setEscapeQuotedStringDelimiterByDoubling(boolean anEscapeByDoublingFlag)
|
Set token replacement context that contains token replacements (token name and
replacement value) extracted from :DEFINEs while parsing the Mapper report.
- Parameters:
aTokenReplCtx - token replacements (token name and replacement value) extracted from :DEFINEs.
public final void setTokenReplacementContext(com.arsi.mj.maprpt.lexer.TokenReplacementContext aTokenReplCtx)
|
Set class of command token that should be returned to signal end-of-command when end of an
at-sign line is encountered. This class must have a public constructor that takes one
argument, the at-sign line (AtLine ) whose end was detected.
By default, a PeriodToken is returned to signal end-of-command when
end of an at-sign line is encountered. To change the token, call this method immediately
after creating an instance of the lexer.
- Parameters:
anEndOfLineCmdTokenClass - typically either the class of PeriodToken for RUN commands or
SemicolonToken if using the lexer to parse SC
directives.
public void useCommandTokenAsEndOfLine(java.lang.Class anEndOfLineCmdTokenClass)
|