# -*- Mode: Python -*-
import sys
import Parsing
T = Parsing.Token
NT = Parsing.Nonterm
class t_DEDENT (T):
"%token DEDENT [p1]"
class t_and (T):
"%token and [p1]"
class t_elif (T):
"%token elif [p1]"
class t_semicolon (T):
"%token semicolon [p1]"
class t_is (T):
"%token is [p1]"
class t_pass (T):
"%token pass [p1]"
class t_NUMBER (T):
"%token NUMBER [p1]"
class t_comma (T):
"%token comma [p1]"
class t_in (T):
"%token in [p1]"
class t_if (T):
"%token if [p1]"
class t_NEWLINE (T):
"%token NEWLINE [p1]"
class t_percent (T):
"%token percent [p1]"
class t_slash (T):
"%token slash [p1]"
class t_print (T):
"%token print [p1]"
class t_slashslash (T):
"%token slashslash [p1]"
class t_STRING (T):
"%token STRING [p1]"
class t_equals (T):
"%token equals [p1]"
class t_else (T):
"%token else [p1]"
class t_not (T):
"%token not [p1]"
class t_splat (T):
"%token splat [p1]"
class t_COMP_OP (T):
"%token COMP_OP [p1]"
class t_INDENT (T):
"%token INDENT [p1]"
class t_NAME (T):
"%token NAME [p1]"
class t_or (T):
"%token or [p1]"
class t_while (T):
"%token while [p1]"
class t_plus (T):
"%token plus [p1]"
class t_colon (T):
"%token colon [p1]"
class t_minus (T):
"%token minus [p1]"
class p1 (Parsing.Precedence):
"%right p1"
class atom_o_2_c_0_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce STRING atom_o_2_c_0_s1 [p1]"
def r_1 (self, *args):
"%reduce STRING [p1]"
class print_stmt_c_1_q_c_2_q (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce comma [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class comp_op (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce COMP_OP [p1]"
def r_1 (self, *args):
"%reduce in [p1]"
def r_2 (self, *args):
"%reduce not in [p1]"
def r_3 (self, *args):
"%reduce is [p1]"
def r_4 (self, *args):
"%reduce is not [p1]"
class compound_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce if_stmt [p1]"
def r_1 (self, *args):
"%reduce while_stmt [p1]"
class not_test (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce not not_test [p1]"
def r_1 (self, *args):
"%reduce comparison [p1]"
class atom (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce NAME [p1]"
def r_1 (self, *args):
"%reduce NUMBER [p1]"
def r_2 (self, *args):
"%reduce atom_o_2_c_0_s1 [p1]"
class expr_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce expr_c_1_s_c_0_o term expr_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class small_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce expr_stmt [p1]"
def r_1 (self, *args):
"%reduce print_stmt [p1]"
def r_2 (self, *args):
"%reduce pass_stmt [p1]"
class term_c_1_s_c_0_o (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce splat [p1]"
def r_1 (self, *args):
"%reduce slash [p1]"
def r_2 (self, *args):
"%reduce percent [p1]"
def r_3 (self, *args):
"%reduce slashslash [p1]"
class testlist_c_2_q (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce comma [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class print_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce print print_stmt_c_1_q [p1]"
class test (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce and_test test_c_1_s1 [p1]"
class while_stmt_c_4_q (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce else colon suite [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class suite (NT):
"%start"
def r_0 (self, *args):
"%reduce simple_stmt [p1]"
def r_1 (self, *args):
"%reduce NEWLINE INDENT suite_o_1_c_2_s1 DEDENT [p1]"
class stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce simple_stmt [p1]"
def r_1 (self, *args):
"%reduce compound_stmt [p1]"
class simple_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce small_stmt simple_stmt_c_1_s1 simple_stmt_c_2_q NEWLINE [p1]"
class testlist (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce test testlist_c_1_s1 testlist_c_2_q [p1]"
class simple_stmt_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce semicolon small_stmt simple_stmt_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class simple_stmt_c_2_q (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce semicolon [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class print_stmt_c_1_q_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce comma test print_stmt_c_1_q_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class comparison_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce comp_op expr comparison_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class and_test (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce not_test and_test_c_1_s1 [p1]"
class and_test_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce and not_test and_test_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class expr_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce testlist expr_stmt_c_1_s1 [p1]"
class if_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce if test colon suite if_stmt_c_4_s1 if_stmt_c_5_q [p1]"
class comparison (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce expr comparison_c_1_s1 [p1]"
class term (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce atom term_c_1_s1 [p1]"
class pass_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce pass [p1]"
class expr (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce term expr_c_1_s1 [p1]"
class expr_stmt_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce equals testlist expr_stmt_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class if_stmt_c_4_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce elif test colon suite if_stmt_c_4_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class while_stmt (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce while test colon suite while_stmt_c_4_q [p1]"
class testlist_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce comma test testlist_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class suite_o_1_c_2_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce stmt suite_o_1_c_2_s1 [p1]"
def r_1 (self, *args):
"%reduce stmt [p1]"
class if_stmt_c_5_q (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce else colon suite [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class print_stmt_c_1_q (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce test print_stmt_c_1_q_c_1_s1 print_stmt_c_1_q_c_2_q [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class expr_c_1_s_c_0_o (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce plus [p1]"
def r_1 (self, *args):
"%reduce minus [p1]"
class term_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce term_c_1_s_c_0_o atom term_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
class test_c_1_s1 (NT):
"%nonterm"
def r_0 (self, *args):
"%reduce or and_test test_c_1_s1 [p1]"
def r_1 (self, *args):
"%reduce [p1]"
spec = Parsing.Spec (sys.modules[__name__], skinny=False, logFile="t0.log", verbose=True)