Analyzer
Introduction
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.
Overview
To use the program you need to consult the file analyzer.pl 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 http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
1 ?- consult('analyzer.pl').
% analyzer.pl compiled 0.02 sec, 181 clauses
true.
2 ?- main('sample.pas').
true
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.