]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/pge-boot/Gbnflex.h
8753ac7fa0d795c5f56a5834eb8799aa6d77af1c
[thirdparty/gcc.git] / gcc / m2 / pge-boot / Gbnflex.h
1 /* do not edit automatically generated by mc from bnflex. */
2 /* bnflex.def provides a simple lexical package for pg.
3
4 Copyright (C) 2001-2023 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6
7 This file is part of GNU Modula-2.
8
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
13
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GNU Modula-2; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
22
23
24 #if !defined (_bnflex_H)
25 # define _bnflex_H
26
27 #include "config.h"
28 #include "system.h"
29 # ifdef __cplusplus
30 extern "C" {
31 # endif
32 #include <stdbool.h>
33 # if !defined (PROC_D)
34 # define PROC_D
35 typedef void (*PROC_t) (void);
36 typedef struct { PROC_t proc; } PROC;
37 # endif
38
39 # include "GNameKey.h"
40
41 # if defined (_bnflex_C)
42 # define EXTERN
43 # else
44 # define EXTERN extern
45 # endif
46
47 typedef enum {bnflex_identtok, bnflex_literaltok, bnflex_codetok, bnflex_lbecomestok, bnflex_rbecomestok, bnflex_bartok, bnflex_lsparatok, bnflex_rsparatok, bnflex_lcparatok, bnflex_rcparatok, bnflex_lparatok, bnflex_rparatok, bnflex_errortok, bnflex_tfunctok, bnflex_symfunctok, bnflex_squotetok, bnflex_dquotetok, bnflex_moduletok, bnflex_begintok, bnflex_rulestok, bnflex_endtok, bnflex_lesstok, bnflex_gretok, bnflex_tokentok, bnflex_specialtok, bnflex_firsttok, bnflex_followtok, bnflex_BNFtok, bnflex_FNBtok, bnflex_declarationtok, bnflex_epsilontok, bnflex_eoftok} bnflex_TokenType;
48
49
50 /*
51 OpenSource - Attempts to open the source file, a.
52 The success of the operation is returned.
53 */
54
55 EXTERN bool bnflex_OpenSource (const char *a_, unsigned int _a_high);
56
57 /*
58 CloseSource - Closes the current open file.
59 */
60
61 EXTERN void bnflex_CloseSource (void);
62
63 /*
64 GetChar - returns the current character on the input stream.
65 */
66
67 EXTERN char bnflex_GetChar (void);
68
69 /*
70 PutChar - pushes a character onto the push back stack, it also
71 returns the character which has been pushed.
72 */
73
74 EXTERN char bnflex_PutChar (char ch);
75
76 /*
77 SymIs - if t is equal to the current token the next token is read
78 and true is returned, otherwise false is returned.
79 */
80
81 EXTERN bool bnflex_SymIs (bnflex_TokenType t);
82
83 /*
84 IsSym - returns the result of the comparison between the current token
85 type and t.
86 */
87
88 EXTERN bool bnflex_IsSym (bnflex_TokenType t);
89
90 /*
91 GetCurrentTokenType - returns the type of current token.
92 */
93
94 EXTERN bnflex_TokenType bnflex_GetCurrentTokenType (void);
95
96 /*
97 GetCurrentToken - returns the NameKey of the current token.
98 */
99
100 EXTERN NameKey_Name bnflex_GetCurrentToken (void);
101
102 /*
103 SkipUntilWhite - skips all characters until white space is seen.
104 */
105
106 EXTERN void bnflex_SkipUntilWhite (void);
107
108 /*
109 SkipWhite - skips all white space.
110 */
111
112 EXTERN void bnflex_SkipWhite (void);
113
114 /*
115 SkipUntilEoln - skips until a lf is seen. It consumes the lf.
116 */
117
118 EXTERN void bnflex_SkipUntilEoln (void);
119
120 /*
121 AdvanceToken - advances to the next token.
122 */
123
124 EXTERN void bnflex_AdvanceToken (void);
125
126 /*
127 IsReserved - returns TRUE if the name is a reserved word.
128 */
129
130 EXTERN bool bnflex_IsReserved (NameKey_Name name);
131
132 /*
133 PushBackToken - pushes a token back onto input.
134 */
135
136 EXTERN void bnflex_PushBackToken (NameKey_Name t);
137
138 /*
139 SetDebugging - sets the debugging flag.
140 */
141
142 EXTERN void bnflex_SetDebugging (bool flag);
143 # ifdef __cplusplus
144 }
145 # endif
146
147 # undef EXTERN
148 #endif