Skip to main content

VisualLangLab - User Guide

The following sections describe the two main roles (and distinct skills) of VisualLangLab users and the workflow that connects their activities. The same individual could (and perhaps typically will) of course perform both roles.

Some Essential Jargon

Before proceeding any further, readers should note the following definitions.

  • action-code: a function literal, coded in Javascript or Scala, associated with any grammar-tree node (also known as semantic action or just action in CS theory). The function is executed when VisualLangLab matches parser input to the node. more details can be found in AST and Action Code.html
  • saved-grammar file: a XML file containing parsers developed with the VisualLangLab GUI. These files do not contain any code -- just a description of all the parser-specific information available to the GUI. The format of a grammar-file is very intuitive, and it should be easy to use XSLT or something similar to translate it into code or other form
  • grammar-tree: the visual tree that is used to display a parser-rule at the top left of The GUI. To the GUI user the grammar-tree is the parser-rule and there is no other user-accessible form of the parser-rule. Because of this, grammar-tree and parser-rule are used interchangably in the documentation.
  • parser: generally used to refer to a program or body of code that parses text in a particular format (or grammar), but see note below. The GUI itself is a parser because it can parse text when Testing Parsers. An application program that loads a grammar-file by Using the API is also a parser.
  • parser-rule: non-trivial parsers are simplified by breaking them down into a number of simpler parser-rules (often called just rule), but see note below. Each parser-rule is known by a unique name, and one of the parser-rules must be distinguished as the top-level (entry-point) entity

Note: Readers, particularly those who will be Using the API, should be aware that Scala's parser combinators (which VisualLangLab uses internally) assigns a type called Parser to parser-rules (and even the nodes that comprise them). VisualLangLab documentation however avoids using that meaning of parser, preferring the definition given above instead. So, be careful when reading Using the API which has to use both the meanings. The Relationship with Scala Parser Combinators has more details.

Workflow and User Roles

Figure-1 below illustrates the development workflow, and shows the different ways in which different groups of people use the VisualLangLab software.

Development workflow using VisualLangLab
Figure-1. Development workflow using VisualLangLab

Grammar/Domain Expert

The grammar expert is responsible for developing and testing a parser. From the grammar expert's point of view, a parser is not an application or piece of code, but a set of visual gramamar-trees that may be further processed as described below. This parser may be saved as an XML file (with suffix vll) that can be reopened in the IDE for reviewing, testing, or modification. These saved-grammar files can also be published for use by application developers.

Anyone with a knowledge of parsing concepts (and an understanding of the target grammar) can be trained to develop and test parsers using the interface described in The GUI. Manual testing, following prescribed test cases, is also possible without knowledge of programming. Development of automated test cases (e.g. using Javascript action-code or JUnit) however does require knowledge of programming, and is described in Testing Parsers.

The GUI (the grammar editor) can be run by following the instructions in Download Install and Run, and a grammar can be created or edited by following the instructions in Editing the Grammar Tree. An understanding of the Relationship with Scala Parser Combinators provides a bridge to the Application developer's perspective.

Application Developer

An application developer uses pre-existing saved-grammar files to create applications for specific requirements. While an applicaion developer may use The GUI to understand and review the grammar, his primary focus is Using the API and the description of the AST and Action Code. The Examples are also expected to be helpful.

An application developer also needs to be an expert in the use of programming tools, have a good understanding of at least one JVM language (including Java or Scala), and have access to a domain expert who understands the application's requirements well.

Application User

The Application user is typically unaware of the constituents of his dedicated application, and the process that was used to design and develop it. The VisualLangLab runtime library and one or more grammar files are embedded in the product, and depending on the nature or purpose of the application it may or may not be necessary for the user to be aware of these factors.

Quick Start

The good way to quickly understand VisualLangLab is to start up the IDE, review the Sample Grammars and the Examples, and try to test the parsers.

Please Confirm