[ragel-users] Parsing indented structures (again)

Adrian Thurston thurs... at cs.queensu.ca
Tue Oct 2 15:36:37 UTC 2007

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.


Jonathan Stott wrote:
> Hi again
> I /almost/ have a working parser for my files now, but it isn't quite
> working yet and I'm not entirely sure why it is happening.
> The problem is that my terminal actions aren't being called, so the
> strings I use atoi and atof on lack trailing zeros (and thus have a
> random length), so parameters later down the file turn out wrong.
> Very wrong if I start parsing file names, I imagine.
> I've attached the code I'm working on to test the parser with, since
> it's quite complicated to explain.  I apologise for how messy it is,
> but the code has been editted quite a lot as I try to make it work...
> The file I'm using to test looks like:
> # File for testing
> x: 100
> currents:
>   ina: 2 # comment here
>   ito: 3
> y: 11
> and the output says that
> x = 100
> ina = 200
> ito = 300
> y = 110
> Regards,
> Jonathan.
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "ragel-users" group.
> To post to this group, send email to ragel-users at googlegroups.com
> To unsubscribe from this group, send email to ragel-users-unsubscribe at googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ragel-users?hl=en
> -~----------~----~----~----~------~----~------~--~---

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20071002/e7544f45/attachment-0001.sig>

More information about the ragel-users mailing list