[antlr-interest] AST rewrite infinite loop

Bill Andersen andersen at ontologyworks.com
Wed Oct 14 13:15:37 PDT 2009


FYI, all.  The problem described does NOT occur without rewrite = true

On Oct 14, 2009, at 11:20 , Bill Andersen wrote:

> Hi folks
>
> I have this production
>
> assertion
> 	: sentence -> ^(ASSERTION NAME["foo"] sentence)
> 	;
>
> in a tree grammar with rewrite = true.  This is meant to tack a name
> onto the results of parsing a 'sentence'.  Thing is when I parse a
> sample input I get an infinite tree that looks like this
>
> (ASSERTION foo
> 	(ASSERTION foo
> 		(ASSERTION foo
> 			(ASSERTION foo
> 				(ASSERTION foo
> 					....
>
> Thing is that the sentence production does not call assertion,
> otherwise I could understand why my rewrite might get itself reparsed
> or something.
>
> Any idea what's happening here and how to stop it?
>
> 	.bill
>
> Bill Andersen
> Ontology Works, Inc. (www.ontologyworks.com)
> 3600 O'Donnell Street, Suite 600
> Baltimore, MD 21224
> Office: +1.410.675.1201
> Cell: +1.443.858.6444
> Fax: +1.410.675.1204
>
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Bill Andersen
Ontology Works, Inc. (www.ontologyworks.com)
3600 O'Donnell Street, Suite 600
Baltimore, MD 21224
Office: +1.410.675.1201
Cell: +1.443.858.6444
Fax: +1.410.675.1204






More information about the antlr-interest mailing list