Hi,

I ran into the problem of the huge specialStateTransition bytecode size when
using many gated semantic predicates in the lexer (in all my lexer rules
actually).  After a google search I found that this is a known issue to
which there are some workarounds, but no real solutions. At first I used the
workaround to manually add local variables for the outer-class references,
but at some point even that no longer worked. Therefore I changed the Java
code generator to create seperate methods for each switch-case. This works
quite well for me, so I wanted to share it with the community. Note that I
only tested this in the lexer, since my parser has no
specialStateTransition-method at the moment. I also added annotations to
suppress the useless warnings in the generated code. A diff-file with these
changes is attached.

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

Attachment: Java.stg.diff
Description: Binary data

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