Ahmed Youssef avatar Ahmed Youssef committed 9935fbf

clean parser

Comments (0)

Files changed (7)

pykid/codegen1.py

+def get_ptype(p):
+    if p is not None:
+        return p[0]
+    
+def evalBINARYOP(p):
+
+    
+    l=p[1][0]
+    op=p[1][1]
+    r=p[1][2]
+
+    if isinstance(l, tuple):
+        if l[0] in ["VALUE", "VAR"]:
+            l=l[1]
+        else: #BINOP
+            l=evalBINARYOP(l) #skip binop
+    
+    if isinstance(r, tuple):
+        if r[0] in ["VALUE", "VAR"]:
+            r=r[1]
+        else: #BINOP
+            r=evalBINARYOP(r) #skip binop
+    #print "L: ", l
+    #print "R: ", r
+    #print "OP: ", op
+    if isinstance(l, str) or isinstance(r, str): #variables are not evaluated
+        return str(l) + str(op) + str(r)
+    if op=="+":
+        res= l+r
+    elif op=="*":
+        res= l*r
+    elif op=="/":
+        res= l/r
+    elif op=="-":
+        res= l-r
+    elif op=="==":
+        res=l==r
+    elif op=="!=":
+        res= l!=r 
+    elif op==">":
+        res= l>r
+    elif op=="<":
+        res= r<l
+    elif op==">=":
+        res= r>=l
+    elif op=="<=":
+        res= r<=l
+    return res
+
+def simplegenerator(p, level=0):
+    t=get_ptype(p)
+    pyfile=""
+    if t=="PROGRAM":
+        stmts=p[1]
+
+        for stmt in stmts:
+            gen=simplegenerator(stmt)
+            if gen:
+                pyfile += "    "*level + simplegenerator(stmt)
+    elif t=="BINOP":
+		pyfile +=str(evalBINARYOP(p))
+    elif t=="WHILE":
+		cond=simplegenerator(p[1])
+		whileblock=p[2]
+		pyfile += "    "*level+ "while "+ cond + ":\n"
+		pyfile += simplegenerator(whileblock, level+1)
+
+
+    elif t=="IF":
+		cond=simplegenerator(p[1])
+		ifblock=p[2]
+		pyfile += "    "*level+ "if "+ str(cond) + ":\n"
+		pyfile += simplegenerator(ifblock, level+1)
+		
+    elif t=="IFELSE":
+		cond=simplegenerator(p[1])
+		ifblock=p[2]
+		elseblock=p[3]
+		pyfile += "    "*level+"if "+ str(cond) + ":\n"
+		pyfile += simplegenerator(ifblock, level+1)
+		pyfile += "    "*level+"else :\n"
+		pyfile += simplegenerator(elseblock, level+1)
+		
+		
+    elif t=="VARDEF":
+        name=p[1]
+        val=p[2]
+        if isinstance(val, tuple):
+            if val[0]=="BINOP":
+                val=evalBINARYOP(val)
+            elif val[0]=="VALUE":
+                val=val[1]
+            elif val[0]=="FUNCCALL":
+                val=simplegenerator(val)
+                
+        pyfile += "    "*level+name + "=" + str(val) +"\n"
+    elif t=="FUNCCALL":
+        funcname=p[1]
+        args=p[2]
+        cleanargs=[]
+        for arg in args:
+            argt=arg[0]
+            argval=arg[1]
+            if argt in ['VALUE', 'VAR']:
+                cleanargs.append(argval)
+            elif argt=="BINOP":
+                val=evalBINARYOP(arg)
+                cleanargs.append(val)
+                
+        pyfile += "    "*level+funcname +"("+",".join(str(x) for x in cleanargs) + ")"
+    
+    elif t=="FUNCDEF":
+        funcname=p[1]
+        args=",".join(str(arg[1]).lstrip() for arg in p[2]) #[ (var, varname ) ...]
+        funcbody=simplegenerator(p[3], level+1)
+        pyfile +="    "*level+"def " + funcname + "("+args+")" + ":"  +"\n"
+        head=" "*(level)
+        pyfile+=head+funcbody
+    elif t=="INNERBLOCK":
+        stmts=p[1]
+        #print "INNERBLOCK: ", stmts
+        for stmt in stmts:
+            if stmt is not None:
+                pyfile +=simplegenerator(stmt, level)
+                pyfile +="\n"
+        return pyfile
+    return pyfile 
+'''
+Created on Mar 4, 2012
+
+@author: xmonader
+'''
+
+
+class Node(object):
+    pass
+    
+class Program(Node):
+    def __init__(self, stmtlist):
+        self.stmtlist=stmtlist
+
+class Funccall(Node):
+    def __init__(self, name, args):
+        self.name=name
+        self.args=args
+        
+class Funcdef(Node):
+    def __init__(self, name, args, body):
+        self.name=name
+        self.args=args
+        self.body=body
+        
+
+class BinaryNode(Node):
+    def __init__(self, l, op, r):
+        self.left=l
+        self.op=op
+        self.r=op
+        
+        
+class VardefNode(Node):
+    def __init__(self, varname, value):
+        self.varname=varname
+        self.value=value
+      
+
+if __name__=="__main__":
+    pass
 
 #we have no keywords
 
