4 * Ullrich von Bassewitz, 07.06.1998
19 /*****************************************************************************/
20 /* token definitions */
21 /*****************************************************************************/
70 /* primary operators */
132 /*****************************************************************************/
134 /*****************************************************************************/
139 typedef struct Token_ Token;
141 unsigned Tok; /* The token itself */
142 long IVal; /* The integer attribute */
143 ident Ident; /* Identifier if IDENT */
144 unsigned Pos; /* Source line where the token comes from */
145 type* IType; /* Type if integer constant */
148 extern Token CurTok; /* The current token */
149 extern Token NextTok; /* The next token */
151 /* Defines to make the old code work */
152 #define curtok CurTok.Tok
153 #define curval CurTok.IVal
154 #define curpos CurTok.Pos
155 #define curtype CurTok.IType
157 #define nxttok NextTok.Tok
158 #define nxtval NextTok.IVal
159 #define nxtpos NextTok.Pos
160 #define nxttype NextTok.IType
164 /*****************************************************************************/
166 /*****************************************************************************/
170 void symname (char* s);
171 /* Get symbol from input stream */
174 /* Get symbol from input stream or return 0 if not a symbol. */
177 /* Get next token from input stream */
179 void Consume (unsigned Token, unsigned char ErrNum);
180 /* Eat token if it is the next in the input stream, otherwise print an error
184 void ConsumeColon (void);
185 /* Check for a colon and skip it. */
187 void ConsumeSemi (void);
188 /* Check for a semicolon and skip it. */
190 void ConsumeLParen (void);
191 /* Check for a left parenthesis and skip it */
193 void ConsumeRParen (void);
194 /* Check for a right parenthesis and skip it */
196 void ConsumeLBrack (void);
197 /* Check for a left bracket and skip it */
199 void ConsumeRBrack (void);
200 /* Check for a right bracket and skip it */
202 void ConsumeLCurly (void);
203 /* Check for a left curly brace and skip it */
205 void ConsumeRCurly (void);
206 /* Check for a right curly brace and skip it */
210 /* End of scanner.h */