org.eclipse.ocl.parser
Class AbstractOCLParser

java.lang.Object
  extended by org.eclipse.ocl.lpg.AbstractParser
      extended by org.eclipse.ocl.parser.AbstractOCLParser
Direct Known Subclasses:
OCLBacktrackingParser, OCLParser

public abstract class AbstractOCLParser
extends AbstractParser


Field Summary
protected  java.util.Set<java.lang.String> iteratorNames
           
 
Constructor Summary
AbstractOCLParser(AbstractLexer lexer)
           
AbstractOCLParser(BasicEnvironment environment)
           
 
Method Summary
protected  OperationCallExpCS createArrowOperationCallExpCS(OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments)
           
protected  BooleanLiteralExpCS createBooleanLiteralExpCS(java.lang.String string)
           
protected  ClassifierContextDeclCS createClassifierContextDeclCS(SimpleNameCS simpleNameCS, PathNameCS pathNameCS, org.eclipse.emf.common.util.EList<InvOrDefCS> constraints)
          Creates a classifier context declaration.
protected  CollectionLiteralExpCS createCollectionLiteralExpCS(CollectionTypeCS typeCS, org.eclipse.emf.common.util.EList<CollectionLiteralPartCS> collectionLiteralParts)
           
protected  CollectionLiteralPartCS createCollectionLiteralPartCS(OCLExpressionCS oclExpressionCS)
           
protected  CollectionRangeCS createCollectionRangeCS(OCLExpressionCS oclExpressionCS, OCLExpressionCS lastOCLExpressionCS)
           
protected  CollectionTypeCS createCollectionTypeCS(CollectionTypeIdentifierEnum collectionType, java.lang.String value)
           
protected  SimpleNameCS createConceptualOperationNameCS(lpg.runtime.IToken token)
           
protected  DefCS createDefCS(boolean isStatic, SimpleNameCS simpleNameCS, DefExpressionCS defExpressionCS)
          Creates a definition constraint.
protected  DefExpressionCS createDefExpressionCS(VariableCS variableCS, OperationCS operationCS, OCLExpressionCS oclExpressionCS)
           
protected  DerValueCS createDerValueCS(OCLExpressionCS oclExpressionCS)
           
protected  OperationCallExpCS createDotOperationCallExpCS(OCLExpressionCS oclExpressionCS, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments)
           
protected  FeatureCallExpCS createFeatureCallExpCS(OCLExpressionCS source, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments, IsMarkedPreCS isMarkedPreCS)
           
protected  IfExpCS createIfExpCS(OCLExpressionCS condition, OCLExpressionCS thenExpression, OCLExpressionCS elseExpression)
           
protected  InitValueCS createInitValueCS(OCLExpressionCS oclExpressionCS)
           
protected  IntegerLiteralExpCS createIntegerLiteralExpCS(java.lang.String string)
           
protected  InvalidLiteralExpCS createInvalidLiteralExpCS(java.lang.String string)
           
protected  InvCS createInvCS(SimpleNameCS simpleNameCS, OCLExpressionCS oclExpressionCS)
          Creates an invariant constraint.
protected  IsMarkedPreCS createIsMarkedPreCS()
           
protected  IterateExpCS createIterateExpCS(OCLExpressionCS source, SimpleNameCS simpleNameCS, VariableCS variable1, VariableCS variable2, OCLExpressionCS oclExpressionCS)
           
protected  IteratorExpCS createIteratorExpCS(OCLExpressionCS source, SimpleNameCS simpleNameCS, VariableCS variable1, VariableCS variable2, OCLExpressionCS oclExpressionCS)
           
protected  java.util.Set<java.lang.String> createIteratorNames()
           
protected  LetExpCS createLetExpCS(org.eclipse.emf.common.util.EList<VariableCS> variables, OCLExpressionCS oclExpressionCS)
           
protected  MessageExpCS createMessageExpCS(OCLExpressionCS target, boolean hasSent, SimpleNameCS simpleNameCS, org.eclipse.emf.common.util.EList<OCLMessageArgCS> oclMessageArgs)
           
protected  NullLiteralExpCS createNullLiteralExpCS(java.lang.String string)
           
