org.eclipse.ocl.parser.backtracking
Class OCLBacktrackingParser

java.lang.Object
  extended by org.eclipse.ocl.lpg.AbstractParser
      extended by org.eclipse.ocl.parser.AbstractOCLParser
          extended by org.eclipse.ocl.parser.backtracking.OCLBacktrackingParser
All Implemented Interfaces:
lpg.runtime.RuleAction

public class OCLBacktrackingParser
extends AbstractOCLParser
implements lpg.runtime.RuleAction


Field Summary
 
Fields inherited from class org.eclipse.ocl.parser.AbstractOCLParser
iteratorNames
 
Constructor Summary
OCLBacktrackingParser(OCLBacktrackingLexer lexer)
           
 
Method Summary
 int getEOFTokenKind()
           
 DerivedPrsStream getIPrsStream()
           
protected  lpg.runtime.IToken getIToken(int i)
          Deprecated. 
protected  lpg.runtime.IToken getLeftIToken()
           
protected  int getLeftSpan()
           
 OCLBacktrackingLexer getLexer()
           
 Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment()
           
 lpg.runtime.BacktrackingParser getParser()
           
 lpg.runtime.ParseTable getParseTable()
           
protected  lpg.runtime.ErrorToken getRhsErrorIToken(int i)
           
protected  int getRhsErrorTokenIndex(int i)
           
protected  lpg.runtime.IToken getRhsFirstIToken(int i)
           
protected  int getRhsFirstTokenIndex(int i)
           
protected  lpg.runtime.IToken getRhsIToken(int i)
           
protected  lpg.runtime.IToken getRhsLastIToken(int i)
           
protected  int getRhsLastTokenIndex(int i)
           
protected  java.lang.Object getRhsSym(int i)
           
protected  int getRhsTokenIndex(int i)
           
protected  java.lang.String getRhsTokenText(int i)
          A convenience method to obtain the text of a right hand side IToken.
protected  lpg.runtime.IToken getRightIToken()
           
protected  int getRightSpan()
           
 java.lang.String getTokenKindName(int kind)
           
protected  java.lang.String getTokenText(int i)
          Deprecated. 
 int numTokenKinds()
           
 java.lang.String[] orderedTerminalSymbols()
           
 CSTNode parser()
          Runs the parser with the current lex and parse streams
 CSTNode parser(int error_repair_count)
          Runs the parser with the current lex and parse streams using a given error_repair_count (useful for a backtracking parser)
 CSTNode parser(lpg.runtime.Monitor monitor)
          Runs the parser with the current lex and parse streams using the given Monitor
 CSTNode parser(lpg.runtime.Monitor monitor, int error_repair_count)
          Runs the parser with the current lex and parse streams using the given Monitor and error_repair_count (useful for a backtracking parser)
protected  void reportErrorTokenMessage(int error_token, java.lang.String msg)
          Report error message for given error_token.
 void reset(lpg.runtime.ILexStream lexStream)
          Resets the parser's lexStream
 void ruleAction(int ruleNumber)
           
protected  void setResult(java.lang.Object object)
           
 
Methods inherited from class org.eclipse.ocl.parser.AbstractOCLParser
createArrowOperationCallExpCS, createBooleanLiteralExpCS, createClassifierContextDeclCS, createCollectionLiteralExpCS, createCollectionLiteralPartCS, createCollectionRangeCS, createCollectionTypeCS, createConceptualOperationNameCS, createDefCS, createDefExpressionCS, createDerValueCS, createDotOperationCallExpCS, createFeatureCallExpCS, createIfExpCS, createInitValueCS, createIntegerLiteralExpCS, createInvalidLiteralExpCS, createInvCS, createIsMarkedPreCS, createIterateExpCS, createIteratorExpCS, createIteratorNames, createLetExpCS, createMessageExpCS, createNullLiteralExpCS, createOCLDocumentCS, createOCLMessageArgCS, createOperationCallExpCS, createOperationContextDeclCS, createOperationCS, createOperationCS, createPackageDeclarationCS, createPathNameCS, createPathNameCS, createPathNamePrefixCS, createPrePostOrBodyDeclCS, createPrimitiveTypeCS, createPropertyContextCS, createQuotedSimpleNameCS, createRealLiteralExpCS, createSimpleNameCS, createStringLiteralExpCS, createTupleLiteralExpCS, createTupleTypeCS, createUnlimitedNaturalLiteralExpCS, createVariableCS, createVariableExpCS, extendPathNameCS, extendQuotedSimpleNameCS, extendStringLiteralExpCS, getPathNameSuffixCS, isAtPre, isIterator, isNonStdSQSupported, unescape
 
Methods inherited from class org.eclipse.ocl.lpg.AbstractParser
computeInputString, decodeEscapeSequence, decodeHexCharacter, decodeOctalCharacter, decodeString, getDefaultRepairCount, getEnvironment, parseTokensToCST, resetLexStream, setDefaultRepairCount, setLexStream, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, unDoubleQuote, unquote, unSingleQuote, unSingleQuote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OCLBacktrackingParser

public OCLBacktrackingParser(OCLBacktrackingLexer lexer)
Method Detail

getParseTable

public lpg.runtime.ParseTable getParseTable()
Specified by:
getParseTable in class AbstractParser
Returns:
the ParseTable used by the parser

getParser

public lpg.runtime.BacktrackingParser getParser()

setResult

protected void setResult(java.lang.Object object)
Specified by:
setResult in class AbstractParser

getRhsSym

