[antlr-interest] Memory issue with ANTLR

Mark Wright markwright at internode.on.net
Wed Jun 1 06:45:58 PDT 2011


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\Parser\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