[antlr-interest] Problem with "C" code generation on tree parser

Ramon Verbruggen Ramon.Verbruggen at quintiq.com
Thu Dec 13 01:08:54 PST 2007


Harmon,

I'm happily using ANTLR 3.0.1 with the C runtime and Visual Studio
2005, the options in my grammar look like this:

options 
{
	output=AST;

	//For debugging with ANTLRWorks, comment out the following two
lines:
	language=C;
	ASTLabelType=pANTLR3_BASE_TREE; // <==== I think this is your
problem
}

My grammar is not a tree grammar though if I understand the terminology
correctly: it just takes text as input and produces an AST as output. If
I am not mistaken a tree grammar in ANTLR is a grammar that operates on
a tree, i.e. takes a tree as input.

> Since C++ code generation is not available for 3.0.1, I'm trying to
> interface to the "C"-generated code.
> 
>
> The options in the ".g" file are:
>
>options {
>
>  language=C;
>
>  output=AST;
>
>  tokenVocab=MatLab;
>
>  ASTLabelType=CommonTree;
>
>}
>
I hope this helps,

Ramon
 


This message contains information that may be privileged or confidential
and is the property of Quintiq. It is only intended for the person to
whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute or use
this message or any part thereof. If you have received this message in
error, please notify the sender immediately and delete all copies of
this message. Please note that e-mails are susceptible to change,
therefore they are not binding.


More information about the antlr-interest mailing list