Parsing for Verilog-2005 port declarations.
Here is the grammar we're implementing.
port_declaration ::= {attribute_instance} inout_declaration | {attribute_instance} input_declaration | {attribute_instance} output_declaration inout_declaration ::= 'inout' [net_type] ['signed'] [range] list_of_port_identifiers input_declaration ::= 'input' [net_type] ['signed'] [range] list_of_port_identifiers output_declaration ::= 'output' [net_type] ['signed'] [range] list_of_port_identifiers | 'output' 'reg' ['signed'] [range] list_of_variable_port_identifiers | 'output' output_variable_type list_of_variable_port_identifiers net_type ::= 'supply0' | 'supply1' | 'tri' | 'triand' | 'trior' | 'tri0' | 'tri1' | 'uwire' | 'wire' | 'wand' | 'wor' list_of_port_identifiers ::= identifier { ',' identifier } list_of_variable_port_identifiers ::= identifier ['=' expression] { ',' identifier [ '=' expression ] } output_variable_type ::= 'integer' | 'time' list_of_port_declarations ::= '(' port_declaration { ',' port_declaration } ')' | '(' ')'