[antlr-interest] nesting level problem with Visual C++ 7.0 (Visual Studio .NET)
Ric Klaren
klaren at cs.utwente.nl
Wed Jun 19 01:41:49 PDT 2002
On Tue, Jun 18, 2002 at 04:40:17PM -0000, alanpfranks wrote:
> I am developing a parser for an XML/SGML variant with a
> large number of tag types. This has resulted in a
> deeply nested MyLexer::nextToken() function. In fact,
> the nesting levels are so deep that Visual C++ 7.0
> produces the following error:
>
> c:\dev\MyLexer.cpp(539): fatal error C1061: compiler limit : blocks
> nested too deeply
>
> I'm using Antlr 2.7.1, and generating C++ (obviously).
> Anyone have any ideas how I could fix/workaround this,
> without massaging the C++ code that Antlr produces?
1) There may be a compiler option?
2) Are you using the literals table e.g. did you put your tags in the
tokens section and have a rule with testLiterals = true ?
3) You could move some stuff into protected rules that should also reduce a
bit in depth (I think)
Of course 2 & 3 depend a bit on your grammar and what you are exaclty doing.
HTH
Ric
--
-----+++++*****************************************************+++++++++-------
---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722 ----
-----+++++*****************************************************+++++++++-------
Wit is cultured insolence. --- Aristotle
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list