|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lpg.lpgjavaruntime.LexStream lpg.lpgjavaruntime.LpgLexStream org.eclipse.ocl.lpg.AbstractLexer
public abstract class AbstractLexer
The AbstractLexer
supports lexical analysis of keyword tokens produced by
a keyword lexer to create syntactic tokens for an AbstractLexer
that
creates a corresponding CST, that may in turn be
exploited by an AbstractAnalyzer
to create an AST.
Derived classes should extend the abstract support for AST from CST from tokens from text
parsing and analysis to support the AST and CST classes appropriate to a particular language.
Field Summary | |
---|---|
protected static int |
ECLIPSE_TAB_VALUE
|
Fields inherited from interface lpg.lpgjavaruntime.ParseErrorCodes |
---|
BEFORE_CODE, DELETION_CODE, EOF_CODE, ERROR_CODE, errorMsgText, INSERTION_CODE, INVALID_CODE, INVALID_TOKEN_CODE, LEX_ERROR_CODE, MERGE_CODE, MISPLACED_CODE, SCOPE_CODE, SECONDARY_CODE, SUBSTITUTION_CODE |
Constructor Summary | |
---|---|
AbstractLexer(BasicEnvironment environment)
|
|
AbstractLexer(BasicEnvironment environment,
char[] input_chars,
String filename,
int tab)
|
|
AbstractLexer(BasicEnvironment environment,
String filename,
int tab)
|
Method Summary | |
---|---|
protected int |
computeErrorCode(int leftToken,
int rightToken)
|
BasicEnvironment |
getEnvironment()
|
static char[] |
getInputChars(Reader reader)
Read all input characters from a reader. |
int[] |
getKeywordKinds()
Queries the token kinds, as defined by my keyword lexer, of tokens that are keywords in by grammar. |
void |
initialize(char[] inputChars)
Define the input text as a given array of characters. |
void |
initialize(Reader reader)
Define the input text by reading from a reader. |
void |
lexToTokens(AbstractParser parser)
|
abstract void |
lexToTokens(lpg.lpgjavaruntime.Monitor monitor,
AbstractParser parser)
|
void |
reportError(int leftToken,
int rightToken)
Errors generated within the lexer are redirected to the error handler if there is one. |
Methods inherited from class lpg.lpgjavaruntime.LpgLexStream |
---|
getKind, orderedExportedSymbols |
Methods inherited from class lpg.lpgjavaruntime.LexStream |
---|
afterEol, badToken, computeLineOffsets, getCharValue, getColumn, getColumnOfCharAt, getEndColumn, getEndLine, getFileName, getFirstErrorToken, getInputChars, getLastErrorToken, getLine, getLine, getLineCount, getLineNumberOfCharAt, getLineOffset, getLineOffsets, getName, getNext, getPrevious, getPrsStream, getStreamIndex, getStreamLength, getTab, getToken, getToken, initialize, initialize, makeErrorToken, makeToken, peek, reportError, reportError, reportError, reset, reset, setFileName, setInputChars, setLineOffset, setLineOffsets, setPrsStream, setStreamIndex, setStreamLength, setTab |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface lpg.lpgjavaruntime.RuleAction |
---|
ruleAction |
Field Detail |
---|
protected static final int ECLIPSE_TAB_VALUE
Constructor Detail |
---|
public AbstractLexer(BasicEnvironment environment, String filename, int tab) throws IOException
IOException
public AbstractLexer(BasicEnvironment environment, char[] input_chars, String filename, int tab)
public AbstractLexer(BasicEnvironment environment)
Method Detail |
---|
public static char[] getInputChars(Reader reader) throws IOException
reader
- providing the source text
IOException
- if reading failsprotected int computeErrorCode(int leftToken, int rightToken)
public BasicEnvironment getEnvironment()
public int[] getKeywordKinds()
public void lexToTokens(AbstractParser parser)
public abstract void lexToTokens(lpg.lpgjavaruntime.Monitor monitor, AbstractParser parser)
public void reportError(int leftToken, int rightToken)
reportError
in interface lpg.lpgjavaruntime.TokenStream
reportError
in class lpg.lpgjavaruntime.LexStream
public void initialize(char[] inputChars)
buffer
- the characterspublic void initialize(Reader reader) throws IOException
reader
- providing the source text
IOException
- if reading fails
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |