VisualLangLab
|
|
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) |
| Developer(s) | Sanjay Dasgupta |
|---|---|
| Stable release | 7.xx |
| Platform | Scala 2.9+ |
| Type | parser/scanner generator |
| License | GPL |
| Website | http://vll.java.net/ |
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[1] for episode 364.
A Quick Tour[2] and Rapid Prototyping for Scala[3] are tutorials that use examples from other sources. An introductory article, Grammar without Tears[4] is available online.
Ease of Use
VisualLangLab provides a graphical user interface (GUI).[5] This interactive IDE (Integrated Development Environment)-style interface[5] differentiates it from other parser generators. The grammar-trees are executable, and can be test-run[6] at the click of a GUI button. Parsers can be created[7] and tested[6] entirely within the user interface without additional tools or skills. Because of its ease of use, VisualLangLab is an effective prototyping and training environment. It also allows the use of semantic actions[clarification needed] (written as Scala or Javascript functions) embedded within the grammar[8] where needed. A comment on lambda-the-ultimate[9] in October 2004 describes VisualLangLab as a Yacc with a GUI.
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.[7] These grammar-trees are turned directly into instances of Scala's Parser type[10] at run-time.[11] The grammar-trees and other GUI[5] features are intuitive, and the user does not have to understand PEGs or Scala programming, but familiarity with Scala's standard data types[12] is useful in understanding the abstract syntax tree (AST).[13]
Capabilities
VisualLangLab generates backtracking recursive descent parsers based on Scala's parser combinator library.[14]
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.[14]
Built-in Lexer
VisualLangLab uses an internal lexical analyzer that[15] is an improvement over the mechanism used in Scala's native RegexParsers.[16] VisualLangLab includes a mechanism that automatically defines and creates an AST for all grammars.[13] VisualLangLab is licensed under a GPL license.
Grammar Reuse
Parsers created in VisualLangLab can be saved as XML (eXtensible Markup Language) files that can be reopened later for review, further editing or testing.
API
An API[17] (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).
History
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[9] 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[18] on jaxenter featured this version in late March 2010.
The Grammar without Tears[4] article was featured in the java.net Editor's blog[19] on 14 September 2011.
In September 2011 VisualLangLab was The Java Posse's Project of the week[1]
A pure Java version[20] with a much smaller download size was previewed in early January 2012.
References
- ^ a b 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
- ^ a b GWT Article Grammar without Tears article on java.net
- ^ a b c GUI VisualLangLab's graphical user interface
- ^ a b Testing Testing the Grammar
- ^ a b Editing Editing the Grammar
- ^ ActionCode Action Code Design
- ^ a b 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
- ^ a b AST VisualLangLab's AST Structure
- ^ a b 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
