[antlr-interest] Re: Why no children in tree generated by C++ parser?

Maurice van der Pot griffon26 at kfk4ever.com
Mon Oct 11 11:03:30 PDT 2004


On Mon, Oct 11, 2004 at 12:05:52PM +0100, David Wigg wrote:
> 
> I assume the recent correspondence on this list refers to our 
> version 3.0 dated 1 July 2004.

That's correct.

> I was glad to hear that you have been able to run it 
> successfully. However, if you find any problems with it please 
> let me know.

I did make one little change to make it accept preprocessed output
from gcc:

--- ../CPP_parser.g     2004-09-18 01:16:50.251916096 +0200
+++ CPP_parser.g        2004-09-19 16:59:17.328629528 +0200
@@ -2107,7 +2107,7 @@
		(Space)+
		n:Decimal
		(Space)+
-		(sl:StringLiteral)?
+		(sl:StringLiteral (' ' Decimal)* )?
		{
		process_line_directive((sl->getText()).data(), (n->getText()).data());  // see main()
		}

I only ran it on a few rather small source files so far, but that
will change once I move from using ANTLR and building ASTs to 
using these trees to do something useful.

> I would very much like to offer tree parser output, but I do not 
> have sufficient spare time at present. If anyone would like to 
> co-operate with me to modify the parser to produce a suitable 
> AST from this parser then I would be pleased to help.

I'm going to play a little with the grammar annotations for tree
construction. As I said, I'm new to this, so I'm not sure how easy
that will be.

Regards,
Maurice.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20041011/456199e4/attachment.bin


More information about the antlr-interest mailing list