Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias FunctionDef arguments args NameParam defaults body Expr Str If CompareIs NameLoad NameLoad body Return Dict Return Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad decorator_list Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad Str Assign NameStore BinOpBitOr NameLoad Call NameLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Str While CompareNotEq AttributeLoad NameLoad attr NameLoad body If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str Str Str body Expr Call AttributeLoad NameLoad attr Continue If CompareIn AttributeLoad NameLoad attr AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr While CompareIn AttributeLoad NameLoad attr AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Return NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Return NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Return NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Return NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Return NameLoad If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr While CompareNotEq AttributeLoad NameLoad attr Str body If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr If CompareNotEq AttributeLoad NameLoad attr Str body AugAssignAdd AttributeStore NameLoad attr Str AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return NameLoad Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num If CompareGtE AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If CompareEq AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareNotEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return NameLoad While CompareIn AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad NameLoad body If CompareEq AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore NameLoad If CompareEq AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareNotEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareNotEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareEq AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Num Str Assign NameStore Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad If CompareNotEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareEq NameLoad Str body Return Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore NameLoad Assign NameStore NameLoad If CompareEq AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareEq NameLoad NameLoad body Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return BinOpAdd BinOpAdd BinOpAdd Str AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad NameLoad orelse If CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareIs NameLoad NameLoad body Return Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameStore ListLoad Expr Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If Call NameLoad NameLoad NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareIs NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Num NameLoad NameLoad orelse If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If CompareIs NameLoad NameLoad body Return If CompareEq Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad For NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareIs NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad body Return Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Dict If Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Return NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body If CompareNotEq Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr body Return NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareNotEq Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr body Return NameLoad If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Return NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Return NameLoad If CompareNotEq Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad body Return NameLoad If CompareNotEq Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad NameLoad body Return NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list decorator_list
N/A N/A  @package antlr3.tree
@brief ANTLR3 runtime package, treewizard module

