|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.lpg.AbstractAnalyzer
public abstract class AbstractAnalyzer
The 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.
Constructor Summary | |
---|---|
protected |
AbstractAnalyzer(AbstractParser parser)
|
Method Summary | |
---|---|
java.lang.String |
computeInputString(CSTNode node)
Obtains the text from which the specified CST node was
parsed. |
void |
dumpTokens()
|
void |
ERROR(java.util.List<?> problemObjects,
java.lang.String rule,
java.lang.String problemMessage)
|
void |
ERROR(java.lang.Object problemObject,
java.lang.String rule,
java.lang.String problemMessage)
|
void |
ERROR(java.lang.String problemMessage)
|
java.lang.String |
formatClass(java.lang.Object object)
|
java.lang.String |
formatEClassName(org.eclipse.emf.ecore.EObject object)
|
java.lang.String |
formatName(java.lang.Object object)
|
java.lang.String |
formatPath(java.util.List<java.lang.String> pathName)
|
java.lang.String |
formatPath(java.util.List<java.lang.String> pathName,
java.lang.String name)
|
java.lang.String |
formatQualifiedName(java.lang.Object object)
|
java.lang.String |
formatString(java.lang.String string)
|
java.lang.String |
formatType(java.lang.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(java.io.Reader reader)
Deprecated. clients should invoke reset(Reader, String) |
protected void |
initPropertyPositions(CallingASTNode callingASTNode,
CSTNode cstNode)
Initializes the start and end positions of the property name in the specified calling AST node. |
protected void |
initStartEndPositions(ASTNode astNode,
CSTNode cstNode)
Initializes the start and end positions of the specified AST node from the given CST node |
protected void |
initTypePositions(TypedASTNode typedASTNode,
CSTNode cstNode)
Initializes the type start and end positions of the specified typed AST node from the given CST node |
protected java.lang.String |
makeName(org.eclipse.emf.common.util.EList<java.lang.String> namelist)
Creates a string by joining the given string list elements with ::. |
protected java.lang.String |
makeString(org.eclipse.emf.common.util.EList<java.lang.String> namelist)
Creates a string by joining the given string list elements with spaces. |
void |
reset(char[] buffer,
java.lang.String fileName)
Define the input text as a given array of characters. |
void |
reset(java.io.Reader reader,
java.lang.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(java.lang.String filename)
|
void |
setTab(int tab)
|
void |
setTraceFlag(boolean flag)
|
protected void |
TRACE(java.lang.String rule,
java.lang.String message)
|
protected void |
TRACE(java.lang.String rule,
java.lang.String message,
org.eclipse.emf.common.util.EList<java.lang.String> namelist)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractAnalyzer(AbstractParser parser)
Method Detail |
---|
public java.lang.String computeInputString(CSTNode node)
node
was
parsed.
node
- a concrete syntax node
public void dumpTokens()
public java.lang.String formatClass(java.lang.Object object)
public java.lang.String formatEClassName(org.eclipse.emf.ecore.EObject object)
public java.lang.String formatName(java.lang.Object object)
public java.lang.String formatQualifiedName(java.lang.Object object)
public java.lang.String formatPath(java.util.List<java.lang.String> pathName)
public java.lang.String formatPath(java.util.List<java.lang.String> pathName, java.lang.String name)
public java.lang.String formatString(java.lang.String string)
public java.lang.String formatType(java.lang.Object 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()
protected void initPropertyPositions(CallingASTNode callingASTNode, CSTNode cstNode)
callingASTNode
- a calling AST nodecstNode
- a CST nodeprotected void initStartEndPositions(ASTNode astNode, CSTNode cstNode)
astNode
- an AST nodecstNode
- a CST nodeprotected void initTypePositions(TypedASTNode typedASTNode, CSTNode cstNode)
typedASTNode
- a typed AST nodecstNode
- a CST nodeprotected java.lang.String makeName(org.eclipse.emf.common.util.EList<java.lang.String> namelist)
namelist
- list of names to make string out of
protected java.lang.String makeString(org.eclipse.emf.common.util.EList<java.lang.String> namelist)
namelist
- list of names to make string out of
public void setCharacterOffset(int offset)
offset
- public void setFileName(java.lang.String filename)
@Deprecated public void initialize(char[] buffer)
reset(char[], String)
buffer
- 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 failspublic void reset(char[] buffer, java.lang.String fileName)
buffer
- the charactersfileName
- the associated finleName of the input, or null
if none.public void reset(java.io.Reader reader, java.lang.String fileName) throws java.io.IOException
reader
- providing the source textfileName
- the associated finleName of the input, or null
if none.
java.io.IOException
- if reading failspublic void setTab(int tab)
public void setTraceFlag(boolean flag)
public void ERROR(java.lang.String problemMessage)
public void ERROR(java.lang.Object problemObject, java.lang.String rule, java.lang.String problemMessage)
public void ERROR(java.util.List<?> problemObjects, java.lang.String rule, java.lang.String problemMessage)
protected void TRACE(java.lang.String rule, java.lang.String message)
protected void TRACE(java.lang.String rule, java.lang.String message, org.eclipse.emf.common.util.EList<java.lang.String> namelist)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |