[antlr-interest] missing attribute access with c runtime

Carter Cheng carter_cheng at yahoo.com
Wed Jul 1 02:17:32 PDT 2009


Hi,

I have been trying to build a compiler with the c runtime (an old project which I am relooking at) but I could not get ANTLR 3.1.3 to accept the following rules:

formals returns [std::vector< std::pair<Type*, Symbol> > v]
	: f0=formal { v.push_back($f0.var); } (COMMA f1=formal { v.push_back($f1); } )*

formal returns [std::pair<Type*, Symbol> p]
	: type Ident {p.first = $type; p.second = (char*)$Ident.text->chars; }

What is the correct attribute to access the return value?

Thanks in advance.


      


More information about the antlr-interest mailing list