public abstract class AbstractAnalyzer extends Object
AbstractAnalyzer
supports semantic analysis of a CST
produced by an AbstractParser
to create a corresponding AST. It
is necessary that syntactic parsing and semantic analysis are performed in
two steps because LPG is a bottom up parser and cannot provide enough
contextual information to create the AST on the first pass.
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.Modifier and Type | Method and Description |
---|---|
String |
computeInputString(CSTNode node)
Obtains the text from which the specified CST
node was
parsed. |
void |
dumpTokens() |
void |
ERROR(List<?> problemObjects,
String rule,
String problemMessage) |
void |
ERROR(Object problemObject,
String rule,
String problemMessage) |
void |
ERROR(String problemMessage) |
String |
formatClass(Object object) |
String |
formatEClassName(EObject object) |
String |
formatName(Object object) |
String |
formatPath(List<String> pathName) |
String |
formatPath(List<String> pathName,
String name) |
String |
formatQualifiedName(Object object) |
String |
formatString(String string) |
String |
formatType(Object object) |
AbstractParser |
getAbstractParser()
Obtains the parser that I use to transform the OCL text into the Concrete
Syntax Model.
|
int |
getCharOffset() |
BasicEnvironment |
getEnvironment() |
FormattingHelper |
getFormatter()
Get the message formatting assistant, returning the value set by
setFormatter, if non-null, else that provided by the environment, if
non-null, else AbstractFormattingHelper.INSTANCE.
|
AbstractLexer |
getLexer() |
AbstractParser |
getParser()
Deprecated.
Since 1.3, use the
getAbstractParser() method,
instead. |
boolean |
getTraceFlag() |
void |
initialize(char[] buffer)
Deprecated.
clients should invoke
reset(char[], String) |
void |
initialize(Reader reader)
Deprecated.
clients should invoke
reset(Reader, String) |
void |
reset(char[] buffer,
String fileName)
Define the input text as a given array of characters.
|
void |
reset(Reader reader,
String fileName)
Define the input text by reading from a reader.
|
void |
setCharacterOffset(int offset)
Sets the character index offset of the input.
|
void |
setFileName(String filename) |
void |
setTab(int tab) |
void |
setTraceFlag(boolean flag) |
public String computeInputString(CSTNode node)
node
was
parsed.node
- a concrete syntax nodepublic void dumpTokens()
public String formatEClassName(EObject object)
public AbstractParser getAbstractParser()
public int getCharOffset()
public BasicEnvironment getEnvironment()
public FormattingHelper getFormatter()
public AbstractLexer getLexer()
@Deprecated public AbstractParser getParser()
getAbstractParser()
method,
instead.public boolean getTraceFlag()
public void setCharacterOffset(int offset)
offset
- public void setFileName(String filename)
@Deprecated public void initialize(char[] buffer)
reset(char[], String)
buffer
- the characters@Deprecated public void initialize(Reader reader) throws IOException
reset(Reader, String)
reader
- providing the source textIOException
- if reading failspublic void reset(char[] buffer, String fileName)
buffer
- the charactersfileName
- the associated finleName of the input, or null
if none.public void reset(Reader reader, String fileName) throws IOException
reader
- providing the source textfileName
- the associated finleName of the input, or null
if none.IOException
- if reading failspublic void setTab(int tab)
public void setTraceFlag(boolean flag)
public void ERROR(String problemMessage)
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.