[antlr-interest] how to solve 'code too large' problem?
Randall R Schulz
rschulz at sonic.net
Fri Jul 13 09:18:00 PDT 2007
On Friday 13 July 2007 09:10, chintan wrote:
> Hi,
> I had this problem too.I had an unnecessary large 'k'. I decreased it
> from 5 to 3. It solved my problem.
But the diagnostic he showed relates to the lexical analyzer, not the
parser. If I understand correctly, the 'k' value pertains only to
parsers.
> ...
Randall Schulz
> On Fri, 2007-07-13 at 16:36 +0200, Chaudhari, Pranita, OPEE14 wrote:
> > Hello,
> >
> > I am using Antlr V3 for writing grammar to parse UML Model
> > (exported to XMI).For that I created individual token for each UML
> > element, now the number of tokens are more than 150 and it creates
> > large lexer java file. And java compiler throws following error:
> >
> > xmiLexerLexer.java:7488: code too large
> > public void mTokens( ) throws
> > RecognitionException{
> >
> > Is it possible to split the Lexer grammar file in to two and
> > import tokens from both files into Parser grammar file?
> >
> > I also want to apply 'UML model design rules' on the parsed data
> > and check whether the model is according to design rules or not.
> > How can I write Antlr grammar for this in separate grammar file
> > and apply it to parsed XMI data.
> >
> > Design rules can be like:
> > - Class names should start with a capital letter.
> >
> >
> > -Thanks
> > Pranita
More information about the antlr-interest
mailing list