[antlr-interest] Labels broken?

Gary R. Van Sickle g.r.vansickle at att.net
Wed Feb 11 21:37:53 PST 2009


>From what I can tell from page 170 of the book, this should result in
"^(DECL_SPECS <<list of decl specs>>)":

declaration_specifiers
	: ds+=(   storage_class_specifier
		  |   type_specifier
      |   type_qualifier
      | function_specifier
      | extended_decl_specs
    )+ -> ^(DECL_SPECS $ds+)
	;

With "ANTLR Parser Generator  Version 3.1.2-2008-10-21", it doesn't, in fact
it results in a broken parser (not the tree parser, there isn't one yet).  I
instead get a bunch of this sort of error:

./test/testprog1/test.c(2)  : error 8 : Unexpected token, at offset 12
    near [Index: 6 (Start: 8980854-Stop: 8980870) ='THIS_IS_A_TYPEDEF',
type<39> Line: 2 LinePos:12]
     : syntax not recognized...

Doing "ds=" results in the same problem.  Am I misunderstanding something,
or is this breakage?

-- 
Gary R. Van Sickle



More information about the antlr-interest mailing list