[CODE][C] Parsing strings flexibly/efficiently with Ragel

21 posts / 0 new
Last post
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Prior to reading this tutorial I had not heard of Ragel before.

For our hardware I needed to implement a telnet and web interface for configuration and status read-out. Both of course require some form of parser. I had started writing my own but soon came to the point where things started to get real ugly.

I spent half a day playing with Ragel and reading its manual and I must say, it's fantastic! It made implementing both the web server and the telnet interface a snap without using much memory!

Highly recommended.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

*BIG THANKS*

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks to the recommendation, I have discovered Ragel and reimplemented my hand-coded FSM code on my ATMEGA 32. Much easier! Cheers cell phone spyware Clarkson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very helpful, thank you!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very interesting. The weekend just got another activity on its tentative schedule! Although I have just skimmed the firt two part it seems to be well written!

Quote:
I should say - the graph of the final state machine (large file - ~200K ) is http://goddard.net.nz/~tim/files/tut01/figure_ops.gif


I get a 404 for both of those...

EDIT: Doh! I didn't even notice that the tutorials are several years old. I thought I browsed the Tutorials often enough to know what is here, but here I failed miserably.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I get a 404 for both of those...

That's what happens when people host tutorials off-site. I suppose it was 3 years ago and I suppose no one would have noticed if Galina had not just resurrected the thread.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://github.com/pruby
http://www.goddard.net.nz/

This is why ALL tutorials should be hosted in their entirety on AVR FREAKS.

He does not mention Ragel on his website.

Rick

I emailed him.

His reply.

Quote:
Thanks for pointing out. Files missing from new server - will look in backups when get home.

Cheers,

Tim

Sent from my phone

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for email Rick - images have been restored. What's the best way to store images on avrfreaks for use in tutorials like this? If can be stored and served as images like that, would be happy to edit posts to load from there.

Cheers,

Tim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

What's the best way to store images on avrfreaks for use in tutorials like this?

Here's a bit of a trick.

Go to the private messages section (for example click the "you have no new messages" link above). Send a PM to yourself, when in the message editor use "Attachement" to add up to 3 images to the post. Once sent open the PM you just got and highlight each picture in turn and "Copy Image Location". Over where you want to embed the pictures (Freaks in a second tab) past each URL in turn, highlight it and click the [IMG] button. Eh voila!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Clawson, that sounds like a very cool trick. I would never had come up with it myself. Thanks for sharing

Pages