org.eclipse.ocl.internal.parser
Class OCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>

java.lang.Object
  extended by org.eclipse.ocl.internal.parser.AbstractParser
      extended by org.eclipse.ocl.internal.parser.AbstractOCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
          extended by org.eclipse.ocl.internal.parser.OCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
All Implemented Interfaces:
LexerErrorHandler, ParserErrorHandler

public class OCLParser<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
extends 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.

Author:
Christian Vogt (cvogt)

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

OCLParser

public OCLParser(org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)

OCLParser

public OCLParser(OCLLexer lexStream,
                 org.eclipse.ocl.Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
Method Detail

parseInitOrDerValueCS

public final CT parseInitOrDerValueCS()
                               throws org.eclipse.ocl.ParserException
Parses the input as an InitOrDerValueCS.

Parameters:
property - the constrained EStructuralFeature
Returns:
the parsed OCL constraint
Throws:
org.eclipse.ocl.ParserException - if unable to parse the expression

parseInvOrDefCS

public final CT parseInvOrDefCS()
                         throws org.eclipse.ocl.ParserException
Parses the input as an InvOrDefCS.

Returns:
the parsed OCL constraint
Throws:
org.eclipse.ocl.ParserException - if unable to parse the expression

parsePackageDeclarationCS

public final java.util.List<CT> parsePackageDeclarationCS(java.util.List<CT> constraints)
                                                   throws org.eclipse.ocl.ParserException
Parses the input as a PackageDeclarationCS.

Parameters:
constraints -
Returns:
the parsed constraints
Throws:
org.eclipse.ocl.ParserException - if unable to parse the expression

parsePrePostOrBodyDeclCS

public final CT parsePrePostOrBodyDeclCS()
                                  throws org.eclipse.ocl.ParserException
Parses the input as a PrePostOrBodyDeclCS.

Parameters:
operation - the constrained EOperation
Returns:
the parsed OCL constraint
Throws:
org.eclipse.ocl.ParserException - if unable to parse the expression

parseVariableDeclarationCS

public final org.eclipse.ocl.expressions.Variable<C,PM> parseVariableDeclarationCS(boolean addToEnvironment)
                                                                            throws org.eclipse.ocl.ParserException
Parses the input as a VariableDeclarationCS.

Parameters:
addToEnvironment - boolean whether or not to add the the parsed variable to the environment
Returns:
the parsed variable declaration
Throws:
org.eclipse.ocl.ParserException - if unable to parse the expression