Module parser :: Class Yappy_grammar
[show private | hide private]
[frames | no frames]

Class Yappy_grammar

LRparser --+    
           |    
       Yappy --+
               |
              Yappy_grammar


A parser for grammar rules. See test() for an example.
Method Summary
  __init__(self, no_table, table)
  GRule(self, args, context)
  MULTIRule(self, arg, context)
  OPRule(self, arg, context)
  OPSEMRule(self, arg, context)
  OPVRule(self, arg, context)
  RHRule(self, arg, context)
  RHSRule(self, arg, context)
  RULERule(self, arg, context)
  test(self)
A test for each class
    Inherited from Yappy
  input(self, str, context)
Reads from stdin or string and retuns parsed result
  inputfile(self, FileName, context)
Reads input from file
  parse_tree(self)
To be defined using output
    Inherited from LRparser
  __str__(self)
Return the LR parsing table showing for each state the action and goto function
  gsrules(self, rulestr, **sym)
Transforms a string in a grammar description
  parse_grammar(self, st, context)
Transforms a string in a grammar description
  parsing(self, tokens, context)
LR Parsing Algorithm (aho86:_compil, page 218)

Instance Variable Summary
    Inherited from Yappy
  lex: a Lexer object
    Inherited from LRparser
  ACTION: Action function
  cfgr: context free grammar
  context: computational context
  GOTO: Goto function
  nonterminals: grammar nonterminals
  output: list of grammar rules used for parsing tokens (right derivation in reverse)
  rules: grammar rules
  stack: LR stack with pairs (state,token)
  table: LR parsing table
  terminals: grammar terminals
  tokens: tokens to be parsed

Method Details

test(self)

A test for each class
Overrides:
parser.Yappy.test (inherited documentation)

Generated by Epydoc 2.0 on Sun Nov 16 11:16:30 2003 http://epydoc.sf.net