public class OCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> extends AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
OCLAnalyzer performs semantic analysis on a CST produced by
an OCLParser to create the 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.IMPLICIT_SET_CONVERSION, OCL_ANNOTATIONS_URI| Constructor and Description |
|---|
OCLAnalyzer(AbstractOCLParser parser)
Construct an OCL semantic analyzer that will use a given parser to
perform syntactic and lexical analysis.
|
OCLAnalyzer(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
Construct an OCL semantic analyzer with default syntactic and lexical
parsers all operating within a given environment.
|
OCLAnalyzer(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment,
String text)
Construct an OCL semantic analyzer with default syntactic and lexical
parsers all operating within a given environment.
|
OCLAnalyzer(OCLParser parser)
Construct an OCL semantic analyzer that will use a given parser to
perform syntactic and lexical analysis.
|
| Modifier and Type | Method and Description |
|---|---|
void |
ERROR(List<?> problemObjects,
String rule,
String problemMessage) |
void |
ERROR(Object problemObject,
String rule,
String problemMessage) |
void |
ERROR(String problemMessage) |
OCLParser |
getParser()
Deprecated.
Use the
AbstractOCLAnalyzer.getAbstractParser() method, instead |
OCLExpression<C> |
parseAST(OCLExpressionCS cst,
ConstraintKind constraintType)
Parses the specified concrete syntax model to an abstract syntax model.
|
CSTNode |
parseConcreteSyntax()
Performs a concrete-syntax parser and throws
ParserException
if any parse errors are encountered. |
CT |
parseInitOrDerValueCS()
Parses the input as an InitOrDerValueCS.
|
CT |
parseInvOrDefCS()
Parses the input as an InvOrDefCS.
|
List<CT> |
parseOCLDocument(List<CT> constraints)
Parses the input as an OCLDocumentCS.
|
List<CT> |
parsePackageDeclarationCS(List<CT> constraints)
Parses the input as a PackageDeclarationCS.
|
CT |
parsePrePostOrBodyDeclCS()
Parses the input as a PrePostOrBodyDeclCS.
|
Variable<C,PM> |
parseVariableDeclarationCS(boolean addToEnvironment)
Parses the input as a VariableDeclarationCS.
|
createSequenceOfNames, equalName, getAbstractParser, getOCLEnvironment, isEscaped, isIdentifierOrKeyword, unescapecomputeInputString, dumpTokens, formatClass, formatEClassName, formatName, formatPath, formatPath, formatQualifiedName, formatString, formatType, getCharOffset, getEnvironment, getFormatter, getLexer, getTraceFlag, initialize, initialize, reset, reset, setCharacterOffset, setFileName, setTab, setTraceFlagpublic OCLAnalyzer(AbstractOCLParser parser)
parser - the syntactic (and lexical) parserpublic OCLAnalyzer(OCLParser parser)
parser - the syntactic (and lexical) parserpublic OCLAnalyzer(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
environment - the symbolic and problem handling environmentpublic OCLAnalyzer(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment, String text)
environment - the symbolic and problem handling environmenttext - the source text for analysis@Deprecated public OCLParser getParser()
AbstractOCLAnalyzer.getAbstractParser() method, insteadAbstractAnalyzerpublic CSTNode parseConcreteSyntax()
ParserException
if any parse errors are encountered.null if it could not be parsedpublic OCLExpression<C> parseAST(OCLExpressionCS cst, ConstraintKind constraintType)
cst - the OCL concrete syntax modelconstraintType - the kind of constraint to parsepublic List<CT> parseOCLDocument(List<CT> constraints)
constraints - the constraints list to populatepublic List<CT> parsePackageDeclarationCS(List<CT> constraints)
constraints - public CT parseInvOrDefCS()
null if it could not
be parsedpublic CT parsePrePostOrBodyDeclCS()
null if it could not
be parsedpublic CT parseInitOrDerValueCS()
null if it could not
be parsedpublic Variable<C,PM> parseVariableDeclarationCS(boolean addToEnvironment)
addToEnvironment - boolean whether or not to add the the parsed variable to the
environmentnull if it could
not be parsedpublic void ERROR(List<?> problemObjects, String rule, String problemMessage)
ERROR in class AbstractAnalyzerpublic void ERROR(Object problemObject, String rule, String problemMessage)
ERROR in class AbstractAnalyzerpublic void ERROR(String problemMessage)
ERROR in class AbstractAnalyzerCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.