Matt S Trout > Rakudo-Star-2012.08_001 > TGE::Grammar

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

NAME ^

TGE::Grammar - The base class for all tree grammars.

DESCRIPTION ^

TGE::Grammar is the base class for all of the tree grammars for the Tree Grammar Engine

new

Create a new grammar object. [Not implemented: Optionally pass it a grammar specification in a string.] The grammar object holds an array of TGE::Rule objects, which are the semantics defined by the grammar.

add_rule

Add a rule to the current attribute grammar.

apply

Use a precompiled grammar on a data structure. This returns an object on which you can call methods to fetch attributes on the top node of the data structure.

add_symbol

Add a symbol to the lookup table.

symbol_iter

Return an iterator for the symbol lookup table.

dump

Produce a data dump of the current contents of the grammar object.

syntax highlighting: