def p_field(self, p):
has_annotations = len(p) > <NUM_LIT:5> and p[<NUM_LIT:6>] is not None<EOL>has_docstring = len(p) > <NUM_LIT:5> and p[<NUM_LIT:7>] is not None<EOL>has_anony_def = len(p) > <NUM_LIT:5> and p[<NUM_LIT:8>] is not None<EOL>p[<NUM_LIT:0>] = AstField(<EOL>self.path, p.lineno(<NUM_LIT:1>), p.lexpos(<NUM_LIT:1>), p[<NUM_LIT:1>], p[<NUM_LIT:2>])<EOL>if p[<NUM_LIT:3>] is not None:<EOL><INDENT>if p[<NUM_LIT:3>] is NullToken:<EOL><INDENT>p[<NUM_LIT:0>].set_default(None)<EOL><DEDENT>else:<EOL><INDENT>p[<NUM_LIT:0>].set_default(p[<NUM_LIT:3>])<EOL><DEDENT><DEDENT>if has_annotations:<EOL><INDENT>p[<NUM_LIT:0>].set_annotations(p[<NUM_LIT:6>])<EOL><DEDENT>if has_docstring:<EOL><INDENT>p[<NUM_LIT:0>].set_doc(p[<NUM_LIT:7>])<EOL><DEDENT>if has_anony_def:<EOL><INDENT>p[<NUM_LIT:8>].name = p[<NUM_LIT:2>].name<EOL>self.anony_defs.append(p[<NUM_LIT:8>])<EOL><DEDENT>
field : ID type_ref default_option NL \
                    INDENT annotation_ref_list docsection anony_def_option DEDENT
                 | ID type_ref default_option NL