java.lang.Objectorg.eclipse.ocl.internal.parser.AbstractParser
org.eclipse.ocl.internal.parser.AbstractOCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
org.eclipse.ocl.internal.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.ocl.internal.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 | |
---|---|
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.ocl.internal.parser.AbstractOCLParser |
---|
isIdentifierOrKeyword |
Methods inherited from class org.eclipse.ocl.internal.parser.AbstractParser |
---|
computeInputString, computeInputString, dumpTokens, ERROR, 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 final 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 expression