Programmers' Toolbox



Analyzer is a grammar analyzer for a very small subset of Pascal.

It was developed with SWI Prolog and the grammar was defined with help of DCG Grammar rules.


To use the program you need to consult the file from the XPCE environment.

Afterwards the main/1 predictate needs to be called with the filename to analyze, including the file extension.

If all goes well, yes is returned, otherwise an error message referring to the line where the error ocurred and the token expected is given.

C:\analyzer>"c:\Program Files (x86)\swipl\bin\swipl.exe
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.2.6)
Copyright (c) 1990-2012 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit for details.

For help, use ?- help(Topic). or ?- apropos(Word).

1 ?- consult('').
% compiled 0.02 sec, 181 clauses

2 ?- main('sample.pas').

For the complete information please check the manual.

The programm is also available as the Analyzer project in GitHub, in case you feel like forking it.


Source code with documentation and sample file for testing.