Hello!

I write Verilog HDL grammar.
I referred http://www.externsoft.ch/download/verilog.html .
I debugging this grammar.
But,primary does not select suitable alternative.
Antlrworks emit NoViableAltException(0...@[null]).

Input Text:

module adder4(in_data1, in_data2, out_data, cy);
   input  [3:0] in_data1, in_data2;
   output [3:0] out_data;
   output       cy;

   wire   [4:0] rslt;

   assign rslt     = in_data1 + in_data2;
   assign cy       = rslt[4];
   assign out_data = rslt[3:0];

endmodule

Red letter is emitted at [4] in rslt[4] and at [3:0] in rslt[3:0}.

Syntax primary,below,

primary :  number
| identifier
| identifier'[' expression ']'
| identifier'[' msb_constant_expression ':' lsb_constant_expression ']'
| concatenation
| multiple_concatenation
| function_call
| '(' mintypmax_expression ')'
;

I want to select "identifier'['expression']'" or "identifier'[' msb_constant_expression ':' lsb_constant_expression ']'".
But Antlrworks select "identifier".

I will attach my Verilog HDL grammar file.
Start Symbol (source_text).
I don't know what to do.
Help me please.

Thanks.
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Attachment: veriloghdl2.g
Description: Binary data

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to