Is there any Grammar editor utility for context-free grammars developed in Java?
Neither C# nor Java is context-free, because checking of whether a variable is used correctly and consistently throughout a particular scope is known not to be context-free (the proof is complex and relies on Ogden's lemma).
A context free grammar (CFG) is a forma grammar which is used to generate all the possible patterns of strings in a given formal language. G is a grammar, which consists of a set of production rules. It is used to generate the strings of a language. T is the final set of terminal symbols.
State Machines and Automata: Building a RegExp Machine.
The one I know about would be XText.
Might be a bit over-kill:
Xtext is a framework for development of programming languages and domain specific languages (DSLs). Just describe your very own DSL using Xtext's simple EBNF grammar language and the generator will create a parser, an AST-meta model (implemented in EMF) as well as a full-featured Eclipse text editor from that.
The DSL editor looks like:
alt text http://www.eclipse.org/Xtext/documentation/latest/images/getting-started-grammar.png
Allowing you to play with the language you just defined:
alt text http://www.eclipse.org/Xtext/documentation/latest/images/getting-started-editor.png
ANTLRWorks the GUI development environment for ANTLR is quite nice. I've used it with ease in the past.
http://www.antlr.org/works/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With