Hello

I have followed the ANTLR FAQ at 
http://www.antlr.org/wiki/pages/viewpage.action?pageId=1760 ("How can I build 
parse trees not ASTs?") to build a parse tree.

I am using Visual Studio 2008 on Windows 7 32-bit with the C# ANTLR target and 
ANTLR version 3.1.3. Building AST trees works fine.

Now I have the problem that every parse tree ends with an '<epsilon>' at the 
first 'fork node', i.e. the first node where the tree splits up. For example, 
in the following parse tree (as seen in the ANTLRWorks debugger)

  base
    |
  node1
    |
  node2
 ___|__________
 |     |      |
 n3    n4     n5

the ParseTreeBuilder builds the following tree:

  <base>
    |
  <node1>
    |
  <node2>
    |
  <epsilon>

In AST trees, I don't have this '<epsilon>'.

I have this behavior regardless of whether I am using very simple grammars or 
complex, well-tested grammars like the C# grammar from 
http://antlrcsharp.codeplex.com. The problem is at the ParseTreeBuilder, since 
AST trees work well. Also, ANTLRWorks has no problems building a parse tree 
without those '<epsilon>'s.

What am I doing wrong? Thank you for any hints!

Jacob


-- 
GMX.ch - Schweizer FreeMail-Dienst mit über 800.000 Mitgliedern
E-Mail & mehr! Kostenlos: http://portal.gmx.net/de/go/chfreemail

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to