0

Ragel is very easy. But how I can write my own error function?

I use loop: main := |* *|;

and if i get other data I need run my action? and how put error when my token is good gramar but not good good in semantic.

Eliasz Łukasz
  • 478
  • 1
  • 3
  • 17
  • I never heart about Ragel before - sounds really interesting. Googled "Ragel" and found [Ragel State Machine Compiler - User Guide](http://www.colm.net/files/ragel/ragel-guide-6.9.pdf) Chapter 3.2.3 is "Handling Errors". If you already read this you should state this in your question. Otherwise you will get angry feedback... – Scheff's Cat Mar 02 '17 at 19:29
  • Semantical analysis is usually not part of the syntax description (grammar rules) but part of the associated actions (which you probably intend to write in C). There might be exceptions: e.g. operator precedence can be checked in actions but can even be expressed by the grammar rules itself. – Scheff's Cat Mar 02 '17 at 19:31
  • @Scheff question is how implement error, give up if question is good – Eliasz Łukasz Mar 02 '17 at 20:55

0 Answers0