I have been working on developing a script language which ports methods from the java.awt.Graphics
class into commands like
setcolor_0,127,214,255 //R,G,B,Alphaor
fillrect_50,25,100,75 //x,y,w,hinto a picture, so that I could avoid having to write an entire program every time I wanted to create a certain image. The language itself is currently limited to pseudofunctions and commands (mapped directly to Graphics method calls), plus a few output specifiers as a header to each script, but I want to add more. The script is processed in one program which serves as both parser and interpreter, but my method of processing the input Strings directly is inadequate for what I want to do.
While I have searched and found plenty of parser and lexer generators, I keep running into the same two problems with the parser-generators, that being either
So in addition to avoiding these things, I am looking for a parser-generator which also has plenty of open documentation (which is why I would like to steer clear of ANTLR), and which outputs Java source code (I would prefer that the output be for as recent a version of Java as is possible, but that is not very important to me).
tl;dr: I need a parser-generator which:
Welcome to the vast world of Software Reuse, where you can choose among a vast array of components, all of which don't do quite what you want.
It is probably unrealistic to get a parser generator package that doesn't have "external dependencies". Almost any complex piece of software uses a library of special functions to support its purposes, and parser generators aren't really different. The distinction you make seems rather artificial, too. Imagine that a parser generator simply emitted the code for the external library, rather than simply referenced it. The amount of code you got, and how it was organized, would not be different. Why then would you object to the library version?
If you want parser generators that are not incomplete, I suggest you stick with mature ones. ANTLR and JavaCC in the Java world have quite long and successful track records.
If you insist you still don't want such things, you can always hand-code a recursive descent parser. This is especially effective for "simple" languages, such as yours appears to be. [What you'll discover is that you end up coding your own support library, although it doesn't have to be very big.]