GNU PROLOG with UTF8 support
parse_supp.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog buit-in predicates *
5  * File : parse_supp.h *
6  * Descr.: parser support - header file *
7  * Author: Daniel Diaz *
8  * *
9  * Copyright (C) 1999-2015 Daniel Diaz *
10  * *
11  * This file is part of GNU Prolog *
12  * *
13  * GNU Prolog is free software: you can redistribute it and/or *
14  * modify it under the terms of either: *
15  * *
16  * - the GNU Lesser General Public License as published by the Free *
17  * Software Foundation; either version 3 of the License, or (at your *
18  * option) any later version. *
19  * *
20  * or *
21  * *
22  * - the GNU General Public License as published by the Free *
23  * Software Foundation; either version 2 of the License, or (at your *
24  * option) any later version. *
25  * *
26  * or both in parallel, as here. *
27  * *
28  * GNU Prolog is distributed in the hope that it will be useful, *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
31  * General Public License for more details. *
32  * *
33  * You should have received copies of the GNU General Public License and *
34  * the GNU Lesser General Public License along with this program. If *
35  * not, see http://www.gnu.org/licenses/. *
36  *-------------------------------------------------------------------------*/
37 
38 
39 /*---------------------------------*
40  * Constants *
41  *---------------------------------*/
42 
43 #define PARSE_END_OF_TERM_DOT 0
44 #define PARSE_END_OF_TERM_EOF 1
45 
46 
47 
48 
49 /*---------------------------------*
50  * Type Definitions *
51  *---------------------------------*/
52 
53 
54 typedef struct /* Parsed variable information */
55 { /* ------------------------------ */
56  char name[MAX_VAR_NAME_LENGTH]; /* variable name */
57  WamWord word; /* associated WAM word */
58  Bool named; /* has it a name ? */
59  int nb_of_uses; /* occurrence counter */
60 }
61 InfVar;
62 
63 
64 
65 
66 /*---------------------------------*
67  * Global Variables *
68  *---------------------------------*/
69 
70 #ifdef PARSE_SUPP_FILE
71 
73 int pl_parse_nb_var;
74 
75 #else
76 
77 extern InfVar pl_parse_dico_var[];
78 extern int pl_parse_nb_var;
79 
80 #endif
81 
82 
83  /* defined as this to avoid to force the */
84  /* inclusion of parse_supp.o if not needed */
85  /* (stream_supp.c uses pl_last_read_line/col) */
88 
89 
90 
91 
92 /*---------------------------------*
93  * Function Prototypes *
94  *---------------------------------*/
95 
96 WamWord Pl_Read_Term(StmInf *pstm, int parse_end_of_term);
97 
99 
101 
103 
static char name[32]
Definition: test_oc_defs.h:8
Definition: parse_supp.h:54
WamWord Pl_Read_Token(StmInf *pstm)
Definition: parse_supp.c:843
WamWord Pl_Read_Integer(StmInf *pstm)
Definition: parse_supp.c:791
int pl_last_read_col
Definition: parse_supp.h:87
#define MAX_VAR_IN_TERM
Definition: b_params.h:41
int pl_last_read_line
Definition: parse_supp.h:86
int nb_of_uses
Definition: parse_supp.h:59
WamWord Pl_Read_Atom(StmInf *pstm)
Definition: parse_supp.c:766
int pl_parse_nb_var
WamWord word
Definition: parse_supp.h:57
InfVar pl_parse_dico_var[]
WamWord Pl_Read_Number(StmInf *pstm)
Definition: parse_supp.c:817
Bool named
Definition: parse_supp.h:58
Definition: stream_supp.h:137
long WamWord
Definition: LINUX_SIGSEGV.c:4
#define MAX_VAR_NAME_LENGTH
Definition: b_params.h:39
int Bool
Definition: bool.h:65
WamWord Pl_Read_Term(StmInf *pstm, int parse_end_of_term)
Definition: parse_supp.c:203