~ubuntu-branches/ubuntu/saucy/ladr/saucy

« back to all changes in this revision

Viewing changes to ladr/fastparse.h.bak

  • Committer: Package Import Robot
  • Author(s): Frank Lichtenheld
  • Date: 2013-05-25 11:43:32 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20130525114332-lkzco1dti2hwrf7v
Tags: 0.0.200911a-2
* QA upload.
* Upload to unstable.
* Change maintainer to QA group.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  Copyright (C) 2006, 2007 William McCune
2
 
 
3
 
    This file is part of the LADR Deduction Library.
4
 
 
5
 
    The LADR Deduction Library is free software; you can redistribute it
6
 
    and/or modify it under the terms of the GNU General Public License,
7
 
    version 2.
8
 
 
9
 
    The LADR Deduction Library is distributed in the hope that it will be
10
 
    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
    GNU General Public License for more details.
13
 
 
14
 
    You should have received a copy of the GNU General Public License
15
 
    along with the LADR Deduction Library; if not, write to the Free Software
16
 
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
 
*/
18
 
 
19
 
#ifndef TP_FASTPARSE_H
20
 
#define TP_FASTPARSE_H
21
 
 
22
 
#include "topform.h"
23
 
 
24
 
/* INTRODUCTION
25
 
This package is meant for use when there are a great number
26
 
of terms to be read and written.  I wrote it when I was
27
 
looking for a single axiom for lattice theory and was
28
 
filtering trillions (really) of equations.
29
 
<P>
30
 
The ordinary parsing is very general and rather slow.
31
 
<P>
32
 
This package reads and writes prefix terms, without parentheses
33
 
commas, or spaces.  Each symbol is one character.
34
 
Each term to be read starts on a new line and ends with a period.
35
 
The user has to declare the arities of symbols
36
 
by calling fast_set_symbol().
37
 
<P>
38
 
Here's an example to read lattice equations in fast-parse form and
39
 
write them in ordinary form.
40
 
<PRE>
41
 
int main(int argc, char **argv)
42
 
{
43
 
  Term t;
44
 
  fast_set_symbol('=', 2);
45
 
  fast_set_symbol('m', 2);
46
 
  fast_set_symbol('j', 2);
47
 
  t = fast_read_term(stdin, stderr);
48
 
  while (t != NULL) {
49
 
    fwrite_term_nl(stdout, t);
50
 
    zap_term(t);
51
 
    t = fast_read_term(stdin, stderr);
52
 
  }
53
 
  exit(0);
54
 
}
55
 
</PRE>
56
 
<P>
57
 
There are also routines for reading and writing fast-parse clauses.
58
 
*/
59
 
 
60
 
/* Public definitions */
61
 
 
62
 
/* End of public definitions */
63
 
 
64
 
/* Public function prototypes from fastparse.c */
65
 
 
66
 
void fast_set_symbol(char c, int arity);
67
 
 
68
 
void fast_set_defaults(void);
69
 
 
70
 
Term fast_read_term(FILE *fin, FILE *fout);
71
 
 
72
 
void fast_fwrite_term_nl(FILE *fp, Term t);
73
 
 
74
 
Topform fast_read_clause(FILE *fin, FILE *fout);
75
 
 
76
 
void fast_fwrite_clause(FILE *fp, Topform c);
77
 
 
78
 
#endif  /* conditional compilation of whole file */