legsem / legstar-cob2xsd

Automatically exported from code.google.com/p/legstar-cob2xsd
Other
3 stars 2 forks source link

Google App Engine fails with empty Lexer methods #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The cob2xsd Lexer currently uses fragments that don't define any match such 
as:
fragment DECIMAL_POINT             :;

The reason is that we need to dynamically assign types to Tokens in order 
to get a richer set of tokens than the straight Antlr lexer rules can get 
us. Technically, these should be defined as Tokens not as fragments but 
unfortunately Antlr Lexers do not support the tokens keyword.

These empty Lexer rules work fine from an Antlr standpoint but Google App 
Engine does not like the corresponding Java code which looks something 
like:
    // $ANTLR start "DECIMAL_POINT"
    public final void mDECIMAL_POINT() throws RecognitionException {
        try {
            // com\\legstar\\cobol\\CobolStructureLexer.g:421:36: ()
            // com\\legstar\\cobol\\CobolStructureLexer.g:421:37: 
            {
            }

        }
        finally {
        }
    }
Google App Engine does code injection at the byte code level and chokes on 
such code.
Despite reporting what looks like a bug in GAE we never got a response. We 
probably need to find our own workaround.

Original issue reported on code.google.com by fady.mou...@gmail.com on 14 Feb 2010 at 7:06

GoogleCodeExporter commented 9 years ago
Actually, Lexer grammars support tokens. So I removed all fragments with no 
rules which fixed the problem.

Original comment by fady.mou...@gmail.com on 24 Jul 2010 at 8:28

GoogleCodeExporter commented 9 years ago

Original comment by fady.mou...@gmail.com on 24 Jul 2010 at 10:01

GoogleCodeExporter commented 9 years ago

Original comment by fady.mou...@gmail.com on 24 Jul 2010 at 10:04