Parsing indented structures (again)

Jonathan Stott jonathan.st... at gmail.com
Mon Oct 1 11:48:04 UTC 2007


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: double.rl
Type: application/octet-stream
Size: 4610 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel/attachments/20071001/c4a10e46/attachment.obj>


More information about the ragel-users mailing list