protected  OCLDocumentCS createOCLDocumentCS(PackageDeclarationCS packageDecl)
          Creates an OCL document CS from a chain of package context declarations.
protected  OCLMessageArgCS createOCLMessageArgCS(TypeCS typeCS, OCLExpressionCS oclExpressionCS)
           
protected  OperationCallExpCS createOperationCallExpCS(OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments)
           
protected  OperationContextDeclCS createOperationContextDeclCS(OperationCS operationCS, org.eclipse.emf.common.util.EList<PrePostOrBodyDeclCS> prePostOrBodyDecls)
           
protected  OperationCS createOperationCS(lpg.runtime.IToken simpleName, org.eclipse.emf.common.util.EList<VariableCS> list, TypeCS typeCS)
           
protected  OperationCS createOperationCS(PathNameCS pathNameCS, SimpleNameCS simpleNameCS, org.eclipse.emf.common.util.EList<VariableCS> list, TypeCS typeCS)
           
protected  PackageDeclarationCS createPackageDeclarationCS(PathNameCS pathNameCS, org.eclipse.emf.common.util.EList<ContextDeclCS> contextDecls)
           
protected  PathNameCS createPathNameCS()
           
protected  PathNameCS createPathNameCS(SimpleNameCS name)
           
protected  PathNameCS createPathNamePrefixCS(PathNameCS pathNameCS)
           
protected  PrePostOrBodyDeclCS createPrePostOrBodyDeclCS(PrePostOrBodyEnum kind, SimpleNameCS simpleNameCS, OCLExpressionCS oclExpressionCS)
           
protected  PrimitiveTypeCS createPrimitiveTypeCS(SimpleTypeEnum type, java.lang.String value)
           
protected  PropertyContextCS createPropertyContextCS(PathNameCS pathNameCS, SimpleNameCS simpleNameCS, TypeCS typeCS, org.eclipse.emf.common.util.EList<InitOrDerValueCS> constraints)
           
protected  SimpleNameCS createQuotedSimpleNameCS(SimpleTypeEnum type, lpg.runtime.IToken token)
           
protected  RealLiteralExpCS createRealLiteralExpCS(java.lang.String string)
           
protected  SimpleNameCS createSimpleNameCS(SimpleTypeEnum type, lpg.runtime.IToken token)
           
protected  StringLiteralExpCS createStringLiteralExpCS(lpg.runtime.IToken token)
           
protected  TupleLiteralExpCS createTupleLiteralExpCS(org.eclipse.emf.common.util.EList<VariableCS> variables)
           
protected  TupleTypeCS createTupleTypeCS(org.eclipse.emf.common.util.EList<VariableCS> variables)
           
protected  UnlimitedNaturalLiteralExpCS createUnlimitedNaturalLiteralExpCS(java.lang.String string)
           
protected  VariableCS createVariableCS(SimpleNameCS varName, TypeCS typeCS, OCLExpressionCS oclExpressionCS)
           
protected  VariableExpCS createVariableExpCS(SimpleNameCS simpleNameCS, org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments, IsMarkedPreCS isMarkedPreCS)
           
protected  PathNameCS extendPathNameCS(PathNameCS path, SimpleNameCS name)
           
protected  SimpleNameCS extendQuotedSimpleNameCS(SimpleNameCS simpleName, lpg.runtime.IToken token)
           
protected  StringLiteralExpCS extendStringLiteralExpCS(StringLiteralExpCS string, lpg.runtime.IToken token)
           
protected  SimpleNameCS getPathNameSuffixCS(PathNameCS pathNameCS)
           
protected  boolean isAtPre(IsMarkedPreCS atPreCS)
          Queries whether the specified @pre construct was actually present in the text.
protected  boolean isIterator(java.lang.String name)
           
protected  boolean isNonStdSQSupported()
          To be overridden in parsers which prohibit non-std SQL-like single quote escaping (" '' ").
protected  java.lang.String unescape(lpg.runtime.IToken stringLiteral)
          Deprecated. Use decodeString.
 
