GOLDEngine for Java
The GOLD Parser is a parsing system developed by Devin Cook that can be used to parse existing programming languages, scripts, or structured data files. It can even be used to develop your own domain specific language (DSL). There are many tools available to do similar tasks, LEX/YACC for instance, but what sets the GOLD system apart is the interactive nature of the grammar development and testing.
The GOLD system consists of three components: the GOLD Builder, a compiled grammar file, and an engine that will use the compiled grammar file to process source input files.
The GOLD Builder is a Windows GUI application that allows a user to create or modify a language grammar (set of symbols and rules) and then test the grammar against sample input. Once you are satisfied with the grammar, the Builder will then generate a compiled grammar file, an optimized table of symbols and rules. The Builder is also able to generate a sample template file for a number of engines written in many languages.
GOLDEngine for Java is a Java implementation of an engine that can process source input using the compiled grammar files (CGT and EGT format) created by the GOLD Builder. The engine is able to act as a language interpreter, compiler, or language translator depending upon how the production rules are implemented.
The source for the engine as well as some examples can be found on GitHub goldengine. I also have a link to a PDF document containing the presentation slides from a talk that I gave at the McHenry County Software Craftsmanship meeting in July 2012.
-
Any chance you can upload the binaries again? The current link in the readme is broken :/
-
Hi Ralph,
I am using GOLDEngine library in java project for analyzing mysql file, which is working properly, but when i am using MSSQL file for analysis, this library get fails as its Reduction object and tree does not get create. so please suggest me if there is any way to analyze MSSQL file using GOLDEngine library.
Thanks!
-
Hi Ralph, I’m a pioneer in this subject, I need more info about the engine, for example, I load the grammar ok, and generate the tree perfectly, but I need traverse the tree, I don’t find any info about that. Please help me!!
-
Hello Ralph, I have taken a compiler course at College, but the teacher uses yacc/bison and I don’t think they are as user friendly as GOLD, so I decided to use GOLD for my project, but I struggling with the lack of guides on how to use the engine, I’ve read your examples but I’m not sure about the rule handlers, you have separated them from the java files, but u also have implemented some tests liek AssignTest, DisplayTest, and so on.
My doubt is: I need them for my code to work ?
Or just the rule handlers?
It’s hard to find GOLDParse guides these days, your examples are by far the best reference I’ve had so far, Thanks ! -
Hi Ralph,
I am PhD student and I am looking for the best tool to generate a parser. I was struggling with lex/Yacc until I found Gold Parser tool and your great code on GitHub.Can you please answer my questions..
1. after I separate rule handler, should I follow the organization like simple 2 and simple 3, what else should I provide beside rule handler to make my compiler works?
2. I am not able to run simple 2 and simple 3.. I build the project successfully using mvn.
then I did the following
cd to where simple2 folder
then, run Hello.txt -tree but it doesn’t show anything
Also, I tried to run Simple2. java by using
java -jar simple2.jar Hello.txt -tree but I got error. simple2.jar is not accessible.Please help me to implement your examples..
Thanks a lot in advance..
Comments