[antlr-interest] how to create a list of ast nodes correctly?

v r soth1985 at yahoo.com
Sat Nov 24 18:26:57 PST 2007


Hi, i`m building an ast and have a problem with the following rule:
   
  array_declarator_suffix
 : (LEFT_BRACKET constant_expression? RIGHT_BRACKET)+ -> ^(ARRAY_DIM constant_expression?)+
   
  which is meant to define multidimensional arrays.
  antlr says:
  [05:23:20] E:\Engine\EngineSVN\Engine\trunk\antlr\GLSL\GLSLastParser.java:9808: illegal start of expression
[05:23:20]                 if ( !() ) {
[05:23:20]                        ^
[05:23:20] E:\Engine\EngineSVN\Engine\trunk\antlr\GLSL\GLSLastParser.java:9811: illegal start of expression
[05:23:20]                 while (  ) {
[05:23:20]                          ^
[05:23:20] 2 errors
   
  but if i write constant_expression instead of constant_expression? everything is ok.
   
   

       
---------------------------------

Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071125/979840ee/attachment.html 


More information about the antlr-interest mailing list