Methods inherited from class org.eclipse.ocl.lpg.AbstractParser
computeInputString, decodeEscapeSequence, decodeHexCharacter, decodeOctalCharacter, decodeString, getDefaultRepairCount, getEnvironment, getIPrsStream, getLeftIToken, getLeftSpan, getLexer, getParseTable, getRhsErrorIToken, getRhsErrorTokenIndex, getRhsFirstIToken, getRhsFirstTokenIndex, getRhsIToken, getRhsLastIToken, getRhsLastTokenIndex, getRhsSym, getRhsTokenIndex, getRightIToken, getRightSpan, numTokenKinds, orderedTerminalSymbols, parser, parser, parser, parser, parseTokensToCST, reset, resetLexStream, setDefaultRepairCount, setLexStream, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setResult, unDoubleQuote, unquote, unSingleQuote, unSingleQuote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iteratorNames

protected java.util.Set<java.lang.String> iteratorNames
Since:
3.0
Constructor Detail

AbstractOCLParser

public AbstractOCLParser(BasicEnvironment environment)

AbstractOCLParser

public AbstractOCLParser(AbstractLexer lexer)
Method Detail

createPackageDeclarationCS

protected PackageDeclarationCS createPackageDeclarationCS(PathNameCS pathNameCS,
                                                          org.eclipse.emf.common.util.EList<ContextDeclCS> contextDecls)

createPropertyContextCS

protected PropertyContextCS createPropertyContextCS(PathNameCS pathNameCS,
                                                    SimpleNameCS simpleNameCS,
                                                    TypeCS typeCS,
                                                    org.eclipse.emf.common.util.EList<InitOrDerValueCS> constraints)
Since:
3.0

createDerValueCS

protected DerValueCS createDerValueCS(OCLExpressionCS oclExpressionCS)
Since:
3.0

createInitValueCS

protected InitValueCS createInitValueCS(OCLExpressionCS oclExpressionCS)
Since:
3.0

createClassifierContextDeclCS

protected ClassifierContextDeclCS createClassifierContextDeclCS(SimpleNameCS simpleNameCS,
                                                                PathNameCS pathNameCS,
                                                                org.eclipse.emf.common.util.EList<InvOrDefCS> constraints)
Creates a classifier context declaration.

Parameters:
pathNameCS - the concrete syntax of the classifier's qualified name
constraints - the concrete syntax of the invariant and/or definition constraints in the classifier context
Returns:
the classifier context declaration
Since:
3.0

createInvCS

protected InvCS createInvCS(SimpleNameCS simpleNameCS,
                            OCLExpressionCS oclExpressionCS)
Creates an invariant constraint.

Parameters:
simpleNameCS - the concrete syntax of the constraint name, or null if none
oclExpressionCS - the concrete syntax of the constraint expression
Returns:
the concrete syntax of the invariant constraint
Since:
1.3

createDefCS

protected DefCS createDefCS(boolean isStatic,
                            SimpleNameCS simpleNameCS,
                            DefExpressionCS defExpressionCS)
Creates a definition constraint.

Parameters:
isStatic - true for a static constraint
simpleNameCS - the concrete syntax of the constraint name
defExpressionCS - the concrete syntax of the constraint expression
Returns:
the concrete syntax of the definition constraint
Since:
3.0

createDefExpressionCS

protected DefExpressionCS createDefExpressionCS(VariableCS variableCS,
                                                OperationCS operationCS,
                                                OCLExpressionCS oclExpressionCS)

createOperationContextDeclCS

protected OperationContextDeclCS createOperationContextDeclCS(OperationCS operationCS,
                                                              org.eclipse.emf.common.util.EList<PrePostOrBodyDeclCS> prePostOrBodyDecls)

createPrePostOrBodyDeclCS

protected PrePostOrBodyDeclCS createPrePostOrBodyDeclCS(PrePostOrBodyEnum kind,
                                                        SimpleNameCS simpleNameCS,
                                                        OCLExpressionCS oclExpressionCS)

createOperationCS

protected OperationCS createOperationCS(PathNameCS pathNameCS,
                                        SimpleNameCS simpleNameCS,
                                        org.eclipse.emf.common.util.EList<VariableCS> list,
                                        TypeCS typeCS)

createOperationCS

