Related articles |
---|
anything more convenient then bison/yacc? khamenya@mail.ru (2004-07-28) |
Re: anything more convenient then bison/yacc? cfc@shell01.TheWorld.com (Chris F Clark) (2004-08-04) |
Re: anything more convenient then bison/yacc? basile-news@starynkevitch.net (Basile Starynkevitch \[news\]) (2004-08-05) |
Re: anything more convenient then bison/yacc? rich@pennware.com (Richard Pennington) (2004-08-09) |
From: | khamenya@mail.ru (Valery) |
Newsgroups: | comp.compilers |
Date: | 28 Jul 2004 12:08:25 -0400 |
Organization: | http://groups.google.com |
Keywords: | tools, question |
Posted-Date: | 28 Jul 2004 12:08:25 EDT |
Hi all,
I am wondering if there are some newer reliable engines
similar to yacc/bison, but with more syntactic sugar and
wider class of the grammars.
In particular some ideas/notions of regular expression
would be fine. For example, something like:
e? Matches element e in brackets zero or one times
e* Matches element e in brackets zero or more times
e+ Matches element e in brackets one or more times
e{num} Matches element e in brackets num times
e{min, max} Matches element e in brackets at least min times, but
not more than max times
where element e might be a compound elemnt embraced, say,
in brackets if needed.
Absence of this sugar makes the grammar description
less readable.
Consider this short example (BTW it comes from real life):
[example]
Rule: [a [b?a]* b? ]?
[/example]
Would it ever be same readable in bison/yacc grammar? -- hardly.
Indeed let's look into intuitive bison equivalent:
[example]
%%
%term a
%term b
Rule:
| a ba_seq_opt
| a ba_seq_opt b
;
ba_seq_opt:
| ba ba_seq_opt
;
ba: a
| b a
;
[/example]
It is hardly more readable and in addition
brings 2 "artificial" shift/reduce conflicts...
Thus, any testimonials to reliable grammar parser generators
are very appreciated. (Commercial implementatios are
less considered). In particular, recommendations to
free implementations from this list:
http://www.programming-x.com/programming/parser.html
would be very interesting as well.
Best regards,
thank you in advance,
Valery A.Khamenya
Return to the
comp.compilers page.
Search the
comp.compilers archives again.