[antlr-interest] urgent problem with stack overflow, please help

Ric Klaren klaren at cs.utwente.nl
Mon Oct 13 08:27:07 PDT 2003


On Thu, Oct 09, 2003 at 11:12:52PM -0000, netminka wrote:
> I am writing a commercial grade translator. The source language
> environment has tools which generate large initialization 
> procedures, I have seen up to 1100 lines. This causes stack overflow.
> We are using C# antlr. Stack overflow happens at about 600 lines.
> This happens in the first stage of parsing, not the tree parser.

You mean antlr itself gives a stack overflow or your generated parser does?
(think the latter, but just want to be sure)

Is it a genuine stack overflow or a stack corruption?

> The other odd thing about this is that the large procedures
> consist of assignment statements, one per line. That's it.
> No big expressions. The overflow is related strictly to the 
> number of lines in a procedure, not the complexity of the 
> expressions or anything else. The stack, as it is related to the
> grammar definition, is not growing with the size of the procedure. 
> I know the grammar rules are closing properly because I have run
> a great deal of code through this translator and I am intimately
> familiar with the parse traces. This makes me think that there
> may be a basic clean-up problem happening here..?

Where does the stack overflow happen? During the running of the parser?
During tree construction? Or ? During deletion of the parser object ? (if
that's something that happens in C# not very familiar with it) ? Try to
track down the thing triggering the overflow.

> Can anyone out there who is using antlr java or C++ comment on
> stack overflow problems for large source.  Is there one
> implementation platform that is better, do they all have this
> problem? Is this a .Net memory management problem? Comments

Very hard to tell what is happening with the amount of information you
give.

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  "I think we better split up."
  "Good idea. We can do more damage that way."
  --- Ghostbusters


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list