uk.ac.ucl.cs.emofocl.ocl.parser
Class OCL2Parser

java.lang.Object
  extended by uk.ac.ucl.cs.emofocl.ocl.parser.OCL2Parser
All Implemented Interfaces:
OCL2ParserConstants

public class OCL2Parser
extends Object
implements OCL2ParserConstants


Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 OCL2ParserTokenManager token_source
           
 
Fields inherited from interface uk.ac.ucl.cs.emofocl.ocl.parser.OCL2ParserConstants
AND, ANY, ARROW, AT_PRE, BAG, BOOLEAN, COLLECT, COLLECT_NESTED, COLLECTION, COLON, COLON_COLON, COMMA, DEFAULT, DIVIDE, DOT, DOT_DOT, DOUBLE_QUOTE, DREAL, ELSE, ENDIF, EOF, EQUALS, EXISTS, FOR_ALL, FPREAL, GREATER_THAN, GREATER_THAN_EQUALS, IF, IMPLIES, IN, INT, INTEGER, INVALID, IS_UNIQUE, ITERATE, LB, LESS_THAN, LESS_THAN_EQUALS, LET, LINE_COMMENT, LP, MINUS, NAME, NOT, NULL, OCL_ANY, OCL_AS_TYPE, OCL_INVALID, OCL_IS_KIND_OF, OCL_IS_TYPE_OF, OCL_MESSAGE, OCL_VOID, ONE, OR, ORDERED_SET, PARA_COMMENT, PLUS, RB, REAL, REJECT, RP, SELECT, SEMI_COLON, SEQUENCE, SET, SORTED_BY, STRIKE, STRING, THEN, TIMES, tokenImage, TUPLE, UNEQUALS, WS, XOR
 
Constructor Summary
OCL2Parser()
           
OCL2Parser(InputStream stream)
           
OCL2Parser(OCL2ParserTokenManager tm)
           
OCL2Parser(Reader stream)
           
 
Method Summary
 List argumentsCS(Environment env)
           
 OclExpression clause(Environment env)
           
 CollectionLiteralExp collectionLiteralCS(Environment env)
           
 CollectionLiteralPart collectionLiteralPartCS(Environment env)
           
 CollectionType collectionTypeCS(Environment env)
           
 CollectionKind collectionTypeIdentifierCS()
           
 OclExpression completeExpression(Environment env)
           
 OclExpression conditionalExpression(Environment env)
           
 void disable_tracing()
           
 void enable_tracing()
           
 OclExpression expression(Environment env)
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
 IfExp ifExpCS(Environment env)
           
 VariableDeclaration initialisedVariableDeclaration(Environment env)
           
 LetExp letExpression(Environment env)
           
 LiteralExp literalExpCS(Environment env)
           
 Type modelTypeCS(Environment env)
           
 OclExpression navigation(Environment env)
           
 OclExpression negation(Environment env)
           
 OclExpression parseCompleteExpression(MOFClass context, String expression)
          Parses an expression in the context of a class, ensuring that there is no invalid suffix to the expression.
 OclExpression parseExpression(MOFClass context, String expression)
          Parses a valid prefix of the expression in the context of a class.
 PrimitiveLiteralExp primitiveLiteralCS(Environment env)
           
 OclExpression productOrDividend(Environment env)
           
 void ReInit(InputStream stream)
           
 void ReInit(OCL2ParserTokenManager tm)
           
 void ReInit(Reader stream)
           
 OclExpression strongerRelation(Environment env)
           
 OclExpression sumOrDifference(Environment env)
           
 TupleLiteralExp tupleLiteralCS(Environment env)
           
 TupleType tupleTypeCS(Environment env)
           
 Type typeCS(Environment env)
           
 VariableDeclaration variableDeclaration(Environment env)
           
 LiteralExp voidLiteralCS(Environment env)
           
 OclExpression weakerRelation(Environment env)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public OCL2ParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

OCL2Parser

public OCL2Parser()

OCL2Parser

