Hi at all,

I have the following rules:

method_declaration
    : method_header method_body  -> ^(METHOD_HEADER method_header)
^(METHOD_BODY method_body)
    ;

method_body:
    ';'!
    | '{'!   statement_list?   '}'!;
    ;

Of course, method_body is executed because it has no question mark.
However, introducing rewrite rules and operators cause a problem. By
using ^(METHOD_BODY method_body), method_body must return a non-empty
value. However, statement_list? is optional and thus may not match at
all. In this case, method_body returns nothing anymore and I get an
RewriteEmpty exception.

How can I solve this problem by only changing rewrite rules?

Regards,
Christian

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

-- 
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