||The topic of this article may not meet Wikipedia's notability guidelines for products and services. (October 2011)|
|This article relies on references to primary sources. (October 2011)|
VisualLangLab (Visual Language Laboratory) is a completely visual, open source parser generator for JVM (Java Virtual Machine) languages. VisualLangLab allows users to create, edit and test graphical grammar-trees that represent grammar rules, without any textual (BNF, EBNF, ABNF, etc.) grammar specification. VisualLangLab was The Java Posse's Project of the Week for episode 364.
Ease of Use
Grammar as Visual Tree
Most other parser generators for Java (e.g. JavaCC, ANTLR) use a textual grammar specification in Extended Backus-Naur Form (EBNF) or Parsing expression grammar (PEG). However, unlike them, the VisualLangLab instead creates a visual grammar of the language, using its GUI.
VisualLangLab's grammar-trees are equivalent to PEGs; they support sequences, ordered choices, multiplicities (*, +, ?), as well as syntactic and semantic predicates. These grammar-trees are turned directly into instances of Scala's Parser type at run-time. The grammar-trees and other GUI features are intuitive, and the user does not have to understand PEGs or Scala programming, but familiarity with Scala's standard data types is useful in understanding the abstract syntax tree (AST).
VisualLangLab's parsers successfully handle the LL(*) class of grammars, and can also handle optional left-recursion by using packrat parsers. These are possible because of the underlying Scala parser combinator support.
VisualLangLab uses an internal lexical analyzer that is an improvement over the mechanism used in Scala's native RegexParsers. VisualLangLab includes a mechanism that automatically defines and creates an AST for all grammars. VisualLangLab is licensed under a GPL license.
Parsers created in VisualLangLab can be saved as XML (eXtensible Markup Language) files that can be reopened later for review, further editing or testing.
An API (Application Programming Interface) enables host programs to open the XML files and regenerate the parser. Starting with version 6.01 (which optionally provides ASTs created with basic JVM types only), host programs may be written in any JVM language. This feature makes VisualLangLab's parsers available to all JVM languages (present and future).
VisualLangLab was created on 5 March 2004 as A Visual LL(K) Parser Generator. This first version was written in Java, and can still be found at the Older version website. The software was usable by mid-2004, and an interesting application is described in this java.net article published in early October 2004. A comment on lambda-the-ultimate in October 2004 describes VisualLangLab as a Yacc with a GUI. The availability of Scala and its built-in parser-combinators prompted a re-write, and a Scala version was published at the current Official VisualLangLab website on 10 March 2010. Although all of the code was re-written in Scala, the essential character of the GUI remains the same. A news item on jaxenter featured this version in late March 2010.
In September 2011 VisualLangLab was The Java Posse's Project of the week
A pure Java version with a much smaller download size was previewed in early January 2012.
- Java Posse Episode 364 VisualLangLab is Project of the week!
- A Quick Tour uses examples from the book The Definitive ANTLR Reference
- Rapid Prototyping for Scala uses example from the book Programming Scala
- GWT Article Grammar without Tears article on java.net
- GUI VisualLangLab's graphical user interface
- Testing Testing the Grammar
- Editing Editing the Grammar
- ActionCode Action Code Design
- lambda-the-ultimate Yacc with a GUI
- Parser Scala's scala.util.parsing.combinator.Parsers#Parser class
- Scala Relationship VisualLangLab's Relationship with Scala
- Scala API Scala's standard data types
- AST VisualLangLab's AST Structure
- Scala parser combinator Scala's parser combinator library
- Internal Lexer VisualLangLab's internal lexical analyzer
- RegexParsers Scala's scala.util.parsing.combinator.RegexParsers class
- API VisualLangLab's API
- News-item on jaxenter Scala's Parser Combinators in a Visual Environment
- java.net Editor's blog New Article: Introduction to java.net's VisualLangLab Project
- Pure Java version A preview of the pure Java version