[ragel-users] First time Ragel user...named parameters/help parsing.
thurston at complang.org
thurston at complang.org
Fri Aug 26 18:26:12 UTC 2011
Yes, that's the right idea. With Ragel you use actions to collect/print data. If you have all the data in a single buffer you can collect using pointers. Otherwise, use buffers.
------Original Message------
From: Samuel Winchenbach
Sender: ragel-users-bounces at complang.org
To: ragel-users at complang.org
ReplyTo: ragel-users at complang.org
Subject: [ragel-users] First time Ragel user...named parameters/help parsing.
Sent: Aug 26, 2011 6:54 AM
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
_______________________________________________
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