Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Member Functions
rve_interface_gen.antlr3.tree.TreeParser Class Reference
Inheritance diagram for rve_interface_gen.antlr3.tree.TreeParser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def getCurrentInputSymbol
def getErrorHeader
def getErrorMessage
def getMissingSymbol
def getSourceName
def getTreeNodeStream
def inContext
def matchAny
def mismatch
def reset
def setTreeNodeStream
def traceIn
def traceOut

Public Attributes

 input

Static Public Attributes

string dotdot = ".*[^.]\\.\\.[^.].*"
tuple dotdotPattern = re.compile(dotdot)
string doubleEtc = ".*\\.\\.\\.\\s+\\.\\.\\..*"
tuple doubleEtcPattern = re.compile(doubleEtc)

Private Member Functions

def _inContext

Static Private Member Functions

def _getAncestor

Detailed Description

@brief Baseclass for generated tree parsers.

A parser for a stream of tree nodes.  "tree grammars" result in a subclass
of this.  All the error reporting and recovery is shared with Parser via
the BaseRecognizer superclass.

Definition at line 2160 of file tree.py.


Constructor & Destructor Documentation

def rve_interface_gen.antlr3.tree.TreeParser.__init__ (   self,
  input,
  state = None 
)

Definition at line 2168 of file tree.py.


Member Function Documentation

def rve_interface_gen.antlr3.tree.TreeParser._getAncestor (   adaptor,
  tokenNames,
  t,
  goal 
) [static, private]
Helper for static inContext.

Definition at line 2278 of file tree.py.

def rve_interface_gen.antlr3.tree.TreeParser._inContext (   cls,
  adaptor,
  tokenNames,
  t,
  context 
) [private]
The worker for inContext.

It's static and full of parameters for testing purposes.

Definition at line 2229 of file tree.py.

Definition at line 2195 of file tree.py.

Prefix error message with the grammar name because message is
always intended for the programmer because the parser built
the input tree not the user.

Definition at line 2330 of file tree.py.

def rve_interface_gen.antlr3.tree.TreeParser.getErrorMessage (   self,
  e,
  tokenNames 
)
Tree parsers parse nodes they usually have a token object as
payload. Set the exception token and do the default behavior.

Definition at line 2345 of file tree.py.

def rve_interface_gen.antlr3.tree.TreeParser.getMissingSymbol (   self,
  input,
  e,
  expectedTokenType,
  follow 
)

Definition at line 2199 of file tree.py.

Definition at line 2191 of file tree.py.

Definition at line 2187 of file tree.py.

def rve_interface_gen.antlr3.tree.TreeParser.inContext (   self,
  context,
  adaptor = None,
  tokenName = None,
  t = None 
)
Check if current node in input has a context.

Context means sequence of nodes towards root of tree.  For example,
you might say context is "MULT" which means my parent must be MULT.
"CLASS VARDEF" says current node must be child of a VARDEF and whose
parent is a CLASS node.  You can use "..." to mean zero-or-more nodes.
"METHOD ... VARDEF" means my parent is VARDEF and somewhere above
that is a METHOD node.  The first node in the context is not
necessarily the root.  The context matcher stops matching and returns
true when it runs out of context.  There is no way to force the first
node to be the root. 

Definition at line 2210 of file tree.py.

Match '.' in tree parser has special meaning.  Skip node or
entire tree if node has children.  If children, scan until
corresponding UP node.

Definition at line 2289 of file tree.py.

def rve_interface_gen.antlr3.tree.TreeParser.mismatch (   self,
  input,
  ttype,
  follow 
)
We have DOWN/UP nodes in the stream that have no line info; override.
plus we want to alter the exception type. Don't try to recover
from tree parser errors inline...

Definition at line 2320 of file tree.py.

Definition at line 2175 of file tree.py.

Set the input stream

Definition at line 2181 of file tree.py.

def rve_interface_gen.antlr3.tree.TreeParser.traceIn (   self,
  ruleName,
  ruleIndex 
)

Definition at line 2363 of file tree.py.

def rve_interface_gen.antlr3.tree.TreeParser.traceOut (   self,
  ruleName,
  ruleIndex 
)

Definition at line 2367 of file tree.py.


Member Data Documentation

string rve_interface_gen::antlr3::tree.TreeParser::dotdot = ".*[^.]\\.\\.[^.].*" [static]

Definition at line 2205 of file tree.py.

Definition at line 2207 of file tree.py.

string rve_interface_gen::antlr3::tree.TreeParser::doubleEtc = ".*\\.\\.\\.\\s+\\.\\.\\..*" [static]

Definition at line 2206 of file tree.py.

Definition at line 2208 of file tree.py.

Definition at line 2168 of file tree.py.


The documentation for this class was generated from the following file:


rve_interface_gen
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:31:00