A utility module to create ASTs at runtime.
See <http://www.antlr.org/wiki/display/~admin/2007/07/02/Exploring+Concept+of+TreeWizard> for an overview. Note that the API of the Python implementation is slightly different.

 antlr3.constants INVALID_TOKEN_TYPE antlr3.tokens CommonToken antlr3.tree CommonTree CommonTreeAdaptor computeTokenTypes N/A N/A tokenNames N/A N/A N/A 
    Compute a dict that is an inverted index of
    tokenNames (which maps int token types to names).
     N/A N/A tokenNames None N/A N/A N/A N/A N/A dict N/A N/A name type N/A N/A type name N/A enumerate tokenNames N/A N/A EOF -1 N/A BEGIN 1 N/A END 2 N/A ID 3 N/A ARG 4 N/A PERCENT 5 N/A COLON 6 N/A DOT 7 TreePatternLexer N/A object N/A __init__ N/A N/A self pattern N/A N/A N/A N/A self pattern pattern N/A N/A self p -1 N/A N/A self c None N/A N/A self n N/A len pattern N/A N/A self sval None N/A N/A self error False N/A N/A N/A self consume N/A N/A __idStartChar N/A frozenset abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ N/A __idChar N/A __idStartChar N/A frozenset 0123456789 nextToken N/A N/A self N/A N/A N/A N/A self sval N/A N/A N/A self c EOF N/A N/A N/A N/A self c N/A N/A N/A N/A N/A self consume N/A N/A N/A N/A self c N/A self __idStartChar N/A N/A N/A self sval N/A self c N/A N/A N/A self consume N/A N/A N/A self c N/A self __idChar N/A N/A N/A self sval N/A self c N/A N/A N/A self consume N/A ID N/A N/A N/A self c ( N/A N/A N/A N/A self consume N/A BEGIN N/A N/A N/A self c ) N/A N/A N/A N/A self consume N/A END N/A N/A N/A self c % N/A N/A N/A N/A self consume N/A PERCENT N/A N/A N/A self c : N/A N/A N/A N/A self consume N/A COLON N/A N/A N/A self c . N/A N/A N/A N/A self consume N/A DOT N/A N/A N/A self c [ N/A N/A N/A N/A self consume N/A N/A N/A self c ] N/A N/A N/A N/A self c \ N/A N/A N/A N/A self consume N/A N/A N/A self c ] N/A N/A N/A self sval \ N/A N/A self sval N/A self c N/A N/A N/A self sval N/A self c N/A N/A N/A self consume N/A N/A N/A self consume N/A ARG N/A N/A N/A self consume N/A N/A self error True N/A EOF N/A EOF N/A consume N/A N/A self N/A N/A N/A N/A self p 1 N/A N/A N/A self p N/A self n N/A N/A N/A self c EOF N/A N/A N/A self c N/A N/A self pattern N/A N/A self p N/A N/A TreePatternParser N/A object N/A __init__ N/A N/A self tokenizer wizard adaptor N/A N/A N/A N/A self tokenizer tokenizer N/A N/A self wizard wizard N/A N/A self adaptor adaptor N/A N/A self ttype N/A N/A tokenizer nextToken N/A pattern N/A N/A self N/A N/A N/A N/A N/A self ttype BEGIN N/A N/A N/A N/A self parseTree N/A N/A N/A N/A self ttype ID N/A N/A node N/A N/A self parseNode N/A N/A N/A self ttype EOF N/A N/A node N/A None N/A None N/A parseTree N/A N/A self N/A N/A N/A N/A N/A self ttype BEGIN N/A N/A None N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A root N/A N/A self parseNode N/A N/A root None N/A N/A None N/A N/A N/A self ttype N/A BEGIN ID PERCENT DOT N/A N/A N/A N/A self ttype BEGIN N/A N/A subtree N/A N/A self parseTree N/A N/A N/A N/A self adaptor addChild root subtree N/A N/A child N/A N/A self parseNode N/A N/A child None N/A N/A None N/A N/A N/A N/A self adaptor addChild root child N/A N/A N/A self ttype END N/A N/A None N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A root N/A parseNode N/A N/A self N/A N/A N/A label None N/A N/A N/A self ttype PERCENT N/A N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A N/A N/A self ttype ID N/A N/A None N/A label N/A N/A self tokenizer sval N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A N/A N/A self ttype COLON N/A N/A None N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A N/A N/A self ttype DOT N/A N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A wildcardPayload N/A CommonToken 0 . N/A node N/A WildcardTreePattern wildcardPayload N/A N/A label None N/A N/A N/A node label label N/A node N/A N/A N/A self ttype ID N/A N/A None N/A tokenName N/A N/A self tokenizer sval N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A N/A tokenName nil N/A N/A N/A N/A N/A self adaptor nil N/A text tokenName N/A arg None N/A N/A N/A self ttype ARG N/A N/A arg N/A N/A self tokenizer sval N/A text arg N/A N/A self ttype N/A N/A N/A self tokenizer nextToken N/A treeNodeType N/A N/A N/A self wizard getTokenType tokenName N/A N/A treeNodeType INVALID_TOKEN_TYPE N/A N/A None N/A node N/A N/A N/A self adaptor createFromType treeNodeType text N/A N/A N/A label None N/A isinstance node TreePattern N/A N/A N/A node label label N/A N/A N/A arg None N/A isinstance node TreePattern N/A N/A N/A node hasTextArg True N/A node N/A N/A TreePattern N/A CommonTree N/A N/A 
    When using %label:TOKENNAME in a tree for parse(), we must
    track the label.
     __init__ N/A N/A self payload N/A N/A N/A N/A N/A CommonTree __init__ self payload N/A N/A self label None N/A N/A self hasTextArg None N/A toString N/A N/A self N/A N/A N/A N/A N/A self label None N/A N/A N/A N/A N/A % N/A self label : N/A N/A CommonTree toString self N/A N/A N/A N/A CommonTree toString self N/A N/A WildcardTreePattern N/A TreePattern N/A N/A N/A TreePatternTreeAdaptor N/A CommonTreeAdaptor N/A N/A This adaptor creates TreePattern objects for use during scan() createWithPayload N/A N/A self payload N/A N/A N/A N/A TreePattern payload N/A N/A TreeWizard N/A object N/A N/A 
    Build and navigate trees with this object.  Must know about the names
    of tokens so you have to pass in a map or array of token names (from which
    this class can build the map).  I.e., Token DECL means nothing unless the
    class can translate it to a token type.

    In order to create nodes and navigate, this class needs a TreeAdaptor.

    This class can build a token type -> node index for repeated use or for
    iterating over the various nodes with a particular type.

    This class works in conjunction with the TreeAdaptor rather than moving
    all this functionality into the adaptor.  An adaptor helps build and
    navigate trees using methods.  This class helps you do it with string
    patterns like "(A B C)".  You can create a tree from that pattern or
    match subtrees against it.
     __init__ N/A N/A self adaptor tokenNames typeMap N/A None None None N/A N/A N/A self adaptor adaptor N/A N/A typeMap None N/A N/A N/A self tokenNameToTypeMap N/A computeTokenTypes tokenNames N/A N/A N/A tokenNames None N/A N/A N/A ValueError Can't have both tokenNames and typeMap N/A N/A self tokenNameToTypeMap typeMap N/A getTokenType N/A N/A self tokenName N/A N/A N/A Using the map of token names to token types, return the type. N/A N/A N/A N/A N/A self tokenNameToTypeMap N/A tokenName N/A N/A N/A KeyError N/A N/A INVALID_TOKEN_TYPE N/A create N/A N/A self pattern N/A N/A N/A 
        Create a tree or node from the indicated tree pattern that closely
        follows ANTLR tree grammar tree element syntax:
        
        (root child1 ... child2).
        
        You can also just pass in a node: ID
         
        Any node can have a text argument: ID[foo]
        (notice there are no quotes around foo--it's clear it's a string).
        
        nil is a special name meaning "give me a nil node".  Useful for
        making lists: (nil A B C) is a list of A B C.
         N/A tokenizer N/A TreePatternLexer pattern N/A parser N/A TreePatternParser tokenizer self N/A self adaptor N/A N/A N/A parser pattern N/A index N/A N/A self tree N/A N/A N/A Walk the entire tree and make a node name to nodes mapping.
        
        For now, use recursion but later nonrecursive version may be
        more efficient.  Returns a dict int -> list where the list is
        of your AST node type.  The int is the token type of the node.
         N/A m N/A N/A N/A N/A self _index tree m N/A m N/A _index N/A N/A self t m N/A N/A N/A Do the work for index N/A N/A t None N/A N/A N/A ttype N/A N/A N/A self adaptor getType t N/A elements N/A N/A m get ttype N/A N/A elements None N/A N/A N/A m N/A ttype elements N/A N/A N/A N/A elements append t N/A i N/A range N/A N/A N/A self adaptor getChildCount t N/A N/A child N/A N/A N/A self adaptor getChild t i N/A N/A N/A self _index child m N/A find N/A N/A self tree what N/A N/A N/A Return a list of matching token.

        what may either be an integer specifzing the token type to find or
        a string with a pattern that must be matched.
        
         N/A N/A isinstance what N/A int long N/A N/A N/A N/A self _findTokenType tree what N/A N/A N/A isinstance what basestring N/A N/A N/A N/A self _findPattern tree what N/A N/A N/A TypeError 'what' must be string or integer N/A _findTokenType N/A N/A self t ttype N/A N/A N/A Return a List of tree nodes with token type ttype N/A nodes N/A visitor N/A N/A tree parent childIndex labels N/A N/A N/A N/A N/A nodes append tree N/A N/A N/A N/A self visit t ttype visitor N/A nodes N/A _findPattern N/A N/A self t pattern N/A N/A N/A Return a List of subtrees matching pattern. N/A subtrees N/A N/A tokenizer N/A TreePatternLexer pattern N/A parser N/A TreePatternParser tokenizer self N/A TreePatternTreeAdaptor N/A tpattern N/A N/A parser pattern N/A N/A N/A tpattern None N/A N/A tpattern isNil N/A isinstance tpattern WildcardTreePattern N/A N/A None N/A rootTokenType N/A N/A tpattern getType visitor N/A N/A tree parent childIndex label N/A N/A N/A N/A N/A self _parse tree tpattern None N/A N/A N/A N/A subtrees append tree N/A N/A N/A N/A self visit t rootTokenType visitor N/A subtrees N/A visit N/A N/A self tree what visitor N/A N/A N/A Visit every node in tree matching what, invoking the visitor.

        If what is a string, it is parsed as a pattern and only matching
        subtrees will be visited.
        The implementation uses the root node of the pattern in combination
        with visit(t, ttype, visitor) so nil-rooted patterns are not allowed.
        Patterns with wildcard roots are also not allowed.

        If what is an integer, it is used as a token type and visit will match
        all nodes of that type (this is faster than the pattern match).
        The labels arg of the visitor action method is never set (it's None)
        since using a token type rather than a pattern doesn't let us set a
        label.
         N/A N/A isinstance what N/A int long N/A N/A N/A N/A self _visitType tree None 0 what visitor N/A N/A N/A isinstance what basestring N/A N/A N/A N/A self _visitPattern tree what visitor N/A N/A N/A TypeError 'what' must be string or integer N/A _visitType N/A N/A self t parent childIndex ttype visitor N/A N/A N/A Do the recursive work for visit N/A N/A t None N/A N/A N/A N/A N/A N/A N/A self adaptor getType t ttype N/A N/A N/A visitor t parent childIndex None N/A i N/A range N/A N/A N/A self adaptor getChildCount t N/A N/A child N/A N/A N/A self adaptor getChild t i N/A N/A N/A self _visitType child t i ttype visitor N/A _visitPattern N/A N/A self tree pattern visitor N/A N/A N/A 
        For all subtrees that match the pattern, execute the visit action.
         N/A tokenizer N/A TreePatternLexer pattern N/A parser N/A TreePatternParser tokenizer self N/A TreePatternTreeAdaptor N/A tpattern N/A N/A parser pattern N/A N/A N/A tpattern None N/A N/A tpattern isNil N/A isinstance tpattern WildcardTreePattern N/A N/A N/A rootTokenType N/A N/A tpattern getType rootvisitor N/A N/A tree parent childIndex labels N/A N/A N/A labels N/A N/A N/A N/A self _parse tree tpattern labels N/A N/A N/A visitor tree parent childIndex labels N/A N/A N/A N/A self visit tree rootTokenType rootvisitor N/A parse N/A N/A self t pattern labels N/A None N/A N/A 
        Given a pattern like (ASSIGN %lhs:ID %rhs:.) with optional labels
        on the various nodes and '.' (dot) as the node/subtree wildcard,
        return true if the pattern matches and fill the labels Map with
        the labels pointing at the appropriate nodes.  Return false if
        the pattern is malformed or the tree does not match.

        If a node specifies a text arg in pattern, then that must match
        for that node in t.
         N/A tokenizer N/A TreePatternLexer pattern N/A parser N/A TreePatternParser tokenizer self N/A TreePatternTreeAdaptor N/A tpattern N/A N/A parser pattern N/A N/A N/A self _parse t tpattern labels N/A _parse N/A N/A self t1 t2 labels N/A N/A N/A 
        Do the work for parse. Check to see if the t2 pattern fits the
        structure and token types in t1.  Check text if the pattern has
        text arguments on nodes.  Fill labels map with pointers to nodes
        in tree matched against nodes in pattern with labels.
	 N/A N/A N/A t1 None N/A t2 None N/A N/A False N/A N/A N/A isinstance t2 WildcardTreePattern N/A N/A N/A N/A N/A N/A self adaptor getType t1 N/A N/A t2 getType N/A N/A False N/A N/A N/A t2 hasTextArg N/A N/A N/A N/A self adaptor getText t1 N/A N/A t2 getText N/A N/A False N/A N/A N/A N/A t2 label None N/A labels None N/A N/A N/A labels N/A N/A t2 label t1 N/A n1 N/A N/A N/A self adaptor getChildCount t1 N/A n2 N/A N/A t2 getChildCount N/A N/A n1 n2 N/A N/A False N/A i N/A range n1 N/A N/A child1 N/A N/A N/A self adaptor getChild t1 i N/A child2 N/A N/A t2 getChild i N/A N/A N/A N/A self _parse child1 child2 labels N/A N/A False N/A True N/A equals N/A N/A self t1 t2 adaptor N/A None N/A N/A 
        Compare t1 and t2; return true if token types/text, structure match
        exactly.
        The trees are examined in their entirety so that (A B) does not match
        (A B C) nor (A (B C)). 
         N/A N/A adaptor None N/A N/A adaptor N/A self adaptor N/A N/A N/A self _equals t1 t2 adaptor N/A _equals N/A N/A self t1 t2 adaptor N/A N/A N/A N/A N/A t1 None N/A t2 None N/A N/A False N/A N/A N/A N/A adaptor getType t1 N/A N/A adaptor getType t2 N/A N/A False N/A N/A N/A N/A adaptor getText t1 N/A N/A adaptor getText t2 N/A N/A False N/A n1 N/A N/A adaptor getChildCount t1 N/A n2 N/A N/A adaptor getChildCount t2 N/A N/A n1 n2 N/A N/A False N/A i N/A range n1 N/A N/A child1 N/A N/A adaptor getChild t1 i N/A child2 N/A N/A adaptor getChild t2 i N/A N/A N/A N/A self _equals child1 child2 adaptor N/A N/A False N/A True N/A N/A