protected OperationCS createOperationCS(lpg.runtime.IToken simpleName,
                                        org.eclipse.emf.common.util.EList<VariableCS> list,
                                        TypeCS typeCS)
Since:
3.0

isAtPre

protected boolean isAtPre(IsMarkedPreCS atPreCS)
Queries whether the specified @pre construct was actually present in the text. This method is safe with null inputs.

Parameters:
atPreCS - an "at pre" construct or null
Returns:
true if the atPreCS is present; false, otherwise
Since:
1.3

createOperationCallExpCS

protected OperationCallExpCS createOperationCallExpCS(OCLExpressionCS oclExpressionCS,
                                                      SimpleNameCS simpleNameCS,
                                                      org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments)
Since:
3.0

createArrowOperationCallExpCS

protected OperationCallExpCS createArrowOperationCallExpCS(OCLExpressionCS oclExpressionCS,
                                                           SimpleNameCS simpleNameCS,
                                                           IsMarkedPreCS isMarkedPreCS,
                                                           org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments)
Since:
3.0

createDotOperationCallExpCS

protected OperationCallExpCS createDotOperationCallExpCS(OCLExpressionCS oclExpressionCS,
                                                         PathNameCS pathNameCS,
                                                         SimpleNameCS simpleNameCS,
                                                         IsMarkedPreCS isMarkedPreCS,
                                                         org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments)
Since:
3.0

createVariableExpCS

protected VariableExpCS createVariableExpCS(SimpleNameCS simpleNameCS,
                                            org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments,
                                            IsMarkedPreCS isMarkedPreCS)

createConceptualOperationNameCS

protected SimpleNameCS createConceptualOperationNameCS(lpg.runtime.IToken token)
Since:
3.0

createSimpleNameCS

protected SimpleNameCS createSimpleNameCS(SimpleTypeEnum type,
                                          lpg.runtime.IToken token)
Since:
3.0

createQuotedSimpleNameCS

protected SimpleNameCS createQuotedSimpleNameCS(SimpleTypeEnum type,
                                                lpg.runtime.IToken token)
Since:
3.0

createPrimitiveTypeCS

protected PrimitiveTypeCS createPrimitiveTypeCS(SimpleTypeEnum type,
                                                java.lang.String value)

createPathNameCS

protected PathNameCS createPathNameCS(SimpleNameCS name)
Since:
3.0

extendPathNameCS

protected PathNameCS extendPathNameCS(PathNameCS path,
                                      SimpleNameCS name)
Since:
3.0

createPathNameCS

protected PathNameCS createPathNameCS()

createPathNamePrefixCS

protected PathNameCS createPathNamePrefixCS(PathNameCS pathNameCS)
Since:
3.0

getPathNameSuffixCS

protected SimpleNameCS getPathNameSuffixCS(PathNameCS pathNameCS)
Since:
3.0

createCollectionLiteralExpCS

protected CollectionLiteralExpCS createCollectionLiteralExpCS(CollectionTypeCS typeCS,
                                                              org.eclipse.emf.common.util.EList<CollectionLiteralPartCS> collectionLiteralParts)
Since:
3.0

createCollectionLiteralPartCS

protected CollectionLiteralPartCS createCollectionLiteralPartCS(OCLExpressionCS oclExpressionCS)

createCollectionRangeCS

protected CollectionRangeCS createCollectionRangeCS(OCLExpressionCS oclExpressionCS,
                                                    OCLExpressionCS lastOCLExpressionCS)

createTupleLiteralExpCS

protected TupleLiteralExpCS createTupleLiteralExpCS(org.eclipse.emf.common.util.EList<VariableCS> variables)

createIntegerLiteralExpCS

protected IntegerLiteralExpCS createIntegerLiteralExpCS(java.lang.String string)

createUnlimitedNaturalLiteralExpCS

protected UnlimitedNaturalLiteralExpCS createUnlimitedNaturalLiteralExpCS(java.lang.String string)

createRealLiteralExpCS

protected RealLiteralExpCS createRealLiteralExpCS(java.lang.String string)

createStringLiteralExpCS

protected StringLiteralExpCS createStringLiteralExpCS(lpg.runtime.IToken token)
Since:
3.0

extendQuotedSimpleNameCS

