| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.lpg.AbstractAnalyzer
org.eclipse.ocl.parser.AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
org.eclipse.ocl.parser.OCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
public class OCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
The 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.
| Field Summary | 
|---|
| Fields inherited from class org.eclipse.ocl.parser.AbstractOCLAnalyzer | 
|---|
| environmentFactory, oclFactory, uml | 
| Constructor Summary | |
|---|---|
| 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. | |
| Method Summary | |
|---|---|
| protected  CT | createConstraint()Creates an Constraint instance. | 
| protected  ExpressionInOCL<C,PM> | createExpressionInOCL()Creates an ExpressionInOcl instance. | 
| protected  OCLFactory | createOCLFactory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)Creates/obtains the OCLFactorythat I use to create OCL AST
 elements. | 
|  void | ERROR(List<?> problemObjects,
      String rule,
      String problemMessage) | 
|  void | ERROR(Object problemObject,
      String rule,
      String problemMessage) | 
|  void | ERROR(String problemMessage) | 
|  OCLParser | getParser() | 
| protected  boolean | isErrorNode(TypedElement<C> expr)Queries whether the specified expression is a placeholder that was created for an expression that failed to parse. | 
| protected  void | markAsErrorNode(TypedElement<C> expr)Marks the specified (sub)expression as a placeholder for an expression that could not be parsed. | 
|  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 ParserExceptionif any parse errors are encountered. | 
|  CT | parseInitOrDerValueCS()Parses the input as an InitOrDerValueCS. | 
|  CT | parseInvOrDefCS()Parses the input as an InvOrDefCS. | 
|  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. | 
| Methods inherited from class org.eclipse.ocl.lpg.AbstractAnalyzer | 
|---|
| computeInputString, dumpTokens, formatClass, formatEClassName, formatName, formatPath, formatPath, formatQualifiedName, formatString, formatType, getCharOffset, getEnvironment, getFormatter, getLexer, getTraceFlag, initialize, initialize, initPropertyPositions, initStartEndPositions, initTypePositions, makeName, makeString, setCharacterOffset, setFileName, setTab, setTraceFlag, TRACE, TRACE | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public 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 environment
public 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| Method Detail | 
|---|
public OCLParser getParser()
getParser in class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>protected OCLFactory createOCLFactory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
AbstractOCLAnalyzerOCLFactory that I use to create OCL AST
 elements.
createOCLFactory in class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>env - my OCL environment
public CSTNode parseConcreteSyntax()
ParserException
 if any parse errors are encountered.
null if it could not be parsed
public OCLExpression<C> parseAST(OCLExpressionCS cst,
                                 ConstraintKind constraintType)
cst - the OCL concrete syntax modelconstraintType - the kind of constraint to parse
public 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 environment
null if it
    could not be parsed
public void ERROR(List<?> problemObjects,
                  String rule,
                  String problemMessage)
ERROR in class AbstractAnalyzer
public void ERROR(Object problemObject,
                  String rule,
                  String problemMessage)
ERROR in class AbstractAnalyzerpublic void ERROR(String problemMessage)
ERROR in class AbstractAnalyzerprotected CT createConstraint()
AbstractOCLAnalyzer
createConstraint in class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>protected ExpressionInOCL<C,PM> createExpressionInOCL()
AbstractOCLAnalyzer
createExpressionInOCL in class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>protected boolean isErrorNode(TypedElement<C> expr)
AbstractOCLAnalyzer
 Queries whether the specified expression is a placeholder that was
 created for an expression that failed to parse. An example is the
 expression returned by AbstractOCLAnalyzer.createDummyInvalidLiteralExp().
 
 The default implementation simply returns false;
 subclasses should override if necessary, in conjunction with the
 AbstractOCLAnalyzer.markAsErrorNode(TypedElement) method.
 
isErrorNode in class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>expr - a (sub)expression
AbstractOCLAnalyzer.markAsErrorNode(TypedElement)protected void markAsErrorNode(TypedElement<C> expr)
AbstractOCLAnalyzer
 Marks the specified (sub)expression as a placeholder for an expression
 that could not be parsed. A subsequent invocation of the
 AbstractOCLAnalyzer.isErrorNode(TypedElement) method should recognize an
 expression thus marked.  Subsequent attempts to mark an expression
 that is already marked have no effect.
 
The default implementation does nothing; subclasses should override if necessary, in conjunction with the isErrorPlaceholder method.
markAsErrorNode in class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>expr - an expression that takes the place of a (sub)expression that
            could not be parsedAbstractOCLAnalyzer.isErrorNode(TypedElement)| 
 | Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||