This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Utility like generic compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Utility like generic compiler" Watch "Utility like generic compiler" New topic
Author

Utility like generic compiler

chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 628

I am looking for a utility rather a compiler which will execute the user defined scripts.There should be provision in the utility to define the syntax and grammar rules of the script.

The script is something like this





[Nitesh: Please UseCodeTagsa]


http://www.androcid.com/
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4422
    
    2

How is this not a compiler or interpreter for a user defined syntax?

Have you studied compilers and parsers? Making your own is not that hard.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Have a look at antlr


apigee, a better way to API!
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4422
    
    2

or Lex and Yacc for old school.

I had a compiler text book that used a pure-Java replacement for Bison/Antlr or Lex/Yacc. Clearly building a parser in Java is not that tough. And you can either emit assembly or byte-code for the JVM.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12269
    
    1
It might be easier to have your "compiler" output in a scripting language - see Jython or Groovy or Ruby.

This gives you an intermediate product that is easier to study and verify as opposed to the code-compile-crash cycle you would get if compiling to bytecodes.

Bill

Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Utility like generic compiler
 
Similar Threads
polymorphism
Your experiences with scripting languages
How to run and print this code
problem in using Ajax calls
read large CSV file and update the database