|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
Constructor Summary | |
---|---|
AbstractLexer(BasicEnvironment environment)
|
Method Summary | |
---|---|
BasicEnvironment |
getEnvironment()
|
abstract DerivedLexStream |
getILexStream()
|
static char[] |
getInputChars(java.io.Reader reader)
Read all input characters from a reader. |
abstract int[] |
getKeywordKinds()
Queries the token kinds, as defined by my keyword lexer, of tokens that are keywords in by grammar. |
abstract ILexStream |
getLexStream()
|
abstract LexParser |
getParser()
|
abstract ParseTable |
getParseTable()
|
void |
initialize(char[] inputChars)
Deprecated. clients should use reset(char[], String) |
void |
initialize(java.io.Reader reader)
Deprecated. clients should invoke reset(Reader, String) |
abstract void |
lexer(DerivedPrsStream prsStream)
Runs the lexer's with the provided parseStream |
abstract void |
lexer(DerivedPrsStream prsStream,
int start_offset,
int end_offset)
Runs the lexer's with the provided parseStream
in specific offset of the input |
abstract void |
lexer(Monitor monitor,
DerivedPrsStream prsStream)
Runs the lexer's with the provided parseStream and
the given monitor. |
abstract void |
lexer(Monitor monitor,
DerivedPrsStream prsStream,
int start_offset,
int end_offset)
Runs the lexer's with the provided parseStream
in specific offset of the input |
void |
lexToTokens(AbstractParser parser)
Deprecated. clients should invoke lexer(DerivedPrsStream) |
void |
lexToTokens(Monitor monitor,
AbstractParser parser)
Deprecated. clients should invoke lexer(Monitor, DerivedPrsStream) |
abstract void |
reportLexicalError(int startLoc,
int endLoc)
Report a lexical error in the given localization (start and end offset) |
abstract void |
reset(char[] input_chars,
java.lang.String filename)
Resets the lexer's input with the given char's array. |
abstract void |
reset(char[] input_chars,
java.lang.String filename,
int tab)
Resets the lexer's input with the given char's array. |
abstract void |
reset(java.io.Reader reader,
java.lang.String filename)
Resets the lexer's input with the given Reader |
abstract void |
resetKeywordLexer()
Rsets the lexer's keywordLexer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractLexer(BasicEnvironment environment)
Method Detail |
---|
public static char[] getInputChars(java.io.Reader reader) throws java.io.IOException
reader
- providing the source text
java.io.IOException
- if reading failspublic BasicEnvironment getEnvironment()
@Deprecated public void initialize(char[] inputChars)
reset(char[], String)
inputChars
- the characters@Deprecated public void initialize(java.io.Reader reader) throws java.io.IOException
reset(Reader, String)
reader
- providing the source text
java.io.IOException
- if reading fails@Deprecated public void lexToTokens(AbstractParser parser)
lexer(DerivedPrsStream)
parser
- the AbstractParser
instance@Deprecated public void lexToTokens(Monitor monitor, AbstractParser parser)
lexer(Monitor, DerivedPrsStream)
parser
- the AbstractParser
instancepublic abstract int[] getKeywordKinds()
public abstract DerivedLexStream getILexStream()
lexStream
public abstract void reset(char[] input_chars, java.lang.String filename)
input_chars
- the new lexer's inputfilename
- a file name used for logging when encountering errors/warningspublic abstract void reset(char[] input_chars, java.lang.String filename, int tab)
input_chars
- the new lexer's inputfilename
- a file name used for logging when encountering errors/warningstab
- lexer's tab length.public abstract void reset(java.io.Reader reader, java.lang.String filename) throws java.io.IOException
reader
- the new lexer's inputfilename
- a file name used for logging when encountering errors/warnings
java.io.IOException
public abstract void lexer(DerivedPrsStream prsStream)
parseStream
prsStream
- the associated parseStream
public abstract void lexer(Monitor monitor, DerivedPrsStream prsStream)
parseStream
and
the given monitor.
monitor
- the Monitor
prsStream
- the associated parseStream
public abstract void lexer(DerivedPrsStream prsStream, int start_offset, int end_offset)
parseStream
in specific offset of the input
prsStream
- the associated parseStream
start_offset
- the start offsetend_offset
- the end offsetpublic abstract void lexer(Monitor monitor, DerivedPrsStream prsStream, int start_offset, int end_offset)
parseStream
in specific offset of the input
prsStream
- the associated parseStream
start_offset
- the start offsetend_offset
- the end offsetpublic abstract ParseTable getParseTable()
ParseTable
public abstract LexParser getParser()
LexParser
public abstract void resetKeywordLexer()
public abstract ILexStream getLexStream()
lexStream
public abstract void reportLexicalError(int startLoc, int endLoc)
startLoc
- the offset the error startsendLoc
- the offset the error ends.
|
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 |