Lex/Yacc Alternatives for Developing Grammars

  • Thread starter Thread starter Solkar
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on the exploration of alternatives to lex/yacc for grammar and parser development. The user evaluates several tools including ANTLR4, ANTLR3, SableCC, Parse::EBNF, Parse::Yapp, Marpa, and SimpleParse, ultimately expressing a preference for ANTLR4 paired with ANTLRWorks. Despite this, the user remains uncertain about the time investment required to learn these alternatives compared to the familiarity and reliability of lex/yacc.

PREREQUISITES
  • Understanding of lex/yacc (flex/bison) for parser generation
  • Familiarity with ANTLR4 and ANTLRWorks for grammar development
  • Basic knowledge of Java and its ecosystem for using ANTLR
  • Experience with grammar structures similar to SQL-DDL
NEXT STEPS
  • Research ANTLR4 documentation and tutorials for effective grammar design
  • Explore the features and capabilities of ANTLRWorks for visual grammar development
  • Investigate SableCC and its advantages over traditional lex/yacc
  • Learn about Parse::Yapp and Marpa for Perl-based parsing solutions
USEFUL FOR

Software developers, particularly those involved in compiler design, parser development, and anyone seeking to optimize grammar parsing processes using modern tools.

Solkar
Messages
107
Reaction score
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
@moderators
O.K. that maybe was too specific; pls close this thread; I repost this at stackoverflow.com