Parsing indented structures (again)

namelessjon jonathan.st... at gmail.com
Wed Oct 3 09:58:01 UTC 2007


Hi Adrian

It works now, so thanks for the solution (and so quickly). :)
I could tell it wasn't being called, since at one point I had printf
statements in amongst the various actions.  I just couldn't think
why.  It hadn't occurred to me that the scanner action was yanking it
away before that point. In hindsight it was a little obvious.

Is it possible to embed an action in another? As in:

'ina:' double_on_line => {term;array[0] = atof(buffer);};

I am assuming not, as I can't find it in the manual. It would just be
a little neater than the if statements I have now in all the actions,
but ...

Thanks,
Jonathan.

On Oct 2, 11:32 pm, Adrian Thurston <thurs... at cs.queensu.ca> wrote:
> I recognize that this situation, where actions fail to execute without
> warning, is not optimal.
>
> -Adrian
>
> Adrian Thurston wrote:
> > Hi Jonathan,
>
> > The problem is that leaving actions embedded in the final state of a
> > scanner pattern action are not executed. In this case it is %term from
> > double that is not executed.
>
> > To solve this lift the term action up into the scanner pattern action.
>
> > -Adrian
>



More information about the ragel-users mailing list