[antlr-interest] Possible bug in C# backend

Federico Di Gregorio fog at initd.org
Fri Dec 21 16:25:33 PST 2007


Il giorno sab, 22/12/2007 alle 00.51 +0100, Johannes Luber ha scritto:
> Federico Di Gregorio schrieb:
> > Hi,
> > 
> > using the C# backend and "scope" the generated code can't be compiled
> > because for every rule with a scope the compiler generates code that
> > references rulename_stack but never declares it. Is this enough or there
> > is a formal way to post a bug report?
> > 
> > (Or this is not a bug and I just don't understand scopes?)
> > 
> > federico
> >
> Can you attach a sample grammar exhibiting this behaviour?

Yes, but I don't knwo if this is really a bug. It happens only with an
empty scope. My case was:

statement
scope {
}
	: ^(PREFIX PNAME URIREF) { ParserUtils.SetPrefix($PNAME.Text, $URIREF.Text); }
	| ^(BASE URIREF)         { ParserUtils.SetBase($URIREF.Text);               }
	| ^(STATEMENTS subject
		   (predicateObjectList[$subject.node] { Statements.AddRange($predicateObjectList.stms); })+ )
	;




I know an empty scope probably should not be used (I was debugging and I
just left it there to avoid too much retyping) but I suppose it should
generate right code or fail the code generation not fail during the
compile step.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
  Qu'est ce que la folie? Juste un sentiment de liberté si
   fort qu'on en oublie ce qui nous rattache au monde... -- J. de Loctra



More information about the antlr-interest mailing list