mstoilov / rpatk

The Regular Pattern Analyzer Library (RPA) is a top-down recursive parser and pattern matching engine. This is mirror of git://git.rpatk.net/git/rpatk.git
http://www.rpatk.net
Other
7 stars 3 forks source link

Gathering parser failed information #1

Open ikskuh opened 8 years ago

ikskuh commented 8 years ago

Hey!

I'm currently writing a compiler with rpatk and i'm in the need of some more detailed information on where the parsing of a file failed.

Is there any way to get this information? Couldn't find anything in the docs...

Regards Felix

mstoilov commented 8 years ago

Did you check the documentation at http://rpatk.net/rpatk/doc/doxygen/rpadoc/html/rpa_bnf.html

Also, if you send me the file you are trying to compile I can probably help.

Regards, -Martin

ikskuh commented 8 years ago

It's not the syntax that does not compile but the file i'm parsing with the syntax.

Right now i have only the possibility to get a "success with results" or a "failure without errors" from rpa_stat_parse.

And i'm wondering if there is an option to get the position where the parsing failure happend in my source.

mstoilov commented 8 years ago

Is it possible to take a look at both the file you are trying to parse and the parsing rules? So, if rpa_stat_parse returned 0, this means what you are trying to parse doesn't conform to the rules you provided. You can still examine the records array and see how far it went and what it was able to parse before it bailed out.

ikskuh commented 8 years ago

Ah nice! I'll try that and if it fails, i'll give some more input. Just to be notet: The library is awesome ;)