More Visual Prolog 7.3 Examples


Parser Generator

Written by Malcolm Bolton



A parser is a program that is able to recognize the underlying structure in a source text. For example, a Pascal compiler uses a parser to recognize the if, while, repeat and case statements and the procedures, functions and expressions in a Pascal source file. Parsers are used not only with programming languages but also with command interpreters to interpret user input for various types of programs—expert system shells and natural-language interfaces, for example. a scanner (sometimes this is referred to as the lexical analyzer).


This Parser Generator is a program that generates a parser from the specification of a grammar. Thus, from a BNF-like grammar, our parser generator produces a Prolog program capable of recognizing sentences conforming to that grammar.

A parser generator makes it easier to write parsers. Even with Prolog, which was originally designed with natural language parsing in mind, it is still a relatively complicated task to write a parser on your own. Since not everyone has the time to develop expertise in writing parsers (as well as in everything else they must know about in computing), a parser generator allows even non-experts to construct parsers.


The version of the Parcer Generator for Visual Prolog 5 was created by the Prolog Development Center (PDC).


Download the project.



The example requires Visual Prolog 7.3 Commercial Edition.


If you use the Personal Edition, but need the  features supported only in the Commercial Edition, you are welcome to order the latest build of this Edition just now: Order!


Users of previous versions of Visual Prolog are welcome to upgrade to the current version of Visual Prolog  to use the latest versions of the Visual Prolog examples.


Download VIP-ALC'08

Visual Prolog Application & Language Conference (VIP-ALC 2006) April 24-26 2006

Download VIP-ALC'06 Proceedings