[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tokens priority

Etienne Gagnon wrote:
> >I know it is possible to use states in order to solve this problem. Is
> >there any other way (except from the obvious:
> > sentence =
> > {case1} litteral name litteral |
> > {case2} litteral litteral litteral;)
> Why not eliminate the unwanted alternative from the grammar after the AST
> has been built?

Well, even if this solution is elegant in its object oriented way of doing,
it is not viable for me. My example was just for illustration purpose, the
real-world problem is much more complex, with tons of various tokens that
would produce tons and tons of multiple case productions. I think I'll have
to either simplify the grammar (and lexically parse the contents of the names
in the analyser) or maybe introduce more states.

Benjamin Ryzman	  "Deliver yesterday, code today, think tomorrow."
Software Engineer, NetPartitioner(TM) design team.
SOLsoft SA, 4bis rue de la Gare, 92300 Levallois-Perret, France.