public abstract class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> extends AbstractAnalyzer
AbstractOCLAnalyzer
supports semantic analysis of a CST
produced by an AbstractOCLParser
to create the Essential OCL
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 EssentialOCL to full
support for whatever language in which EssentialOCL is embedded.Modifier and Type | Field and Description |
---|---|
static String |
IMPLICIT_SET_CONVERSION
When a detail with this key is in an annotation with URI
Environment.OCL_NAMESPACE_URI on a CollectionLiteralExp ,
this means that the collection literal was created by the analyzer
implicitly for a -> set conversion. |
static String |
OCL_ANNOTATIONS_URI |
Constructor and Description |
---|
AbstractOCLAnalyzer(AbstractOCLParser parser) |
Modifier and Type | Method and Description |
---|---|
static <any> |
createSequenceOfNames(PathNameCS pathNameCS,
SimpleNameCS simpleNameCS) |
static boolean |
equalName(String name,
String elementName)
Checks whether the names are equal, accounting for possibility of
underscore-escaped names.
|
AbstractOCLParser |
getAbstractParser()
Obtains the parser that I use to transform the OCL text into the Concrete
Syntax Model.
|
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
getOCLEnvironment() |
AbstractOCLParser |
getParser()
Obtains my parser.
|
static boolean |
isEscaped(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, otherwise
false.
|
static String |
unescape(String name)
Obtains the unescaped name (assuming that it
is escaped) for another attempt to look
it up.
|
computeInputString, dumpTokens, ERROR, ERROR, ERROR, formatClass, formatEClassName, formatName, formatPath, formatPath, formatQualifiedName, formatString, formatType, getCharOffset, getEnvironment, getFormatter, getLexer, getTraceFlag, initialize, initialize, reset, reset, setCharacterOffset, setFileName, setTab, setTraceFlag
public static final String OCL_ANNOTATIONS_URI
public static final String IMPLICIT_SET_CONVERSION
Environment.OCL_NAMESPACE_URI
on a CollectionLiteralExp
,
this means that the collection literal was created by the analyzer
implicitly for a ->
set conversion. In this case,
if the single item evaluates to null
it must not be
added to the resulting collection by an evaluator.public AbstractOCLAnalyzer(AbstractOCLParser parser)
public AbstractOCLParser getAbstractParser()
AbstractAnalyzer
getAbstractParser
in class AbstractAnalyzer
public AbstractOCLParser getParser()
AbstractAnalyzer
getParser
in class AbstractAnalyzer
public static boolean isIdentifierOrKeyword(int tokenKind)
tokenKind
- the token kind to comparepublic static <any> createSequenceOfNames(PathNameCS pathNameCS, SimpleNameCS simpleNameCS)
public static boolean isEscaped(String name)
'_'
) character.name
- a namepublic static String unescape(String name)
name
- an OCL-escaped namepublic static boolean equalName(String name, String elementName)
name
- a possibly underscore-escaped nameelementName
- name of an element in the modelCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.