java.lang.Objectorg.eclipse.gmt.umlx.cst.parser.AbstractParser
org.eclipse.gmt.umlx.ocl.cst.parser.AbstractOCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
public abstract class AbstractOCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
The OCLLpgParser
parses an OCL expression into a CST.
Once the CST is created, the OCLParser
walks the CST
and creates the OCL AST. It is necessary that this be done in two steps
because LPG is a bottom up parser and cannot provide enough contextual
information to create the AST on the first pass.
Field Summary | |
---|---|
static java.lang.String[] |
errorMessages
|
Constructor Summary | |
---|---|
AbstractOCLParser(org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
|
Method Summary | |
---|---|
static boolean |
equalName(java.lang.String name,
java.lang.String elementName)
Checks whether the names are equal, accounting for possibility of underscore-escaped names. |
static boolean |
isEscaped(java.lang.String name)
Queries whether the specified name is escaped with an initial underscore ( '_' ) character. |
static boolean |
isIdentifierOrKeyword(int tokenKind)
Returns true if the token kind is an identifier or keyword, othewise false. |
static java.lang.String |
unescape(java.lang.String name)
Obtains the unescaped name (assuming that it is escaped) for another attempt to look it up. |
Methods inherited from class org.eclipse.gmt.umlx.cst.parser.AbstractParser |
---|
computeInputString, computeInputString, dumpTokens, ERROR, flushErrors, formatClass, formatEClassName, formatName, formatPath, formatPath, formatString, formatType, getCharOffset, getErrorHandler, getInputChars, getLexStream, getMonitor, getPrsStream, getTraceFlag, isCancelled, lexerError, parserError, setCharacterOffset, setErrorHandler, setFileName, setInputChars, setInputReader, setMonitor, setTab, setTraceFlag |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] errorMessages
Constructor Detail |
---|
public AbstractOCLParser(org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
Method Detail |
---|
public static boolean isIdentifierOrKeyword(int tokenKind)
tokenKind
- the token kind to compare
public static boolean isEscaped(java.lang.String name)
'_'
) character.
name
- a name
public static java.lang.String unescape(java.lang.String name)
name
- an OCL-escaped name
public static boolean equalName(java.lang.String name, java.lang.String elementName)
name
- a possibly underscore-escaped nameelementName
- name of an element in the model