Hi Thiel,
> {:mult=>"* "@6, :factor1=>{:ident=>"c"@8}}]}]}
...
> @t.rule(:factor1 => simple(:str)) { ... }
...
> {:ae=>
>
> ["a"@0, {:plus=>"+ "@2, :term1=>["b"@4, {:mult=>"* "@6, :factor1=>"c"@8}]}]}
The fact that :factor1 contains a different value after the transform
means that another rule but the one you show here has applied. The
transformation code is crafted such that you cannot create endless loops
with it - it replaces leaves first, moving up the tree until it reaches
the root. Only once.
So once a rule has applied, no other rules are applied to the result of
the first rule. I am sure that if you were to reapply the same set of
transformation rules to the result you give above, you would trigger
:factor1 => simple(...).
Please give the code samples on something like https://gist.github.com/
next time - They will be easier to work on.
regards,
kaspar