Lex/Yacc Alternatives for Developing Grammars

  • Thread starter Solkar
  • Start date
In summary, The speaker discusses their annual task of developing a grammar and parser, and their preference for using plain lex/yacc despite considering alternatives such as antlr4 and antlr3. They also mention their ability to call in a CORBA-Server from multiple languages and list other potential options such as SableCC, Parse::EBNF, Parse::Yapp, Marpa, and SimpleParse. The speaker is unsure if any of these alternatives would make their task easier than using lex/yacc, and shares that they are most interested in antlr4 with antlrworks. They express hesitation about investing time into learning this tool, but note that their grammar is similar to SQL-DDL.
  • #1
Solkar
107
3
About once a year I have to develop or at least design a grammar and a parser - that appears a constant of my working life...

Everytime I'm facing this task, thus about once year, I, quite a lex/yacc (flex/bison resp.) guy, consider, or reconsider, alternatives for plain lex/yacc, and, seemingly determistic, after some musing and trying I get back to plain lex/yacc.

Because I have a CORBA-Server at the hub of the application I can call in from almost every language, so this time I had a look at
- antlr4 (Java) and antlr3 (Java but has RT for other langs),
- SableCC (Java),
- Parse::EBNF, Parse::Yapp and Marpa (Perl),
- and SimpleParse (Python).

Can anyone tell me why any of them would make my task easier than using good old lex/yacc?

For me, the tandem antlr4 with antlrworks looked the most promising candidate, but I'm not yet convinced that the time spent spent on getting into it is amortized at the end.

The grammar I have to develop is somewhat similar to SQL-DDL (in terms of structure, not in terms of the subject).
 
Technology news on Phys.org
  • #2
@moderators
O.K. that maybe was too specific; pls close this thread; I repost this at stackoverflow.com
 

Related to Lex/Yacc Alternatives for Developing Grammars

1. What are Lex/Yacc alternatives for developing grammars?

Some popular alternatives to Lex/Yacc include ANTLR, Bison, JavaCC, and PLY.

2. How do these alternatives differ from Lex/Yacc?

Each alternative has its own unique syntax and features, but they all share the common goal of allowing developers to define and manipulate grammars for use in programming languages.

3. Are these alternatives more efficient than Lex/Yacc?

Efficiency can vary depending on the specific use case and implementation. It is recommended to research and compare the performance of each alternative before deciding on one for a project.

4. Can these alternatives be used with any programming language?

Some alternatives, like ANTLR and JavaCC, are specifically designed for use with Java. Others, like Bison and PLY, can be used with a variety of programming languages.

5. Are there any notable limitations or drawbacks to using these alternatives?

As with any tool, there may be limitations or drawbacks to using these alternatives. Some common issues include a steep learning curve and potential bugs or compatibility issues. It is important to thoroughly research and test a chosen alternative before using it in a production environment.

Back
Top