[antlr-interest] Lean runtime jar

Joan Pujol joanpujol at gmail.com
Sat Feb 5 11:14:54 PST 2005


If you use IDEs like JBuilder you can configure to generate an
outputjar optimitzed removing the classes that are not used.
Also you can use tools like Proguard that's an ofuscator/optimizer
that does this job.
But you have to be careful because ANTLR use reflection in some
places, and that tools don't manage well reflection.

Cheers,


On Thu, 3 Feb 2005 12:46:31 -0500, Jim O'Connor
<Jim.O'Connor at microfocus.com> wrote:
> Hi Chris and Jeremy,
>   I have an application with about 10 parsers/lexers.  The list of the
> directly referenced classes is below.  Let me know if that helps.
> Jim
> 
> Antlr Package
>    ANTLRException
>    ANTLRHashString
>    ANTLRStringBuffer
>    ASTFactory
>    ASTPair
>    BaseAST
>    ByteBuffer
>    CharBuffer
>    CharScanner
>    CharStreamException
>    CharStreamIOException
>    CommonAST
>    CommonToken
>    DumpASTVisitor
>    InputBuffer
>    LLkParser
>    LexerSharedInputState
>    MismatchedCharException
>    MismatchedTokenException
>    NoViableAltException
>    NoViableAltForCharException
>    Parser
>    ParserSharedInputState
>    RecognitionException
>    SemanticException
>    Token
>    TokenBuffer
>    TokenStream
>    TokenStreamException
>    TokenStreamIOException
>    TokenStreamRecognitionException
>    TokenStreamSelector
>    TreeParser
> 
> Antlr.collections Package
>    AST
> Antlr.collections
> 
>    ASTArray
>    BitSet
> 
> 
> > -----Original Message-----
> > From: Christopher Schultz [mailto:christopher.d.schultz at comcast.net]
> > Sent: Thursday, February 03, 2005 12:26 PM
> > To: Jeremy Rayner
> > Cc: antlr-interest at antlr.org
> > Subject: Re: [antlr-interest] Lean runtime jar
> >
> > Jeremy,
> >
> > >   Is there a leaner runtime jar than the 400k antlr-2.7.5.jar on the
> > > download page?
> > > A well known subset of classes?  I know that LLkParser.class etc are
> > needed for
> > > runtime execution of an antlr generated parser, but I'd imagine some of
> > the
> > > code generation classes don't need to be distributed with the runtime.
> > >
> > > Should I begin a quick 'java -verbose' style analysis, or has someone
> > > on this list
> > > already assembled a lean runtime jar.
> >
> > I would be interested in the same thing. I'd like to use an
> > ANTLR-generated parser in production and have a somewhat smaller li
> > directory.
> >
> > Let me know what your list of required classes comes out to be.
> >
> > -chris
> 


-- 
Joan Jesús Pujol Espinar


More information about the antlr-interest mailing list