home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lifeos2.zip
/
LIFE-1.02
/
EXAMPLES
/
SUPERLIN
/
SL_PARSE.LF
< prev
next >
Wrap
Text File
|
1996-06-04
|
2KB
|
108 lines
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% SUPERLINT
% ---------
%
%
%
%
% AUTHOR : Arnaud Venet CREATION : September 7th 1993
% ------ --------
%
%
% ---------------
%
%
% Last modification : September 20th 1993
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
module("sl_parser") ?
public(sl_parse) ?
%
% ------------------------------------------------------------------------------
%
write_err("Loading...") ?
load("c_public_terms") ?
open("c_public_terms") ?
%
% ------------------------------------------------------------------------------
%
import("accumulators") ?
acc_info(dcg,Term, Xs, Ys, acc_pred => 'C'(Term,false,Xs,Ys),
in_name => 0, out_name => rest) ?
expand_load(true) ?
load("c_parser") ?
open("c_parser") ?
write_err("done"), nl_err ?
%
% ------------------------------------------------------------------------------
%
sl_parse(Term) :-
c_parse(tree => Tree, parse_mode => heavy, error => ParseError) & Term,
syntactic_tree <<- Tree,
cond(ParseError :== true,
(
write_err(">>> superlint : error in parse"),
nl_err,
write_err(">>> superlint : abort"),
nl_err,
halt
)
).
%
% ------------------------------------------------------------------------------
%