On 20 Nov 2008, at 09:05, Andreas Leppert wrote:

I've seen this which stands for a Java Class Declaration:

class_declaration:
modifiers CLASS_TK identifier super interfaces
        { create_class ($1, $3, $4, $5); }
class_body
        {;}
| CLASS_TK identifier super interfaces
        { create_class (0, $2, $3, $4); }
class_body
        {;}
...


I have problems to understand the semantic action {;}. Does it mean "do
nothing" ? Why just not leave it blank?

It depends on how the Java parser is implemented. The C/C++ parsers implement a 'switch' statement, which must have ";", but inserts one, so it isn't needed. Thus, "{}" or nothing works fine. Check if it works in the Java parser (for example, look into the code that Bison writes), and if not, report it to Bug-Bison.

  Hans




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to