Reported by deadsea on 2002-02-05 21:44 UTC
I would like to have more control over the interface
that the generated class has. This would involve
controlling the access modifiers on functions and the
I would like to be able to make all the variables and
methods private. I would like to be able to provide a
javadoc comment for the class. (you used to be able to
do this by putting it after any import statements, but
now jflex inserts its own there). If everything were
private and a javadoc comment could be added, I could
use jflex generated files without a wrapper.
I suggest the following:
%internalprivate /* makes all methods and class
variables private /
replacement for the
at the head of the generated java file
With those two directives I would be happy.
It might be worth considering making the access
modifier and a javadoc comment for each
function/variabl be able to be set individually.
Maybe also a way to set a javadoc comment for each
lexical state, perhaps copy any comment that preceeds
the definition of the lexical state into the generated
The text was updated successfully, but these errors were encountered:
Commented by lsf37 on 2002-02-10 16:17 UTC
Logged In: YES
I can do the %classcomment thing easily enough, but the
access modifiers are a bit more difficult.
Surely, you do not mean to make strictly everything
private? You wouldn't be able to use the scanner otherwise
(you couldn't even instantiate it if the constructor was
private). It could only work in standalone mode.
I'll have to check, but maybe one can just modify the
skeleton file for stricter access modifiers. This would be
relatively simple to maintain, since it only involves a
simple string replacement.
Setting access modifiers individually in the spec is not
really workable with the current implementation (it would
mean to move everything out of the skeleton file and into
the generator, which makes modifications much harder).
javadoc comments for lexical states might work, but I
don't want to promise anything on that one yet.
Commented by deadsea on 2002-02-11 13:26 UTC
Logged In: YES
If everything were private then you could provide public
methods for just what you are interested in:
where nextToken() would be the private method generated by
JFlex. (Thus allowing you to still use the lexer)
The only thing for which this would not work would be the
constructors which I suppose would have to be public in any
I really would like to have a %private directive that would
make everything except the constructors private.