-tokens=('FUNCTION', 'ID', 'NUMBER', 'STRING', 'COLON', 'LT', 'GT', 'GE', 'LE',  'EQ','EQUALS',
+tokens=('DEF', 'FUNCTION', 'IF', 'ELSE', 'WHILE', 'FOREACH', 'ID', 'NUMBER', 'STRING', 'COLON', 'LT', 'GT', 'GE', 'LE',  'EQ','EQUALS',
          'PLUS', 'NE',
         'MINUS', 'TIMES', 'DIVIDE', 'COMMA', 'SEMICOLON', 'LBRACE', 'RBRACE',
         'RPAREN', 'LPAREN')
 t_SEMICOLON        = r';'
 t_COLON            = r':'
 
+def t_WHILE(t):
+	r'while'
+	return t
+
+def t_FOREACH(t):
+	r'foreach'
+	return t
+def t_IF(t):
+	r'if'
+	return t
+
+def t_ELSE(t):
+	r'else'
+	return t
 
 def t_FUNCTION(t):
     r'function'
     return t
-
+def t_DEF(t):
+    r'def'
+    return t
 def t_ID(t):
     r'[a-z]+[0-9]?' #only lowercase.
     return t
+Created by PLY version 3.4 (http://www.dabeaz.com/ply)
+
+Unused terminals:
+
+    SEMICOLON
+
+Grammar
+
+Rule 0     S' -> program
+Rule 1     program -> stmtlist
+Rule 2     innerblock -> LBRACE stmtlist RBRACE
+Rule 3     innerblock -> LBRACE RBRACE
+Rule 4     stmtlist -> stmt stmtlist
+Rule 5     stmtlist -> <empty>
+Rule 6     stmt -> funcdef
+Rule 7     stmt -> whilestmt
+Rule 8     stmt -> foreachstmt
+Rule 9     stmt -> ifelsestmt
+Rule 10    stmt -> ifstmt
+Rule 11    stmt -> vardef
+Rule 12    stmt -> qexpr
+Rule 13    stmt -> <empty>
+Rule 14    whilestmt -> WHILE LPAREN qexpr RPAREN innerblock
+Rule 15    foreachstmt -> FOREACH LPAREN qexpr COLON qexpr RPAREN innerblock
+Rule 16    ifelsestmt -> IF LPAREN qexpr RPAREN innerblock ELSE innerblock
+Rule 17    ifstmt -> IF LPAREN qexpr RPAREN innerblock
+Rule 18    funcdef -> ID LPAREN argslist RPAREN EQUALS FUNCTION innerblock
+Rule 19    vardef -> DEF ID EQUALS qexpr
+Rule 20    qexpr -> ID LPAREN argslist RPAREN
+Rule 21    argslist -> qexpr COMMA argslist
+Rule 22    argslist -> innerblock COMMA argslist
+Rule 23    argslist -> qexpr
+Rule 24    argslist -> innerblock
+Rule 25    argslist -> <empty>
+Rule 26    qexpr -> qexpr PLUS qexpr
+Rule 27    qexpr -> qexpr MINUS qexpr
+Rule 28    qexpr -> qexpr TIMES qexpr
+Rule 29    qexpr -> qexpr DIVIDE qexpr
+Rule 30    qexpr -> qexpr EQ qexpr
+Rule 31    qexpr -> qexpr NE qexpr
+Rule 32    qexpr -> qexpr GT qexpr
+Rule 33    qexpr -> qexpr LT qexpr
+Rule 34    qexpr -> qexpr GE qexpr
+Rule 35    qexpr -> qexpr LE qexpr
+Rule 36    qexpr -> LPAREN qexpr RPAREN
+Rule 37    qexpr -> <empty>
+Rule 38    qexpr -> ID
+Rule 39    qexpr -> STRING
+Rule 40    qexpr -> NUMBER
+
+Terminals, with rules where they appear
+
+COLON                : 15
+COMMA                : 21 22
+DEF                  : 19
+DIVIDE               : 29
+ELSE                 : 16
+EQ                   : 30
+EQUALS               : 18 19
+FOREACH              : 15
+FUNCTION             : 18
+GE                   : 34
+GT                   : 32
+ID                   : 18 19 20 38
+IF                   : 16 17
+LBRACE               : 2 3
+LE                   : 35
+LPAREN               : 14 15 16 17 18 20 36
+LT                   : 33
+MINUS                : 27
+NE                   : 31
+NUMBER               : 40
+PLUS                 : 26
+RBRACE               : 2 3
+RPAREN               : 14 15 16 17 18 20 36
+SEMICOLON            : 
+STRING               : 39
+TIMES                : 28
+WHILE                : 14
+error                : 
+
+Nonterminals, with rules where they appear
+
+argslist             : 18 20 21 22
+foreachstmt          : 8
+funcdef              : 6
+ifelsestmt           : 9
+ifstmt               : 10
+innerblock           : 14 15 16 16 17 18 22 24
+program              : 0
+qexpr                : 12 14 15 15 16 17 19 21 23 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36
+stmt                 : 4
+stmtlist             : 1 2 4
+vardef               : 11
+whilestmt            : 7
+
+Parsing method: LALR
+
+state 0
+
+    (0) S' -> . program
+    (1) program -> . stmtlist
+    (4) stmtlist -> . stmt stmtlist
+    (5) stmtlist -> .
+    (6) stmt -> . funcdef
+    (7) stmt -> . whilestmt
+    (8) stmt -> . foreachstmt
+    (9) stmt -> . ifelsestmt
+    (10) stmt -> . ifstmt
+    (11) stmt -> . vardef
+    (12) stmt -> . qexpr
+    (13) stmt -> .
+    (18) funcdef -> . ID LPAREN argslist RPAREN EQUALS FUNCTION innerblock
+    (14) whilestmt -> . WHILE LPAREN qexpr RPAREN innerblock
+    (15) foreachstmt -> . FOREACH LPAREN qexpr COLON qexpr RPAREN innerblock
+    (16) ifelsestmt -> . IF LPAREN qexpr RPAREN innerblock ELSE innerblock
+    (17) ifstmt -> . IF LPAREN qexpr RPAREN innerblock
+    (19) vardef -> . DEF ID EQUALS qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! reduce/reduce conflict for $end resolved using rule 5 (stmtlist -> .)
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for WHILE resolved as shift
+  ! shift/reduce conflict for FOREACH resolved as shift
+  ! shift/reduce conflict for IF resolved as shift
+  ! shift/reduce conflict for DEF resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! reduce/reduce conflict for PLUS resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for MINUS resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for TIMES resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for DIVIDE resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for EQ resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for NE resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for GT resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for LT resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for GE resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for LE resolved using rule 13 (stmt -> .)
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for WHILE resolved as shift
+  ! shift/reduce conflict for FOREACH resolved as shift
+  ! shift/reduce conflict for IF resolved as shift
+  ! shift/reduce conflict for DEF resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! reduce/reduce conflict for STRING resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for NUMBER resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for $end resolved using rule 5 (stmtlist -> .)
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    $end            reduce using rule 5 (stmtlist -> .)
+    PLUS            reduce using rule 13 (stmt -> .)
+    MINUS           reduce using rule 13 (stmt -> .)
+    TIMES           reduce using rule 13 (stmt -> .)
+    DIVIDE          reduce using rule 13 (stmt -> .)
+    EQ              reduce using rule 13 (stmt -> .)
+    NE              reduce using rule 13 (stmt -> .)
+    GT              reduce using rule 13 (stmt -> .)
+    LT              reduce using rule 13 (stmt -> .)
+    GE              reduce using rule 13 (stmt -> .)
+    LE              reduce using rule 13 (stmt -> .)
+    ID              shift and go to state 17
+    WHILE           shift and go to state 5
+    FOREACH         shift and go to state 14
+    IF              shift and go to state 18
+    DEF             shift and go to state 8
+    LPAREN          shift and go to state 15
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 13 (stmt -> .) ]
+  ! WHILE           [ reduce using rule 13 (stmt -> .) ]
+  ! FOREACH         [ reduce using rule 13 (stmt -> .) ]
+  ! IF              [ reduce using rule 13 (stmt -> .) ]
+  ! DEF             [ reduce using rule 13 (stmt -> .) ]
+  ! LPAREN          [ reduce using rule 13 (stmt -> .) ]
+  ! STRING          [ reduce using rule 13 (stmt -> .) ]
+  ! NUMBER          [ reduce using rule 13 (stmt -> .) ]
+  ! $end            [ reduce using rule 13 (stmt -> .) ]
+  ! PLUS            [ reduce using rule 37 (qexpr -> .) ]
+  ! MINUS           [ reduce using rule 37 (qexpr -> .) ]
+  ! TIMES           [ reduce using rule 37 (qexpr -> .) ]
+  ! DIVIDE          [ reduce using rule 37 (qexpr -> .) ]
+  ! EQ              [ reduce using rule 37 (qexpr -> .) ]
+  ! NE              [ reduce using rule 37 (qexpr -> .) ]
+  ! GT              [ reduce using rule 37 (qexpr -> .) ]
+  ! LT              [ reduce using rule 37 (qexpr -> .) ]
+  ! GE              [ reduce using rule 37 (qexpr -> .) ]
+  ! LE              [ reduce using rule 37 (qexpr -> .) ]
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! WHILE           [ reduce using rule 37 (qexpr -> .) ]
+  ! FOREACH         [ reduce using rule 37 (qexpr -> .) ]
+  ! IF              [ reduce using rule 37 (qexpr -> .) ]
+  ! DEF             [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+  ! $end            [ reduce using rule 37 (qexpr -> .) ]
+
+    ifelsestmt                     shift and go to state 1
+    foreachstmt                    shift and go to state 2
+    qexpr                          shift and go to state 12
+    stmt                           shift and go to state 13
+    whilestmt                      shift and go to state 4
+    program                        shift and go to state 11
+    vardef                         shift and go to state 10
+    stmtlist                       shift and go to state 6
+    funcdef                        shift and go to state 16
+    ifstmt                         shift and go to state 7
+
+state 1
+
+    (9) stmt -> ifelsestmt .
+
+    ID              reduce using rule 9 (stmt -> ifelsestmt .)
+    WHILE           reduce using rule 9 (stmt -> ifelsestmt .)
+    FOREACH         reduce using rule 9 (stmt -> ifelsestmt .)
+    IF              reduce using rule 9 (stmt -> ifelsestmt .)
+    DEF             reduce using rule 9 (stmt -> ifelsestmt .)
+    LPAREN          reduce using rule 9 (stmt -> ifelsestmt .)
+    STRING          reduce using rule 9 (stmt -> ifelsestmt .)
+    NUMBER          reduce using rule 9 (stmt -> ifelsestmt .)
+    PLUS            reduce using rule 9 (stmt -> ifelsestmt .)
+    MINUS           reduce using rule 9 (stmt -> ifelsestmt .)
+    TIMES           reduce using rule 9 (stmt -> ifelsestmt .)
+    DIVIDE          reduce using rule 9 (stmt -> ifelsestmt .)
+    EQ              reduce using rule 9 (stmt -> ifelsestmt .)
+    NE              reduce using rule 9 (stmt -> ifelsestmt .)
+    GT              reduce using rule 9 (stmt -> ifelsestmt .)
+    LT              reduce using rule 9 (stmt -> ifelsestmt .)
+    GE              reduce using rule 9 (stmt -> ifelsestmt .)
+    LE              reduce using rule 9 (stmt -> ifelsestmt .)
+    $end            reduce using rule 9 (stmt -> ifelsestmt .)
+    RBRACE          reduce using rule 9 (stmt -> ifelsestmt .)
+
+
+state 2
+
+    (8) stmt -> foreachstmt .
+
+    ID              reduce using rule 8 (stmt -> foreachstmt .)
+    WHILE           reduce using rule 8 (stmt -> foreachstmt .)
+    FOREACH         reduce using rule 8 (stmt -> foreachstmt .)
+    IF              reduce using rule 8 (stmt -> foreachstmt .)
+    DEF             reduce using rule 8 (stmt -> foreachstmt .)
+    LPAREN          reduce using rule 8 (stmt -> foreachstmt .)
+    STRING          reduce using rule 8 (stmt -> foreachstmt .)
+    NUMBER          reduce using rule 8 (stmt -> foreachstmt .)
+    PLUS            reduce using rule 8 (stmt -> foreachstmt .)
+    MINUS           reduce using rule 8 (stmt -> foreachstmt .)
+    TIMES           reduce using rule 8 (stmt -> foreachstmt .)
+    DIVIDE          reduce using rule 8 (stmt -> foreachstmt .)
+    EQ              reduce using rule 8 (stmt -> foreachstmt .)
+    NE              reduce using rule 8 (stmt -> foreachstmt .)
+    GT              reduce using rule 8 (stmt -> foreachstmt .)
+    LT              reduce using rule 8 (stmt -> foreachstmt .)
+    GE              reduce using rule 8 (stmt -> foreachstmt .)
+    LE              reduce using rule 8 (stmt -> foreachstmt .)
+    $end            reduce using rule 8 (stmt -> foreachstmt .)
+    RBRACE          reduce using rule 8 (stmt -> foreachstmt .)
+
+
+state 3
+
+    (40) qexpr -> NUMBER .
+
+    PLUS            reduce using rule 40 (qexpr -> NUMBER .)
+    MINUS           reduce using rule 40 (qexpr -> NUMBER .)
+    TIMES           reduce using rule 40 (qexpr -> NUMBER .)
+    DIVIDE          reduce using rule 40 (qexpr -> NUMBER .)
+    EQ              reduce using rule 40 (qexpr -> NUMBER .)
+    NE              reduce using rule 40 (qexpr -> NUMBER .)
+    GT              reduce using rule 40 (qexpr -> NUMBER .)
+    LT              reduce using rule 40 (qexpr -> NUMBER .)
+    GE              reduce using rule 40 (qexpr -> NUMBER .)
+    LE              reduce using rule 40 (qexpr -> NUMBER .)
+    ID              reduce using rule 40 (qexpr -> NUMBER .)
+    WHILE           reduce using rule 40 (qexpr -> NUMBER .)
+    FOREACH         reduce using rule 40 (qexpr -> NUMBER .)
+    IF              reduce using rule 40 (qexpr -> NUMBER .)
+    DEF             reduce using rule 40 (qexpr -> NUMBER .)
+    LPAREN          reduce using rule 40 (qexpr -> NUMBER .)
+    STRING          reduce using rule 40 (qexpr -> NUMBER .)
+    NUMBER          reduce using rule 40 (qexpr -> NUMBER .)
+    $end            reduce using rule 40 (qexpr -> NUMBER .)
+    RBRACE          reduce using rule 40 (qexpr -> NUMBER .)
+    RPAREN          reduce using rule 40 (qexpr -> NUMBER .)
+    COLON           reduce using rule 40 (qexpr -> NUMBER .)
+    COMMA           reduce using rule 40 (qexpr -> NUMBER .)
+
+
+state 4
+
+    (7) stmt -> whilestmt .
+
+    ID              reduce using rule 7 (stmt -> whilestmt .)
+    WHILE           reduce using rule 7 (stmt -> whilestmt .)
+    FOREACH         reduce using rule 7 (stmt -> whilestmt .)
+    IF              reduce using rule 7 (stmt -> whilestmt .)
+    DEF             reduce using rule 7 (stmt -> whilestmt .)
+    LPAREN          reduce using rule 7 (stmt -> whilestmt .)
+    STRING          reduce using rule 7 (stmt -> whilestmt .)
+    NUMBER          reduce using rule 7 (stmt -> whilestmt .)
+    PLUS            reduce using rule 7 (stmt -> whilestmt .)
+    MINUS           reduce using rule 7 (stmt -> whilestmt .)
+    TIMES           reduce using rule 7 (stmt -> whilestmt .)
+    DIVIDE          reduce using rule 7 (stmt -> whilestmt .)
+    EQ              reduce using rule 7 (stmt -> whilestmt .)
+    NE              reduce using rule 7 (stmt -> whilestmt .)
+    GT              reduce using rule 7 (stmt -> whilestmt .)
+    LT              reduce using rule 7 (stmt -> whilestmt .)
+    GE              reduce using rule 7 (stmt -> whilestmt .)
+    LE              reduce using rule 7 (stmt -> whilestmt .)
+    $end            reduce using rule 7 (stmt -> whilestmt .)
+    RBRACE          reduce using rule 7 (stmt -> whilestmt .)
+
+
+state 5
+
+    (14) whilestmt -> WHILE . LPAREN qexpr RPAREN innerblock
+
+    LPAREN          shift and go to state 19
+
+
+state 6
+
+    (1) program -> stmtlist .
+
+    $end            reduce using rule 1 (program -> stmtlist .)
+
+
+state 7
+
+    (10) stmt -> ifstmt .
+
+    ID              reduce using rule 10 (stmt -> ifstmt .)
+    WHILE           reduce using rule 10 (stmt -> ifstmt .)
+    FOREACH         reduce using rule 10 (stmt -> ifstmt .)
+    IF              reduce using rule 10 (stmt -> ifstmt .)
+    DEF             reduce using rule 10 (stmt -> ifstmt .)
+    LPAREN          reduce using rule 10 (stmt -> ifstmt .)
+    STRING          reduce using rule 10 (stmt -> ifstmt .)
+    NUMBER          reduce using rule 10 (stmt -> ifstmt .)
+    PLUS            reduce using rule 10 (stmt -> ifstmt .)
+    MINUS           reduce using rule 10 (stmt -> ifstmt .)
+    TIMES           reduce using rule 10 (stmt -> ifstmt .)
+    DIVIDE          reduce using rule 10 (stmt -> ifstmt .)
+    EQ              reduce using rule 10 (stmt -> ifstmt .)
+    NE              reduce using rule 10 (stmt -> ifstmt .)
+    GT              reduce using rule 10 (stmt -> ifstmt .)
+    LT              reduce using rule 10 (stmt -> ifstmt .)
+    GE              reduce using rule 10 (stmt -> ifstmt .)
+    LE              reduce using rule 10 (stmt -> ifstmt .)
+    $end            reduce using rule 10 (stmt -> ifstmt .)
+    RBRACE          reduce using rule 10 (stmt -> ifstmt .)
+
+
+state 8
+
+    (19) vardef -> DEF . ID EQUALS qexpr
+
+    ID              shift and go to state 20
+
+
+state 9
+
+    (39) qexpr -> STRING .
+
+    PLUS            reduce using rule 39 (qexpr -> STRING .)
+    MINUS           reduce using rule 39 (qexpr -> STRING .)
+    TIMES           reduce using rule 39 (qexpr -> STRING .)
+    DIVIDE          reduce using rule 39 (qexpr -> STRING .)
+    EQ              reduce using rule 39 (qexpr -> STRING .)
+    NE              reduce using rule 39 (qexpr -> STRING .)
+    GT              reduce using rule 39 (qexpr -> STRING .)
+    LT              reduce using rule 39 (qexpr -> STRING .)
+    GE              reduce using rule 39 (qexpr -> STRING .)
+    LE              reduce using rule 39 (qexpr -> STRING .)
+    ID              reduce using rule 39 (qexpr -> STRING .)
+    WHILE           reduce using rule 39 (qexpr -> STRING .)
+    FOREACH         reduce using rule 39 (qexpr -> STRING .)
+    IF              reduce using rule 39 (qexpr -> STRING .)
+    DEF             reduce using rule 39 (qexpr -> STRING .)
+    LPAREN          reduce using rule 39 (qexpr -> STRING .)
+    STRING          reduce using rule 39 (qexpr -> STRING .)
+    NUMBER          reduce using rule 39 (qexpr -> STRING .)
+    $end            reduce using rule 39 (qexpr -> STRING .)
+    RBRACE          reduce using rule 39 (qexpr -> STRING .)
+    RPAREN          reduce using rule 39 (qexpr -> STRING .)
+    COLON           reduce using rule 39 (qexpr -> STRING .)
+    COMMA           reduce using rule 39 (qexpr -> STRING .)
+
+
+state 10
+
+    (11) stmt -> vardef .
+
+    ID              reduce using rule 11 (stmt -> vardef .)
+    WHILE           reduce using rule 11 (stmt -> vardef .)
+    FOREACH         reduce using rule 11 (stmt -> vardef .)
+    IF              reduce using rule 11 (stmt -> vardef .)
+    DEF             reduce using rule 11 (stmt -> vardef .)
+    LPAREN          reduce using rule 11 (stmt -> vardef .)
+    STRING          reduce using rule 11 (stmt -> vardef .)
+    NUMBER          reduce using rule 11 (stmt -> vardef .)
+    PLUS            reduce using rule 11 (stmt -> vardef .)
+    MINUS           reduce using rule 11 (stmt -> vardef .)
+    TIMES           reduce using rule 11 (stmt -> vardef .)
+    DIVIDE          reduce using rule 11 (stmt -> vardef .)
+    EQ              reduce using rule 11 (stmt -> vardef .)
+    NE              reduce using rule 11 (stmt -> vardef .)
+    GT              reduce using rule 11 (stmt -> vardef .)
+    LT              reduce using rule 11 (stmt -> vardef .)
+    GE              reduce using rule 11 (stmt -> vardef .)
+    LE              reduce using rule 11 (stmt -> vardef .)
+    $end            reduce using rule 11 (stmt -> vardef .)
+    RBRACE          reduce using rule 11 (stmt -> vardef .)
+
+
+state 11
+
+    (0) S' -> program .
+
+
+
+state 12
+
+    (12) stmt -> qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+  ! shift/reduce conflict for PLUS resolved as shift
+  ! shift/reduce conflict for MINUS resolved as shift
+  ! shift/reduce conflict for TIMES resolved as shift
+  ! shift/reduce conflict for DIVIDE resolved as shift
+  ! shift/reduce conflict for EQ resolved as shift
+  ! shift/reduce conflict for NE resolved as shift
+  ! shift/reduce conflict for GT resolved as shift
+  ! shift/reduce conflict for LT resolved as shift
+  ! shift/reduce conflict for GE resolved as shift
+  ! shift/reduce conflict for LE resolved as shift
+    ID              reduce using rule 12 (stmt -> qexpr .)
+    WHILE           reduce using rule 12 (stmt -> qexpr .)
+    FOREACH         reduce using rule 12 (stmt -> qexpr .)
+    IF              reduce using rule 12 (stmt -> qexpr .)
+    DEF             reduce using rule 12 (stmt -> qexpr .)
+    LPAREN          reduce using rule 12 (stmt -> qexpr .)
+    STRING          reduce using rule 12 (stmt -> qexpr .)
+    NUMBER          reduce using rule 12 (stmt -> qexpr .)
+    $end            reduce using rule 12 (stmt -> qexpr .)
+    RBRACE          reduce using rule 12 (stmt -> qexpr .)
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+  ! PLUS            [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! MINUS           [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! TIMES           [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! DIVIDE          [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! EQ              [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! NE              [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! GT              [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! LT              [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! GE              [ reduce using rule 12 (stmt -> qexpr .) ]
+  ! LE              [ reduce using rule 12 (stmt -> qexpr .) ]
+
+
+state 13
+
+    (4) stmtlist -> stmt . stmtlist
+    (4) stmtlist -> . stmt stmtlist
+    (5) stmtlist -> .
+    (6) stmt -> . funcdef
+    (7) stmt -> . whilestmt
+    (8) stmt -> . foreachstmt
+    (9) stmt -> . ifelsestmt
+    (10) stmt -> . ifstmt
+    (11) stmt -> . vardef
+    (12) stmt -> . qexpr
+    (13) stmt -> .
+    (18) funcdef -> . ID LPAREN argslist RPAREN EQUALS FUNCTION innerblock
+    (14) whilestmt -> . WHILE LPAREN qexpr RPAREN innerblock
+    (15) foreachstmt -> . FOREACH LPAREN qexpr COLON qexpr RPAREN innerblock
+    (16) ifelsestmt -> . IF LPAREN qexpr RPAREN innerblock ELSE innerblock
+    (17) ifstmt -> . IF LPAREN qexpr RPAREN innerblock
+    (19) vardef -> . DEF ID EQUALS qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! reduce/reduce conflict for $end resolved using rule 5 (stmtlist -> .)
+  ! reduce/reduce conflict for RBRACE resolved using rule 5 (stmtlist -> .)
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for WHILE resolved as shift
+  ! shift/reduce conflict for FOREACH resolved as shift
+  ! shift/reduce conflict for IF resolved as shift
+  ! shift/reduce conflict for DEF resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! reduce/reduce conflict for PLUS resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for MINUS resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for TIMES resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for DIVIDE resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for EQ resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for NE resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for GT resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for LT resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for GE resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for LE resolved using rule 13 (stmt -> .)
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for WHILE resolved as shift
+  ! shift/reduce conflict for FOREACH resolved as shift
+  ! shift/reduce conflict for IF resolved as shift
+  ! shift/reduce conflict for DEF resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! reduce/reduce conflict for STRING resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for NUMBER resolved using rule 13 (stmt -> .)
+  ! reduce/reduce conflict for $end resolved using rule 5 (stmtlist -> .)
+  ! reduce/reduce conflict for RBRACE resolved using rule 5 (stmtlist -> .)
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    $end            reduce using rule 5 (stmtlist -> .)
+    RBRACE          reduce using rule 5 (stmtlist -> .)
+    PLUS            reduce using rule 13 (stmt -> .)
+    MINUS           reduce using rule 13 (stmt -> .)
+    TIMES           reduce using rule 13 (stmt -> .)
+    DIVIDE          reduce using rule 13 (stmt -> .)
+    EQ              reduce using rule 13 (stmt -> .)
+    NE              reduce using rule 13 (stmt -> .)
+    GT              reduce using rule 13 (stmt -> .)
+    LT              reduce using rule 13 (stmt -> .)
+    GE              reduce using rule 13 (stmt -> .)
+    LE              reduce using rule 13 (stmt -> .)
+    ID              shift and go to state 17
+    WHILE           shift and go to state 5
+    FOREACH         shift and go to state 14
+    IF              shift and go to state 18
+    DEF             shift and go to state 8
+    LPAREN          shift and go to state 15
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 13 (stmt -> .) ]
+  ! WHILE           [ reduce using rule 13 (stmt -> .) ]
+  ! FOREACH         [ reduce using rule 13 (stmt -> .) ]
+  ! IF              [ reduce using rule 13 (stmt -> .) ]
+  ! DEF             [ reduce using rule 13 (stmt -> .) ]
+  ! LPAREN          [ reduce using rule 13 (stmt -> .) ]
+  ! STRING          [ reduce using rule 13 (stmt -> .) ]
+  ! NUMBER          [ reduce using rule 13 (stmt -> .) ]
+  ! $end            [ reduce using rule 13 (stmt -> .) ]
+  ! RBRACE          [ reduce using rule 13 (stmt -> .) ]
+  ! PLUS            [ reduce using rule 37 (qexpr -> .) ]
+  ! MINUS           [ reduce using rule 37 (qexpr -> .) ]
+  ! TIMES           [ reduce using rule 37 (qexpr -> .) ]
+  ! DIVIDE          [ reduce using rule 37 (qexpr -> .) ]
+  ! EQ              [ reduce using rule 37 (qexpr -> .) ]
+  ! NE              [ reduce using rule 37 (qexpr -> .) ]
+  ! GT              [ reduce using rule 37 (qexpr -> .) ]
+  ! LT              [ reduce using rule 37 (qexpr -> .) ]
+  ! GE              [ reduce using rule 37 (qexpr -> .) ]
+  ! LE              [ reduce using rule 37 (qexpr -> .) ]
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! WHILE           [ reduce using rule 37 (qexpr -> .) ]
+  ! FOREACH         [ reduce using rule 37 (qexpr -> .) ]
+  ! IF              [ reduce using rule 37 (qexpr -> .) ]
+  ! DEF             [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+  ! $end            [ reduce using rule 37 (qexpr -> .) ]
+  ! RBRACE          [ reduce using rule 37 (qexpr -> .) ]
+
+    ifelsestmt                     shift and go to state 1
+    foreachstmt                    shift and go to state 2
+    qexpr                          shift and go to state 12
+    stmt                           shift and go to state 13
+    whilestmt                      shift and go to state 4
+    vardef                         shift and go to state 10
+    stmtlist                       shift and go to state 31
+    funcdef                        shift and go to state 16
+    ifstmt                         shift and go to state 7
+
+state 14
+
+    (15) foreachstmt -> FOREACH . LPAREN qexpr COLON qexpr RPAREN innerblock
+
+    LPAREN          shift and go to state 32
+
+
+state 15
+
+    (36) qexpr -> LPAREN . qexpr RPAREN
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+    qexpr                          shift and go to state 33
+
+state 16
+
+    (6) stmt -> funcdef .
+
+    ID              reduce using rule 6 (stmt -> funcdef .)
+    WHILE           reduce using rule 6 (stmt -> funcdef .)
+    FOREACH         reduce using rule 6 (stmt -> funcdef .)
+    IF              reduce using rule 6 (stmt -> funcdef .)
+    DEF             reduce using rule 6 (stmt -> funcdef .)
+    LPAREN          reduce using rule 6 (stmt -> funcdef .)
+    STRING          reduce using rule 6 (stmt -> funcdef .)
+    NUMBER          reduce using rule 6 (stmt -> funcdef .)
+    PLUS            reduce using rule 6 (stmt -> funcdef .)
+    MINUS           reduce using rule 6 (stmt -> funcdef .)
+    TIMES           reduce using rule 6 (stmt -> funcdef .)
+    DIVIDE          reduce using rule 6 (stmt -> funcdef .)
+    EQ              reduce using rule 6 (stmt -> funcdef .)
+    NE              reduce using rule 6 (stmt -> funcdef .)
+    GT              reduce using rule 6 (stmt -> funcdef .)
+    LT              reduce using rule 6 (stmt -> funcdef .)
+    GE              reduce using rule 6 (stmt -> funcdef .)
+    LE              reduce using rule 6 (stmt -> funcdef .)
+    $end            reduce using rule 6 (stmt -> funcdef .)
+    RBRACE          reduce using rule 6 (stmt -> funcdef .)
+
+
+state 17
+
+    (18) funcdef -> ID . LPAREN argslist RPAREN EQUALS FUNCTION innerblock
+    (20) qexpr -> ID . LPAREN argslist RPAREN
+    (38) qexpr -> ID .
+
+  ! shift/reduce conflict for LPAREN resolved as shift
+    LPAREN          shift and go to state 35
+    PLUS            reduce using rule 38 (qexpr -> ID .)
+    MINUS           reduce using rule 38 (qexpr -> ID .)
+    TIMES           reduce using rule 38 (qexpr -> ID .)
+    DIVIDE          reduce using rule 38 (qexpr -> ID .)
+    EQ              reduce using rule 38 (qexpr -> ID .)
+    NE              reduce using rule 38 (qexpr -> ID .)
+    GT              reduce using rule 38 (qexpr -> ID .)
+    LT              reduce using rule 38 (qexpr -> ID .)
+    GE              reduce using rule 38 (qexpr -> ID .)
+    LE              reduce using rule 38 (qexpr -> ID .)
+    ID              reduce using rule 38 (qexpr -> ID .)
+    WHILE           reduce using rule 38 (qexpr -> ID .)
+    FOREACH         reduce using rule 38 (qexpr -> ID .)
+    IF              reduce using rule 38 (qexpr -> ID .)
+    DEF             reduce using rule 38 (qexpr -> ID .)
+    STRING          reduce using rule 38 (qexpr -> ID .)
+    NUMBER          reduce using rule 38 (qexpr -> ID .)
+    $end            reduce using rule 38 (qexpr -> ID .)
+    RBRACE          reduce using rule 38 (qexpr -> ID .)
+
+  ! LPAREN          [ reduce using rule 38 (qexpr -> ID .) ]
+
+
+state 18
+
+    (16) ifelsestmt -> IF . LPAREN qexpr RPAREN innerblock ELSE innerblock
+    (17) ifstmt -> IF . LPAREN qexpr RPAREN innerblock
+
+    LPAREN          shift and go to state 36
+
+
+state 19
+
+    (14) whilestmt -> WHILE LPAREN . qexpr RPAREN innerblock
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+    qexpr                          shift and go to state 37
+
+state 20
+
+    (19) vardef -> DEF ID . EQUALS qexpr
+
+    EQUALS          shift and go to state 38
+
+
+state 21
+
+    (32) qexpr -> qexpr GT . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 39
+
+state 22
+
+    (34) qexpr -> qexpr GE . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 40
+
+state 23
+
+    (29) qexpr -> qexpr DIVIDE . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 41
+
+state 24
+
+    (28) qexpr -> qexpr TIMES . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 42
+
+state 25
+
+    (33) qexpr -> qexpr LT . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 43
+
+state 26
+
+    (35) qexpr -> qexpr LE . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 44
+
+state 27
+
+    (26) qexpr -> qexpr PLUS . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 45
+
+state 28
+
+    (30) qexpr -> qexpr EQ . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 46
+
+state 29
+
+    (27) qexpr -> qexpr MINUS . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 47
+
+state 30
+
+    (31) qexpr -> qexpr NE . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    COLON           reduce using rule 37 (qexpr -> .)
+    COMMA           reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 48
+
+state 31
+
+    (4) stmtlist -> stmt stmtlist .
+
+    $end            reduce using rule 4 (stmtlist -> stmt stmtlist .)
+    RBRACE          reduce using rule 4 (stmtlist -> stmt stmtlist .)
+
+
+state 32
+
+    (15) foreachstmt -> FOREACH LPAREN . qexpr COLON qexpr RPAREN innerblock
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    COLON           reduce using rule 37 (qexpr -> .)
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+    qexpr                          shift and go to state 49
+
+state 33
+
+    (36) qexpr -> LPAREN qexpr . RPAREN
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+    RPAREN          shift and go to state 50
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+
+state 34
+
+    (20) qexpr -> ID . LPAREN argslist RPAREN
+    (38) qexpr -> ID .
+
+  ! shift/reduce conflict for LPAREN resolved as shift
+    LPAREN          shift and go to state 51
+    PLUS            reduce using rule 38 (qexpr -> ID .)
+    MINUS           reduce using rule 38 (qexpr -> ID .)
+    TIMES           reduce using rule 38 (qexpr -> ID .)
+    DIVIDE          reduce using rule 38 (qexpr -> ID .)
+    EQ              reduce using rule 38 (qexpr -> ID .)
+    NE              reduce using rule 38 (qexpr -> ID .)
+    GT              reduce using rule 38 (qexpr -> ID .)
+    LT              reduce using rule 38 (qexpr -> ID .)
+    GE              reduce using rule 38 (qexpr -> ID .)
+    LE              reduce using rule 38 (qexpr -> ID .)
+    ID              reduce using rule 38 (qexpr -> ID .)
+    WHILE           reduce using rule 38 (qexpr -> ID .)
+    FOREACH         reduce using rule 38 (qexpr -> ID .)
+    IF              reduce using rule 38 (qexpr -> ID .)
+    DEF             reduce using rule 38 (qexpr -> ID .)
+    STRING          reduce using rule 38 (qexpr -> ID .)
+    NUMBER          reduce using rule 38 (qexpr -> ID .)
+    $end            reduce using rule 38 (qexpr -> ID .)
+    RBRACE          reduce using rule 38 (qexpr -> ID .)
+    RPAREN          reduce using rule 38 (qexpr -> ID .)
+    COLON           reduce using rule 38 (qexpr -> ID .)
+    COMMA           reduce using rule 38 (qexpr -> ID .)
+
+  ! LPAREN          [ reduce using rule 38 (qexpr -> ID .) ]
+
+
+state 35
+
+    (18) funcdef -> ID LPAREN . argslist RPAREN EQUALS FUNCTION innerblock
+    (20) qexpr -> ID LPAREN . argslist RPAREN
+    (21) argslist -> . qexpr COMMA argslist
+    (22) argslist -> . innerblock COMMA argslist
+    (23) argslist -> . qexpr
+    (24) argslist -> . innerblock
+    (25) argslist -> .
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+    (2) innerblock -> . LBRACE stmtlist RBRACE
+    (3) innerblock -> . LBRACE RBRACE
+
+  ! reduce/reduce conflict for RPAREN resolved using rule 25 (argslist -> .)
+    RPAREN          reduce using rule 25 (argslist -> .)
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    COMMA           reduce using rule 37 (qexpr -> .)
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+    LBRACE          shift and go to state 54
+
+  ! RPAREN          [ reduce using rule 37 (qexpr -> .) ]
+
+    innerblock                     shift and go to state 52
+    argslist                       shift and go to state 53
+    qexpr                          shift and go to state 55
+
+state 36
+
+    (16) ifelsestmt -> IF LPAREN . qexpr RPAREN innerblock ELSE innerblock
+    (17) ifstmt -> IF LPAREN . qexpr RPAREN innerblock
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    RPAREN          reduce using rule 37 (qexpr -> .)
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+    qexpr                          shift and go to state 56
+
+state 37
+
+    (14) whilestmt -> WHILE LPAREN qexpr . RPAREN innerblock
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+    RPAREN          shift and go to state 57
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+
+state 38
+
+    (19) vardef -> DEF ID EQUALS . qexpr
+    (20) qexpr -> . ID LPAREN argslist RPAREN
+    (26) qexpr -> . qexpr PLUS qexpr
+    (27) qexpr -> . qexpr MINUS qexpr
+    (28) qexpr -> . qexpr TIMES qexpr
+    (29) qexpr -> . qexpr DIVIDE qexpr
+    (30) qexpr -> . qexpr EQ qexpr
+    (31) qexpr -> . qexpr NE qexpr
+    (32) qexpr -> . qexpr GT qexpr
+    (33) qexpr -> . qexpr LT qexpr
+    (34) qexpr -> . qexpr GE qexpr
+    (35) qexpr -> . qexpr LE qexpr
+    (36) qexpr -> . LPAREN qexpr RPAREN
+    (37) qexpr -> .
+    (38) qexpr -> . ID
+    (39) qexpr -> . STRING
+    (40) qexpr -> . NUMBER
+
+  ! shift/reduce conflict for ID resolved as shift
+  ! shift/reduce conflict for LPAREN resolved as shift
+  ! shift/reduce conflict for STRING resolved as shift
+  ! shift/reduce conflict for NUMBER resolved as shift
+    ID              shift and go to state 34
+    LPAREN          shift and go to state 15
+    PLUS            reduce using rule 37 (qexpr -> .)
+    MINUS           reduce using rule 37 (qexpr -> .)
+    TIMES           reduce using rule 37 (qexpr -> .)
+    DIVIDE          reduce using rule 37 (qexpr -> .)
+    EQ              reduce using rule 37 (qexpr -> .)
+    NE              reduce using rule 37 (qexpr -> .)
+    GT              reduce using rule 37 (qexpr -> .)
+    LT              reduce using rule 37 (qexpr -> .)
+    GE              reduce using rule 37 (qexpr -> .)
+    LE              reduce using rule 37 (qexpr -> .)
+    WHILE           reduce using rule 37 (qexpr -> .)
+    FOREACH         reduce using rule 37 (qexpr -> .)
+    IF              reduce using rule 37 (qexpr -> .)
+    DEF             reduce using rule 37 (qexpr -> .)
+    $end            reduce using rule 37 (qexpr -> .)
+    RBRACE          reduce using rule 37 (qexpr -> .)
+    STRING          shift and go to state 9
+    NUMBER          shift and go to state 3
+
+  ! ID              [ reduce using rule 37 (qexpr -> .) ]
+  ! LPAREN          [ reduce using rule 37 (qexpr -> .) ]
+  ! STRING          [ reduce using rule 37 (qexpr -> .) ]
+  ! NUMBER          [ reduce using rule 37 (qexpr -> .) ]
+
+    qexpr                          shift and go to state 58
+
+state 39
+
+    (32) qexpr -> qexpr GT qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+  ! shift/reduce conflict for PLUS resolved as shift
+  ! shift/reduce conflict for MINUS resolved as shift
+  ! shift/reduce conflict for TIMES resolved as shift
+  ! shift/reduce conflict for DIVIDE resolved as shift
+  ! shift/reduce conflict for EQ resolved as shift
+  ! shift/reduce conflict for NE resolved as shift
+  ! shift/reduce conflict for GT resolved as shift
+  ! shift/reduce conflict for LT resolved as shift
+  ! shift/reduce conflict for GE resolved as shift
+  ! shift/reduce conflict for LE resolved as shift
+    ID              reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    WHILE           reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    FOREACH         reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    IF              reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    DEF             reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    LPAREN          reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    STRING          reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    NUMBER          reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    $end            reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    RBRACE          reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    RPAREN          reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    COLON           reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    COMMA           reduce using rule 32 (qexpr -> qexpr GT qexpr .)
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+  ! PLUS            [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! MINUS           [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! TIMES           [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! DIVIDE          [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! EQ              [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! NE              [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! GT              [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! LT              [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! GE              [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+  ! LE              [ reduce using rule 32 (qexpr -> qexpr GT qexpr .) ]
+
+
+state 40
+
+    (34) qexpr -> qexpr GE qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+  ! shift/reduce conflict for PLUS resolved as shift
+  ! shift/reduce conflict for MINUS resolved as shift
+  ! shift/reduce conflict for TIMES resolved as shift
+  ! shift/reduce conflict for DIVIDE resolved as shift
+  ! shift/reduce conflict for EQ resolved as shift
+  ! shift/reduce conflict for NE resolved as shift
+  ! shift/reduce conflict for GT resolved as shift
+  ! shift/reduce conflict for LT resolved as shift
+  ! shift/reduce conflict for GE resolved as shift
+  ! shift/reduce conflict for LE resolved as shift
+    ID              reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    WHILE           reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    FOREACH         reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    IF              reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    DEF             reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    LPAREN          reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    STRING          reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    NUMBER          reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    $end            reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    RBRACE          reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    RPAREN          reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    COLON           reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    COMMA           reduce using rule 34 (qexpr -> qexpr GE qexpr .)
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+  ! PLUS            [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! MINUS           [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! TIMES           [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! DIVIDE          [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! EQ              [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! NE              [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! GT              [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! LT              [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! GE              [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+  ! LE              [ reduce using rule 34 (qexpr -> qexpr GE qexpr .) ]
+
+
+state 41
+
+    (29) qexpr -> qexpr DIVIDE qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+    PLUS            reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    MINUS           reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    TIMES           reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    DIVIDE          reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    EQ              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    NE              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    GT              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    LT              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    GE              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    LE              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    ID              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    WHILE           reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    FOREACH         reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    IF              reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    DEF             reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    LPAREN          reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    STRING          reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    NUMBER          reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    $end            reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    RBRACE          reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    RPAREN          reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    COLON           reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+    COMMA           reduce using rule 29 (qexpr -> qexpr DIVIDE qexpr .)
+
+  ! PLUS            [ shift and go to state 27 ]
+  ! MINUS           [ shift and go to state 29 ]
+  ! TIMES           [ shift and go to state 24 ]
+  ! DIVIDE          [ shift and go to state 23 ]
+  ! EQ              [ shift and go to state 28 ]
+  ! NE              [ shift and go to state 30 ]
+  ! GT              [ shift and go to state 21 ]
+  ! LT              [ shift and go to state 25 ]
+  ! GE              [ shift and go to state 22 ]
+  ! LE              [ shift and go to state 26 ]
+
+
+state 42
+
+    (28) qexpr -> qexpr TIMES qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+    PLUS            reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    MINUS           reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    TIMES           reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    DIVIDE          reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    EQ              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    NE              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    GT              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    LT              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    GE              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    LE              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    ID              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    WHILE           reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    FOREACH         reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    IF              reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    DEF             reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    LPAREN          reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    STRING          reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    NUMBER          reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    $end            reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    RBRACE          reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    RPAREN          reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    COLON           reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+    COMMA           reduce using rule 28 (qexpr -> qexpr TIMES qexpr .)
+
+  ! PLUS            [ shift and go to state 27 ]
+  ! MINUS           [ shift and go to state 29 ]
+  ! TIMES           [ shift and go to state 24 ]
+  ! DIVIDE          [ shift and go to state 23 ]
+  ! EQ              [ shift and go to state 28 ]
+  ! NE              [ shift and go to state 30 ]
+  ! GT              [ shift and go to state 21 ]
+  ! LT              [ shift and go to state 25 ]
+  ! GE              [ shift and go to state 22 ]
+  ! LE              [ shift and go to state 26 ]
+
+
+state 43
+
+    (33) qexpr -> qexpr LT qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+  ! shift/reduce conflict for PLUS resolved as shift
+  ! shift/reduce conflict for MINUS resolved as shift
+  ! shift/reduce conflict for TIMES resolved as shift
+  ! shift/reduce conflict for DIVIDE resolved as shift
+  ! shift/reduce conflict for EQ resolved as shift
+  ! shift/reduce conflict for NE resolved as shift
+  ! shift/reduce conflict for GT resolved as shift
+  ! shift/reduce conflict for LT resolved as shift
+  ! shift/reduce conflict for GE resolved as shift
+  ! shift/reduce conflict for LE resolved as shift
+    ID              reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    WHILE           reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    FOREACH         reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    IF              reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    DEF             reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    LPAREN          reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    STRING          reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    NUMBER          reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    $end            reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    RBRACE          reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    RPAREN          reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    COLON           reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    COMMA           reduce using rule 33 (qexpr -> qexpr LT qexpr .)
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+  ! PLUS            [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! MINUS           [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! TIMES           [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! DIVIDE          [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! EQ              [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! NE              [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! GT              [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! LT              [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! GE              [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+  ! LE              [ reduce using rule 33 (qexpr -> qexpr LT qexpr .) ]
+
+
+state 44
+
+    (35) qexpr -> qexpr LE qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+  ! shift/reduce conflict for PLUS resolved as shift
+  ! shift/reduce conflict for MINUS resolved as shift
+  ! shift/reduce conflict for TIMES resolved as shift
+  ! shift/reduce conflict for DIVIDE resolved as shift
+  ! shift/reduce conflict for EQ resolved as shift
+  ! shift/reduce conflict for NE resolved as shift
+  ! shift/reduce conflict for GT resolved as shift
+  ! shift/reduce conflict for LT resolved as shift
+  ! shift/reduce conflict for GE resolved as shift
+  ! shift/reduce conflict for LE resolved as shift
+    ID              reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    WHILE           reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    FOREACH         reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    IF              reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    DEF             reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    LPAREN          reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    STRING          reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    NUMBER          reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    $end            reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    RBRACE          reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    RPAREN          reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    COLON           reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    COMMA           reduce using rule 35 (qexpr -> qexpr LE qexpr .)
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+  ! PLUS            [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! MINUS           [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! TIMES           [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! DIVIDE          [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! EQ              [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! NE              [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! GT              [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! LT              [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! GE              [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+  ! LE              [ reduce using rule 35 (qexpr -> qexpr LE qexpr .) ]
+
+
+state 45
+
+    (26) qexpr -> qexpr PLUS qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+    PLUS            reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    MINUS           reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    EQ              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    NE              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    GT              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    LT              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    GE              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    LE              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    ID              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    WHILE           reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    FOREACH         reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    IF              reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    DEF             reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    LPAREN          reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    STRING          reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    NUMBER          reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    $end            reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    RBRACE          reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    RPAREN          reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    COLON           reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    COMMA           reduce using rule 26 (qexpr -> qexpr PLUS qexpr .)
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+
+  ! TIMES           [ reduce using rule 26 (qexpr -> qexpr PLUS qexpr .) ]
+  ! DIVIDE          [ reduce using rule 26 (qexpr -> qexpr PLUS qexpr .) ]
+  ! PLUS            [ shift and go to state 27 ]
+  ! MINUS           [ shift and go to state 29 ]
+  ! EQ              [ shift and go to state 28 ]
+  ! NE              [ shift and go to state 30 ]
+  ! GT              [ shift and go to state 21 ]
+  ! LT              [ shift and go to state 25 ]
+  ! GE              [ shift and go to state 22 ]
+  ! LE              [ shift and go to state 26 ]
+
+
+state 46
+
+    (30) qexpr -> qexpr EQ qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+  ! shift/reduce conflict for PLUS resolved as shift
+  ! shift/reduce conflict for MINUS resolved as shift
+  ! shift/reduce conflict for TIMES resolved as shift
+  ! shift/reduce conflict for DIVIDE resolved as shift
+  ! shift/reduce conflict for EQ resolved as shift
+  ! shift/reduce conflict for NE resolved as shift
+  ! shift/reduce conflict for GT resolved as shift
+  ! shift/reduce conflict for LT resolved as shift
+  ! shift/reduce conflict for GE resolved as shift
+  ! shift/reduce conflict for LE resolved as shift
+    ID              reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    WHILE           reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    FOREACH         reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    IF              reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    DEF             reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    LPAREN          reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    STRING          reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    NUMBER          reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    $end            reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    RBRACE          reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    RPAREN          reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    COLON           reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    COMMA           reduce using rule 30 (qexpr -> qexpr EQ qexpr .)
+    PLUS            shift and go to state 27
+    MINUS           shift and go to state 29
+    TIMES           shift and go to state 24
+    DIVIDE          shift and go to state 23
+    EQ              shift and go to state 28
+    NE              shift and go to state 30
+    GT              shift and go to state 21
+    LT              shift and go to state 25
+    GE              shift and go to state 22
+    LE              shift and go to state 26
+
+  ! PLUS            [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! MINUS           [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! TIMES           [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! DIVIDE          [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! EQ              [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! NE              [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! GT              [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! LT              [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! GE              [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+  ! LE              [ reduce using rule 30 (qexpr -> qexpr EQ qexpr .) ]
+
+
+state 47
+
+    (27) qexpr -> qexpr MINUS qexpr .
+    (26) qexpr -> qexpr . PLUS qexpr
+    (27) qexpr -> qexpr . MINUS qexpr
+    (28) qexpr -> qexpr . TIMES qexpr
+    (29) qexpr -> qexpr . DIVIDE qexpr
+    (30) qexpr -> qexpr . EQ qexpr
+    (31) qexpr -> qexpr . NE qexpr
+    (32) qexpr -> qexpr . GT qexpr
+    (33) qexpr -> qexpr . LT qexpr
+    (34) qexpr -> qexpr . GE qexpr
+    (35) qexpr -> qexpr . LE qexpr
+
+    PLUS            reduce using rule 27 (qexpr -> qexpr MINUS qexpr .)
+    MINUS           reduce using rule 27 (qexpr -> qexpr MINUS qexpr .)
+    EQ              reduce using rule 27 (qexpr -> qexpr MINUS qexpr .)
+    NE              reduce using rule 27 (qexpr -> qexpr MINUS qexpr .)
+    GT              reduce using rule 27 (qexpr -> qexpr MINUS qexpr .)
+    LT              reduce using rule 27 (qexpr -> qexpr MINUS qexpr .)