[ragel-users] First time Ragel user...named parameters/help parsing.

Samuel Winchenbach swinchen at gmail.com
Fri Aug 26 13:54:02 UTC 2011


Hi all,

I am trying to create an application that takes a command such as:
#SET,1,57600,8,N,1\n

The problem is, I don't now to cleanly extract each parameter.   In
regular expressions you can use named groups.  I don't see anything
similar in Ragel.   Below is my first attempt.  As you can see it kind
of works, I would just need to do a little manual processing inside
each action.   It seems like the way I am doing it here there is very
little advantage over strtok.    I have tried searching for a solution
to this, but I don't think I came up with very good search terms.
Any help you could offer would be greatly appreciated.

- Sam

http://dumpz.org/79505/

Output:
#SET,1,57600,8,N,1    <--- this is my input
1,57600,8,N,1
57600,8,N,1
8,N,1
N,1
1
Do sweet uC stuff here

_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users



More information about the ragel-users mailing list