[antlr-interest] ANTLR3 with -Xmultithreaded problem?

文少华 shaohua.wen at gmail.com
Fri Aug 17 08:19:10 PDT 2007


I was so sad that it seems that there is no body want to have a try on my
reported problem?
:(


On 8/16/07, 文少华 <shaohua.wen at gmail.com> wrote:
>
> Dear gurus,
>   I just created a grammar for TNSDL language, and it has a grammar like:
>
>  range://p84
>     closedRange -> ^(Range closedRange)
>     |openRange  -> ^(Range openRange)
> ;
>
> closedRange://p84
>     e1=expression ':' e2=expression
>     -> ^(ClosedRange $e1 $e2)
> ;
>
> openRange://p84
>     relationSymbol? expression
>     -> ^(OpenRange  relationSymbol? expression)
> ;
>
>  expression:
>  .....
> ;
>
>  When I tried to generate code with antlr 3.0.1(3.0 also tried), the
> generated code will not compile with errors like:
>   [javac] Compiling 15 source files to bin
>     [javac] TNSDLParser.java:69328: code too large for try statement
>     [javac]         catch (RecognitionException re) {
>     [javac]         ^
>     [javac]TNSDLParser.java:38965: code too large for try statement
>     [javac]         try {
>     [javac]             ^
>     [javac] TNSDLParser.java:38952: code too large
>     [javac]     public final range_return range() throws
> RecognitionException {
>     [javac]                               ^
>
> After I looked into the range() method,I found that it has about 30000
> lines.
>
> But if I generage java code using antlr with -Xmultithreaded parameter
> with jdk 1.6 in linux (redhat ES4, SOME Times the generated code for
> range() method is only about 300 lines,and the compiler
> can happily compile the generated code.
>
> This is really strange, I don't know if it's a bug of  ANTLR, Can any one
> help to analyze it?
>
> The grammar file has been attached to the mail.
>
> Any suggestions on correct my grammar will be highly appreciated also!
>
> Best Regards,
> Holy
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070817/9b4c03fe/attachment.html 


More information about the antlr-interest mailing list