def p_field(p):
 if (len(p) == 7):
  try:
   val = _cast(p[3])(p[6])
  except AssertionError:
   raise ThriftParserError(('Type error for field %s at line %d' % (p[4], p.lineno(4))))
 else:
  val = None
 p[0] = [p[1], p[2], p[3], p[4], val]

def p_field ( p ) : if ( len ( p ) == 7 ) : try : val = _cast ( p [ 3 ] ) ( p [ 6 ] ) except AssertionError : raise ThriftParserError ( ( 'Type error for field %s at line %d' % ( p [ 4 ] , p . lineno ( 4 ) ) ) ) else : val = None p [ 0 ] = [ p [ 1 ] , p [ 2 ] , p [ 3 ] , p [ 4 ] , val ]
field : field_id field_req field_type identifier | field_id field_req field_type identifier = const_value .