public OCL2Parser(InputStream stream)

OCL2Parser

public OCL2Parser(Reader stream)

OCL2Parser

public OCL2Parser(OCL2ParserTokenManager tm)
Method Detail

parseExpression

public OclExpression parseExpression(MOFClass context,
                                     String expression)
                              throws ParseException
Parses a valid prefix of the expression in the context of a class.

Throws:
ParseException

parseCompleteExpression

public OclExpression parseCompleteExpression(MOFClass context,
                                             String expression)
                                      throws ParseException
Parses an expression in the context of a class, ensuring that there is no invalid suffix to the expression.

Throws:
ParseException

completeExpression

public final OclExpression completeExpression(Environment env)
                                       throws ParseException
Throws:
ParseException

expression

public final OclExpression expression(Environment env)
                               throws ParseException
Throws:
ParseException

clause

public final OclExpression clause(Environment env)
                           throws ParseException
Throws:
ParseException

strongerRelation

public final OclExpression strongerRelation(Environment env)
                                     throws ParseException
Throws:
ParseException

weakerRelation

public final OclExpression weakerRelation(Environment env)
                                   throws ParseException
Throws:
ParseException

conditionalExpression

public final OclExpression conditionalExpression(Environment env)
                                          throws ParseException
Throws:
ParseException

sumOrDifference

public final OclExpression sumOrDifference(Environment env)
                                    throws ParseException
Throws:
ParseException

productOrDividend

public final OclExpression productOrDividend(Environment env)
                                      throws ParseException
Throws:
ParseException

negation

public final OclExpression negation(Environment env)
                             throws ParseException
Throws:
ParseException

navigation

public final OclExpression navigation(Environment env)
                               throws ParseException
Throws:
ParseException

argumentsCS

public final List argumentsCS(Environment env)
                       throws ParseException
Throws:
ParseException

variableDeclaration

public final VariableDeclaration variableDeclaration(Environment env)
                                              throws ParseException
Throws:
ParseException

initialisedVariableDeclaration

public final VariableDeclaration initialisedVariableDeclaration(Environment env)
                                                         throws ParseException
Throws:
ParseException

letExpression

public final LetExp letExpression(Environment env)
                           throws ParseException
Throws:
ParseException

ifExpCS

public final IfExp ifExpCS(Environment env)
                    throws ParseException
Throws:
ParseException

literalExpCS

public final LiteralExp literalExpCS(Environment env)
                              throws ParseException
Throws:
ParseException

collectionLiteralCS

public final CollectionLiteralExp collectionLiteralCS(Environment env)
                                               throws ParseException
Throws:
ParseException

collectionTypeIdentifierCS

public final CollectionKind collectionTypeIdentifierCS()
                                                throws ParseException
Throws:
ParseException

collectionLiteralPartCS

public final CollectionLiteralPart collectionLiteralPartCS(Environment env)
                                                    throws ParseException
Throws:
ParseException

tupleLiteralCS

public final TupleLiteralExp tupleLiteralCS(Environment env)
                                     throws ParseException
Throws:
ParseException

primitiveLiteralCS

public final PrimitiveLiteralExp primitiveLiteralCS(Environment env)
                                             throws ParseException
Throws:
ParseException

voidLiteralCS

public final LiteralExp voidLiteralCS(Environment env)
                               throws ParseException
Throws:
ParseException

typeCS

public final Type typeCS(Environment env)
                  throws ParseException
Throws:
ParseException

modelTypeCS

public final Type modelTypeCS(Environment env)
                       throws ParseException
Throws:
ParseException

collectionTypeCS

public final CollectionType collectionTypeCS(Environment env)
                                      throws ParseException
Throws:
ParseException

tupleTypeCS

public final TupleType tupleTypeCS(Environment env)
                            throws ParseException
Throws:
ParseException

ReInit

public void ReInit(InputStream stream)

ReInit

public void ReInit(Reader stream)

ReInit

public void ReInit(OCL2ParserTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public final ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()