GNU PROLOG with UTF8 support
scan_supp.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog buit-in predicates *
5  * File : scan_supp.h *
6  * Descr.: scanner 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 SCAN_BIG_BUFFER 10240
44 
45 
46 
47 
48 /*---------------------------------*
49  * Type Definitions *
50  *---------------------------------*/
51 
52 typedef enum
53 {
65 }
66 TypTok;
67 
68 
69 
70 
71 typedef struct
72 {
74  char name[SCAN_BIG_BUFFER]; /* for VARIABLE NAME STRING BACK_QUOTED */
75  int quoted; /* for NAME: was it quoted ? */
76  int punct; /* for PUNCTUATION */
77  PlLong int_num; /* for INTEGER */
78  double float_num; /* for FLOAT */
79  int line; /* source line of the pl_token */
80  int col; /* source column of the pl_token */
81 }
82 TokInf;
83 
84 
85 
86 
87 /*---------------------------------*
88  * Global Variables *
89  *---------------------------------*/
90 
91 #ifdef SCAN_SUPP_FILE
92 
94 
95 #else
96 
97 extern TokInf pl_token;
98 
99 #endif
100 
101 
102 
103 
104 /*---------------------------------*
105  * Function Prototypes *
106  *---------------------------------*/
107 
108 CHAR32_T Pl_Scan_Peek_Char(StmInf *pstm, Bool convert);
109 
110 
111 
112 char *Pl_Scan_Token(StmInf *pstm, Bool comma_is_punct);
113 
114 
115 
116 void Pl_Recover_After_Error(StmInf *pstm);
117 
118 
119 
120 char *Pl_Scan_Next_Atom(StmInf *pstm);
121 
122 char *Pl_Scan_Next_Number(StmInf *pstm, Bool integer_only);
int punct
Definition: scan_supp.h:76
TypTok
Definition: scan_supp.h:52
static char name[32]
Definition: test_oc_defs.h:8
#define CHAR32_T
Definition: pl_wchar.h:9
Definition: scan_supp.h:64
Definition: scan_supp.h:62
char * Pl_Scan_Next_Atom(StmInf *pstm)
Definition: scan_supp.c:860
CHAR32_T Pl_Scan_Peek_Char(StmInf *pstm, Bool convert)
Definition: scan_supp.c:97
#define SCAN_BIG_BUFFER
Definition: scan_supp.h:43
void Pl_Recover_After_Error(StmInf *pstm)
Definition: scan_supp.c:765
TypTok type
Definition: scan_supp.h:73
TokInf pl_token
double float_num
Definition: scan_supp.h:78
int line
Definition: scan_supp.h:79
char * Pl_Scan_Token(StmInf *pstm, Bool comma_is_punct)
Definition: scan_supp.c:152
Definition: scan_supp.h:71
Definition: scan_supp.h:58
intptr_t PlLong
Definition: gprolog.h:88
Definition: scan_supp.h:55
PlLong int_num
Definition: scan_supp.h:77
Definition: scan_supp.h:60
int quoted
Definition: scan_supp.h:75
Definition: scan_supp.h:63
Definition: scan_supp.h:61
Definition: stream_supp.h:137
Definition: scan_supp.h:56
Definition: scan_supp.h:59
char * Pl_Scan_Next_Number(StmInf *pstm, Bool integer_only)
Definition: scan_supp.c:938
int col
Definition: scan_supp.h:80
Definition: scan_supp.h:54
int Bool
Definition: bool.h:65
Definition: scan_supp.h:57