Amir,
On 27 Jun 2014, at 1:12 am, Paul Madden <
pma...@gmail.com> wrote:
> The problem you asked about was due to the fact that Treetop only lets you associate compound rules (not single-terminal rules) with classes.
Not quite. You can only associate new nodes with classes.
When an alternate in a rule calls only one other rule, no new
sequence-node is created (that would have only one element).
Instead, the same node is returned, so you cannot use a class.
> But you can add an empty string terminal to a rule to make it compound, and it will not affect the parse.
This forces a sequence node. It’s better to rewrite your class
as a module and use that instead.
Clifford Heath.