• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Parser generators / parser libraries in Java

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to cook up a C parser written in Java and writing the lexer and parser from scratch would be painful, so if anybody knows of parser generators that output Java code ( like yacc ) and a lexer generator that output's Java code I'd be grateful
thanks
Sridhar
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a couple major ones. JavaCC is one, and of course I can't remember the other. Donno if you're going to find a C++ grammar. Good luck! This is not simple stuff!
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ANTLR is the other big one; see http://www.antlr.org/ . I've used both JavaCC and ANTLR, and prefer ANTLR's expressiveness. ANTLR comes with an example parser for simplified C, but there is a complete GNU C parser and translator available at the ANTLR web site.
 
Sridhar Venkat
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, I'll check out ANTLR and JavaCC.
Another thing though...
I was doing a Google search and I came across BYacc. The homepage says normal yacc code can be reused and that it generates Java source for a parser. If anybody has some feedback about the effectiveness of BYacc vis-a-vis ANTLR, I'd be grateful.
Thanks,
Sridhar
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic