VisualLangLab Grammars Now Even More Intuitive

Earlier versions of VisualLangLab required the user to specify an alphanumeric name for all tokens. This made it difficult to understand rules using tokens without intuitive names. A good example is the rule infixOp from a Java grammar in Figure-1 below.

Figure-1. Rule with non-intuitive token names

While PLUS and MINUS have good mnemonic value, many users will not understand TILDE and BANG. And the contrived names PLUS2 and MINUS2 will leave most users completely clueless. The AST does show the actual pattern, but this is not helpful in complex rules where the token-to-pattern association is not so obvious.

Starting version 10.37, tokens may use the pattern itself, enclosed in quote marks, as their name. Figure-2 below shows the same rule but with tokens using the new naming convention.

Another article that uses VisualLangLab to work several examples from the book The Definitive ANTLR Reference can be read at A Quick Tour, and if you are interested in Scala parser combinators, then Scala Rapid Prototyping is a must read.