bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature tests and %before-header


From: Paolo Bonzini
Subject: Re: feature tests and %before-header
Date: Mon, 16 Oct 2006 19:39:50 +0200
User-agent: Thunderbird 1.5.0.7 (Macintosh/20060909)

The epilogue and %provides are slightly different in that %provides can appear in the definitions or grammar section. In other words, the epilogue is like one big final %provides. Right? This seems ok to me.

%requires and %code-top have no distinction it seems. %requires is the better name, I think.

Agreed.

Unlike C/C++, there are no backward compatibility issues for the Java skeleton. I wonder if you should take the approach of providing one "right" way to do things (the new directives) rather than providing so many synonyms. What do you think? It shouldn't be difficult to disable %{...%} and %code-top for all but C/C++, I think.

Yes, you can do that in m4 code. But I haven't (yet) seen a reason to do so.

This was done just in case somebody did the BYacc/J-ish

%{
  package foo.bar;
%}

I am no Java expert, so correct me if I'm misunderstanding something. In a Java file, you can have only one package directive, right? A code block doesn't seem quite appropriate for that to me. What about %name-prefix as in the C++ skeletons? Or do you already have a purpose for that?

Yes, I have. Usually, packages are used for "bigger" parts of code in Java than namespaces in C++, so I'm using name-prefix to change the class name from YYParser to something else. All the code in a Java parser resides in a single Java class or in its inner classes, so it is quite pointless IMO to reserve a whole package for that.

Besides, supporting %requires or equivalently %code-top or %{...%} is required anyway for the imports.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]