protected SimpleNameCS extendQuotedSimpleNameCS(SimpleNameCS simpleName,
                                                lpg.runtime.IToken token)
Since:
3.0

extendStringLiteralExpCS

protected StringLiteralExpCS extendStringLiteralExpCS(StringLiteralExpCS string,
                                                      lpg.runtime.IToken token)
Since:
3.0

createBooleanLiteralExpCS

protected BooleanLiteralExpCS createBooleanLiteralExpCS(java.lang.String string)

createNullLiteralExpCS

protected NullLiteralExpCS createNullLiteralExpCS(java.lang.String string)

createInvalidLiteralExpCS

protected InvalidLiteralExpCS createInvalidLiteralExpCS(java.lang.String string)

createIteratorExpCS

protected IteratorExpCS createIteratorExpCS(OCLExpressionCS source,
                                            SimpleNameCS simpleNameCS,
                                            VariableCS variable1,
                                            VariableCS variable2,
                                            OCLExpressionCS oclExpressionCS)
Since:
3.0

createIterateExpCS

protected IterateExpCS createIterateExpCS(OCLExpressionCS source,
                                          SimpleNameCS simpleNameCS,
                                          VariableCS variable1,
                                          VariableCS variable2,
                                          OCLExpressionCS oclExpressionCS)
Since:
3.0

createVariableCS

protected VariableCS createVariableCS(SimpleNameCS varName,
                                      TypeCS typeCS,
                                      OCLExpressionCS oclExpressionCS)
Since:
3.0

createCollectionTypeCS

protected CollectionTypeCS createCollectionTypeCS(CollectionTypeIdentifierEnum collectionType,
                                                  java.lang.String value)
Since:
3.0

createTupleTypeCS

protected TupleTypeCS createTupleTypeCS(org.eclipse.emf.common.util.EList<VariableCS> variables)

createFeatureCallExpCS

protected FeatureCallExpCS createFeatureCallExpCS(OCLExpressionCS source,
                                                  PathNameCS pathNameCS,
                                                  SimpleNameCS simpleNameCS,
                                                  org.eclipse.emf.common.util.EList<OCLExpressionCS> arguments,
                                                  IsMarkedPreCS isMarkedPreCS)
Since:
3.0

createIsMarkedPreCS

protected IsMarkedPreCS createIsMarkedPreCS()
Since:
3.0

createLetExpCS

protected LetExpCS createLetExpCS(org.eclipse.emf.common.util.EList<VariableCS> variables,
                                  OCLExpressionCS oclExpressionCS)

createIfExpCS

protected IfExpCS createIfExpCS(OCLExpressionCS condition,
                                OCLExpressionCS thenExpression,
                                OCLExpressionCS elseExpression)

createMessageExpCS

protected MessageExpCS createMessageExpCS(OCLExpressionCS target,
                                          boolean hasSent,
                                          SimpleNameCS simpleNameCS,
                                          org.eclipse.emf.common.util.EList<OCLMessageArgCS> oclMessageArgs)
Since:
3.0

createOCLMessageArgCS

protected OCLMessageArgCS createOCLMessageArgCS(TypeCS typeCS,
                                                OCLExpressionCS oclExpressionCS)

createOCLDocumentCS

protected OCLDocumentCS createOCLDocumentCS(PackageDeclarationCS packageDecl)
Creates an OCL document CS from a chain of package context declarations.

Parameters:
packageDecl - a chain of package context declarations
Returns:
the document CS
Since:
1.3

createIteratorNames

protected java.util.Set<java.lang.String> createIteratorNames()
Since:
3.0

isIterator

protected boolean isIterator(java.lang.String name)
Since:
3.0

unescape

@Deprecated
protected java.lang.String unescape(lpg.runtime.IToken stringLiteral)
Deprecated. Use decodeString.

Escaping support based on the QVT specification (8.4.3).

Parameters:
stringLiteral - a string literal token with escape notation
Returns:
the unescaped string
Since:
1.3

isNonStdSQSupported

protected boolean isNonStdSQSupported()
To be overridden in parsers which prohibit non-std SQL-like single quote escaping (" '' ").

Returns:
true if such escaping is supported, false otherwise
Since:
1.3