def p_program(p):
 if ((len(p) == 2) and p[1]):
  p[0] = {}
  (line, stat) = p[1]
  p[0][line] = stat
 elif (len(p) == 3):
  p[0] = p[1]
  if (not p[0]):
   p[0] = {}
  if p[2]:
   (line, stat) = p[2]
   p[0][line] = stat

def p_program ( p ) : if ( ( len ( p ) == 2 ) and p [ 1 ] ) : p [ 0 ] = { } ( line , stat ) = p [ 1 ] p [ 0 ] [ line ] = stat elif ( len ( p ) == 3 ) : p [ 0 ] = p [ 1 ] if ( not p [ 0 ] ) : p [ 0 ] = { } if p [ 2 ] : ( line , stat ) = p [ 2 ] p [ 0 ] [ line ] = stat
program : program statement | statement .