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>
org.eclipse.gmt.umlx.ocl.cst.parser.OCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
public class OCLParser<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 |
---|
Fields inherited from class org.eclipse.gmt.umlx.ocl.cst.parser.AbstractOCLParser |
---|
errorMessages |
Constructor Summary | |
---|---|
OCLParser(org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
|
|
OCLParser(OCLLexer lexStream,
org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
|
Method Summary | |
---|---|
org.eclipse.ocl.expressions.OCLExpression<C> |
parseAST(org.eclipse.ocl.internal.cst.OCLExpressionCS cst,
org.eclipse.ocl.helper.ConstraintKind constraintType)
Parses the specified concrete syntax model to an abstract syntax model. |
org.eclipse.ocl.internal.cst.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. |
java.util.List<CT> |
parsePackageDeclarationCS(java.util.List<CT> constraints)
Parses the input as a PackageDeclarationCS. |
CT |
parsePrePostOrBodyDeclCS()
Parses the input as a PrePostOrBodyDeclCS. |
org.eclipse.ocl.expressions.Variable<C,PM> |
parseVariableDeclarationCS(boolean addToEnvironment)
Parses the input as a VariableDeclarationCS. |
Methods inherited from class org.eclipse.gmt.umlx.ocl.cst.parser.AbstractOCLParser |
---|
equalName, isEscaped, isIdentifierOrKeyword, unescape |
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 |
Constructor Detail |
---|
public OCLParser(org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
public OCLParser(OCLLexer lexStream, org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
Method Detail |
---|
public final CT parseInitOrDerValueCS() throws org.eclipse.ocl.ParserException
property
- the constrained EStructuralFeature
org.eclipse.ocl.ParserException
- if unable to parse the expressionpublic final CT parseInvOrDefCS() throws org.eclipse.ocl.ParserException
org.eclipse.ocl.ParserException
- if unable to parse the expressionpublic java.util.List<CT> parsePackageDeclarationCS(java.util.List<CT> constraints) throws org.eclipse.ocl.ParserException
constraints
-
org.eclipse.ocl.ParserException
- if unable to parse the expressionpublic final CT parsePrePostOrBodyDeclCS() throws org.eclipse.ocl.ParserException
operation
- the constrained EOperation
org.eclipse.ocl.ParserException
- if unable to parse the expressionpublic final org.eclipse.ocl.expressions.Variable<C,PM> parseVariableDeclarationCS(boolean addToEnvironment) throws org.eclipse.ocl.ParserException
addToEnvironment
- boolean whether or not to add the
the parsed variable to the environment
org.eclipse.ocl.ParserException
- if unable to parse the expressionpublic org.eclipse.ocl.expressions.OCLExpression<C> parseAST(org.eclipse.ocl.internal.cst.OCLExpressionCS cst, org.eclipse.ocl.helper.ConstraintKind constraintType) throws org.eclipse.ocl.ParserException
cst
- the OCL concrete syntax modelconstraintType
- the kind of constraint to parse
org.eclipse.ocl.ParserException
- any exception thrown in parsingpublic org.eclipse.ocl.internal.cst.CSTNode parseConcreteSyntax() throws org.eclipse.ocl.ParserException
ParserException
if any parse errors are encountered.
org.eclipse.ocl.ParserException
- if unable to parse the expression