anchor.diff:      # one expression, get the result, enter another expression, etc.)
       while 1:
           try: s = raw_input('>>> ')
  -	except EOFError: break
  -        if not strip(s): break
  -        parse('goal', s)
  +        except EOFError: break
  +        if not s.strip(): break
  +        print '=', parse('goal', s)
       print 'Bye.'
   
  
positive.code: # This calculator supports the usual (numbers, add, subtract,
  # multiply, divide), global variables (stored in a global variable in
  # Python), and local variables (stored in an attribute passed around
  # in the grammar).
  
  
  globalvars = {}       # We will store the calculator's variables here
  
  def lookup(map, name):
      for x,v in map:  
          if x == name: return v
      if not globalvars.has_key(name): print 'Undefined (defaulting to 0):', name
      return globalvars.get(name, 0)
  
  %%
  
negative.code:     token VAR: "[a-zA-Z_]+"
  
      # Each line can either be an expression or an assignment statement
      rule goal:   expr<<[]>> END            {{ return expr }}
                 | "set" VAR expr<<[]>> END  {{ globalvars[VAR] = expr }}
                                             {{ return expr }}
  
      # An expression is the sum and difference of factors
  