protected java.lang.Object getRhsSym(int i)
Specified by:
getRhsSym in class AbstractParser

getRhsTokenIndex

protected int getRhsTokenIndex(int i)
Specified by:
getRhsTokenIndex in class AbstractParser

getRhsIToken

protected lpg.runtime.IToken getRhsIToken(int i)
Specified by:
getRhsIToken in class AbstractParser

getRhsFirstTokenIndex

protected int getRhsFirstTokenIndex(int i)
Specified by:
getRhsFirstTokenIndex in class AbstractParser

getRhsFirstIToken

protected lpg.runtime.IToken getRhsFirstIToken(int i)
Specified by:
getRhsFirstIToken in class AbstractParser

getRhsLastTokenIndex

protected int getRhsLastTokenIndex(int i)
Specified by:
getRhsLastTokenIndex in class AbstractParser

getRhsLastIToken

protected lpg.runtime.IToken getRhsLastIToken(int i)
Specified by:
getRhsLastIToken in class AbstractParser

getLeftSpan

protected int getLeftSpan()
Specified by:
getLeftSpan in class AbstractParser

getLeftIToken

protected lpg.runtime.IToken getLeftIToken()
Specified by:
getLeftIToken in class AbstractParser

getRightSpan

protected int getRightSpan()
Specified by:
getRightSpan in class AbstractParser

getRightIToken

protected lpg.runtime.IToken getRightIToken()
Specified by:
getRightIToken in class AbstractParser

getRhsErrorTokenIndex

protected int getRhsErrorTokenIndex(int i)
Specified by:
getRhsErrorTokenIndex in class AbstractParser

getRhsErrorIToken

protected lpg.runtime.ErrorToken getRhsErrorIToken(int i)
Specified by:
getRhsErrorIToken in class AbstractParser

reset

public void reset(lpg.runtime.ILexStream lexStream)
Description copied from class: AbstractParser
Resets the parser's lexStream

Specified by:
reset in class AbstractParser

numTokenKinds

public int numTokenKinds()
Specified by:
numTokenKinds in class AbstractParser
Returns:
the number of different parser tokens

orderedTerminalSymbols

public java.lang.String[] orderedTerminalSymbols()
Specified by:
orderedTerminalSymbols in class AbstractParser

getTokenKindName

public java.lang.String getTokenKindName(int kind)

getEOFTokenKind

public int getEOFTokenKind()

getIPrsStream

public DerivedPrsStream getIPrsStream()
Specified by:
getIPrsStream in class AbstractParser
Returns:
the parser's parseStream

parser

public CSTNode parser()
Description copied from class: AbstractParser
Runs the parser with the current lex and parse streams

Specified by:
parser in class AbstractParser
Returns:
the root CSTNode which results from the parsing process

parser

public CSTNode parser(lpg.runtime.Monitor monitor)
Description copied from class: AbstractParser
Runs the parser with the current lex and parse streams using the given Monitor

Specified by:
parser in class AbstractParser
Returns:
the root CSTNode which results from the parsing process

parser

public CSTNode parser(int error_repair_count)
Description copied from class: AbstractParser
Runs the parser with the current lex and parse streams using a given error_repair_count (useful for a backtracking parser)

Specified by:
parser in class AbstractParser
Returns:
the root CSTNode which results from the parsing process

parser

public CSTNode parser(lpg.runtime.Monitor monitor,
                      int error_repair_count)
Description copied from class: AbstractParser
Runs the parser with the current lex and parse streams using the given Monitor and error_repair_count (useful for a backtracking parser)

Specified by:
parser in class AbstractParser
Returns:
the root CSTNode which results from the parsing process

getOCLEnvironment

public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment()

getLexer

public OCLBacktrackingLexer getLexer()
Overrides:
getLexer in class AbstractParser

getIToken

@Deprecated
protected lpg.runtime.IToken getIToken(int i)
Deprecated. 

Before 3.0, this method was used with the now-deprecated "dollar"getToken macro (which provided token index in the prsStream) to obtain an IToken f a rule given the index of the right hand side token in the said rule. In 3.0 a convenience method has been introduced in order to directly return the IToken, given the index of the right hand side token in the rule.

In an action-block of a rule, instead of doing getIToken("dollar"getToken(i)) you should do getRhsTokenText(i)

Parameters:
i - the right hand side token index
Returns:
the correspondent IToken.
Since:
3.0

getTokenText

@Deprecated
protected java.lang.String getTokenText(int i)
Deprecated. 

Before 3.0, this method was used with the now-deprecated "dollar"getToken macro (which provided token index in the prsStream) to obtain an IToken f a rule given the index of the right hand side token in the said rule. In 3.0 a convenience method has been introduced in order to directly return the IToken, given the index of the right hand side token in the rule.

In an action-block of a rule, instead of doing getTokenText("dollar"getToken(i)) you should do getRhsTokenText(i)

Parameters:
i - the right hand side token index
Returns:
the text of the correspondent right hand side IToken.

getRhsTokenText

protected java.lang.String getRhsTokenText(int i)
A convenience method to obtain the text of a right hand side IToken.

Parameters:
i - the right hand side token index
Returns:
the text of the correspondent right hand side IToken.
Since:
3.0

reportErrorTokenMessage

protected final void reportErrorTokenMessage(int error_token,
                                             java.lang.String msg)
Report error message for given error_token.

Parameters:
error_token - the error taken index
msg - the message to report
Since:
1.3

ruleAction

public void ruleAction(int ruleNumber)
Specified by:
ruleAction in interface lpg.runtime.RuleAction