[antlr-interest] Memory issue with ANTLR

Jayani Withanawasam jayaniw at ecollege.com
Thu Jun 2 21:57:12 PDT 2011


Thanks Mark,

I could resolve this after increasing the max heap size of the JVM using
the following command:
java -Xmx750M -cp "c:\antlr\antlr-3.1.3.jar" org.antlr.Tool
-Xconversiontimeout 30000 *.g

I have not build the grammer files correctly and that is why I got
reference issues.

Regards,
Jayani.


-----Original Message-----
From: Mark Wright [mailto:markwright at internode.on.net] 
Sent: Wednesday, June 01, 2011 7:16 PM
To: Jayani Withanawasam; antlr-interest at antlr.org
Subject: RE: [antlr-interest] Memory issue with ANTLR

On Wed, 1 Jun 2011 18:43:31 +0530, Jayani Withanawasam
<jayaniw at ecollege.com> wrote:
> Thanks Mark,
> 
> If I do not increase the max heap size, I will not get the reference
> issues.
> So, as you have mentioned, this can be something to do with the C#
ANTLR
> runtime and grammar files.
> 
> I tried the command you sent also.(To increase heap size) But still I
> get the same error.
> 
> Regards,
> Jayani.

Hi Jayani,

Right so you still get this error:
 
> > When I applied this I get namespace/ reference issues related to
grammar files.
> 
> > Ex: 
> 
> > The type or namespace name 'IAstRuleReturnScope' could not be found
(are
> > you missing a using directive or an assembly reference?)
> >
>
D:\Jay_CC\P4\user\brettp\SQLStandardsChecker\Ecollege\CodeStandards\Pars
er\tsql_tsqlcursors.cs  875                69           Parser

IAstRuleReturnScope sounds like it might be something in your
code, or in the C# code that was generated by the antlr tool
from the .g files, or maybe something in the C# antlr runtime.

You could try:

- checking the C# files generated from the antlr tool are linked into
the
  application
- searching for IAstRuleReturnScope in the generated C# files, and in
the .g
  files
- searching for IAstRuleReturnScope in the C# runtime
- searching for IAstRuleReturnScope in the string template files (.stg)
for
  the C# runtime in the antlr tool source code

Actually its in there, maybe that gives some more hints:

% grep IAstRuleReturnScope **/*.stg
tool/src/main/resources/org/antlr/codegen/templates/CSharp2/AST.stg:,
IAstRuleReturnScope\<<ASTLabelType>\>
tool/src/main/resources/org/antlr/codegen/templates/CSharp3/AST.stg:,
IAstRuleReturnScope\<<ASTLabelType>\>
tool/target/classes/org/antlr/codegen/templates/CSharp2/AST.stg:,
IAstRuleReturnScope\<<ASTLabelType>\>
tool/target/classes/org/antlr/codegen/templates/CSharp3/AST.stg:,
IAstRuleReturnScope\<<ASTLabelType>\>
% 

Regards, Mark


More information about the antlr-interest mailing list