996
|
1 %e 2000
|
|
2 %p 4000
|
|
3 %n 1000
|
|
4 %{
|
|
5 /* the directives above are for Solaris lex, and will be ignored by
|
|
6 * flex */
|
|
7
|
|
8 /*
|
|
9 * NAME
|
|
10 * lexer.l -- source for the C-INTERCAL lexical analyzer.
|
|
11 *
|
|
12 LICENSE TERMS
|
|
13 Copyright (C) 1996 Eric S. Raymond
|
|
14
|
|
15 This program is free software; you can redistribute it and/or modify
|
|
16 it under the terms of the GNU General Public License as published by
|
|
17 the Free Software Foundation; either version 2 of the License, or
|
|
18 (at your option) any later version.
|
|
19
|
|
20 This program is distributed in the hope that it will be useful,
|
|
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
23 GNU General Public License for more details.
|
|
24
|
|
25 You should have received a copy of the GNU General Public License
|
|
26 along with this program; if not, write to the Free Software
|
|
27 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
28 */
|
|
29 #include "config.h"
|
|
30 #include <stdio.h>
|
|
31 #include <stdlib.h>
|
|
32 #include <ctype.h>
|
|
33 #include <string.h>
|
|
34 #include "ick.h"
|
|
35 #include "parser.h"
|
|
36 #include "ick_lose.h"
|
|
37
|
|
38 /*#undef wchar_t*/
|
|
39 /*#define wchar_t unsigned char*/
|
|
40
|
|
41 #ifndef yywrap
|
|
42 static int yywrap(void)
|
|
43 {
|
|
44 return 1;
|
|
45 }
|
|
46 #endif /* yywrap */
|
|
47
|
|
48 int iyylineno = 1;
|
|
49
|
|
50 #ifdef MAIN
|
|
51 YYSTYPE yylval;
|
|
52 #endif /* MAIN */
|
|
53
|
|
54 char **textlines = NULL;
|
|
55 int textlinecount = 0;
|
|
56 int politesse = 0;
|
|
57 int stbeginline = 0;
|
|
58
|
|
59 /* AIS: Sort out a grammar near-ambiguity */
|
|
60 unsigned long sparkearsstack[SENESTMAX] = {0};
|
|
61 int sparkearslev = 0;
|
|
62
|
|
63 /* AIS: Some symbols are ambiguous between C-INTERCAL and CLC-INTERCAL:
|
|
64 Symbol C-INTERCAL CLC-INTERCAL
|
|
65 NOSPOT _ @
|
|
66 WHIRL @ ?
|
|
67 XOR ? yen, or bookworm (bookworm's also C-INTERCAL legal)
|
|
68 By default, the C-INTERCAL meanings are used; the extern variable clclex
|
|
69 causes CLC-INTERCAL interpretations to be put on the ambiguous symbols.
|
|
70 Otherwise, mixing syntaxes freely is allowed. */
|
|
71 extern int clclex;
|
|
72
|
|
73 #ifdef FLEX_SCANNER
|
|
74 static char linebuf[YY_BUF_SIZE];
|
|
75 #else /* FLEX_SCANNER */
|
|
76 static char linebuf[YYLMAX];
|
|
77 #endif /* FLEX_SCANNER */
|
|
78
|
|
79 static char *lineptr = linebuf;
|
|
80
|
|
81 ick_bool re_send_token = ick_FALSE;
|
|
82
|
|
83 int lexer(void);
|
|
84 static int myatoi(const char *text);
|
|
85 void yyerror(const char *errtype);
|
|
86
|
|
87 #define SETLINENO \
|
|
88 {if (stbeginline == 0) stbeginline = iyylineno;\
|
|
89 else if (stbeginline < 0) stbeginline = 0;}
|
|
90
|
|
91 /* AIS: Keep track of the spark/ears situation */
|
|
92 #define STACKSPARKEARS(a) \
|
|
93 if (sparkearslev+1>=SENESTMAX*32) ick_lose(IE281, iyylineno, (char*) NULL); \
|
|
94 sparkearslev++; sparkearsstack[sparkearslev/32]<<=1; \
|
|
95 sparkearsstack[sparkearslev/32]+=a
|
|
96 #define CLEARSPARKEARSTACK {int i=SENESTMAX; \
|
|
97 while(i--) sparkearsstack[i] = 0;} \
|
|
98 sparkearslev = 0
|
|
99
|
|
100 /*
|
|
101 * The spectacular ugliness of INTERCAL syntax requires that the lexical
|
|
102 * analyzer have two levels. One, embedded in the getc() function, handles
|
|
103 * logical-line continuation and the ! abbrev, and stashes each logical
|
|
104 * line away in a buffer accessible to the code generator (this is necessary
|
|
105 * for the * construct to be interpreted correctly). The upper level is
|
|
106 * generated by lex(1) and does normal tokenizing.
|
|
107 */
|
|
108
|
|
109 #undef getc
|
|
110 int getc(FILE *fp)
|
|
111 {
|
|
112 extern FILE* yyin;
|
|
113
|
|
114 static ick_bool bangflag = ick_FALSE;
|
|
115 static ick_bool backflag = ick_FALSE;
|
|
116
|
|
117 static ick_bool eolflag = ick_FALSE;
|
|
118
|
|
119 if ((size_t)(lineptr - linebuf) > sizeof linebuf)
|
|
120 ick_lose(IE666, iyylineno, (char *)NULL);
|
|
121
|
|
122 if (bangflag)
|
|
123 {
|
|
124 bangflag = ick_FALSE;
|
|
125 /* *lineptr++ = '!'; */
|
|
126 return('.');
|
|
127 }
|
|
128 else if (backflag) /* converting ctrl-H (backspace) to two chars "^H" */
|
|
129 {
|
|
130 backflag = ick_FALSE;
|
|
131 /* *lineptr++ = '\b'; */
|
|
132 return('H');
|
|
133 }
|
|
134 else
|
|
135 {
|
|
136 int c;
|
|
137 char c_char;
|
|
138 /*fprintf(stderr,"about to fgetc(\045p)",(void*)fp);*/
|
|
139
|
|
140 c_char=0; /* AIS */
|
|
141 (void)fread(&c_char,1,1,fp);
|
|
142 /* AIS: ignore the first \r in a row to deal with DOS newlines. The
|
|
143 second in a row is definitely an error, though, and will be caught
|
|
144 later on. */
|
|
145 if(c_char=='\r') (void)fread(&c_char,1,1,fp);
|
|
146 c = c_char;
|
|
147
|
|
148 if(feof(fp)) c=EOF;
|
|
149 if(!eolflag && c == EOF) c = '\n';
|
|
150
|
|
151 /*fprintf(stderr,"getc input a character: %c\n",c);*/
|
|
152
|
|
153 if (feof(yyin))
|
|
154 {
|
|
155 *lineptr = '\0';
|
|
156 if(eolflag) return(EOF);
|
|
157 if(c=='\0' || c==EOF) c='\n';
|
|
158 }
|
|
159
|
|
160 eolflag = ick_FALSE;
|
|
161
|
|
162 if (c == '!')
|
|
163 {
|
|
164 *lineptr++ = '!';
|
|
165 bangflag = ick_TRUE;
|
|
166 return(c = '\'');
|
|
167 }
|
|
168 else if (c == '\b') /* convert ctrl-H (backspace) to
|
|
169 two chars "^" and "H" so lex can take it */
|
|
170 {
|
|
171 *lineptr++ = '\b';
|
|
172 backflag = ick_TRUE;
|
|
173 return(c = '^');
|
|
174 }
|
|
175 else if (c == '\n')
|
|
176 {
|
|
177 *lineptr = '\0';
|
|
178 lineptr = linebuf;
|
|
179 if (iyylineno >= textlinecount)
|
|
180 {
|
|
181 textlinecount += ALLOC_CHUNK;
|
|
182 if (textlines)
|
|
183 textlines = realloc(textlines,
|
|
184 textlinecount * sizeof(char*));
|
|
185 else
|
|
186 textlines = malloc(textlinecount * sizeof(char*));
|
|
187 if (!textlines)
|
|
188 ick_lose(IE666, iyylineno, (char *)NULL);
|
|
189 }
|
|
190 textlines[iyylineno] = malloc(1 + strlen(linebuf));
|
|
191 if (!textlines[iyylineno])
|
|
192 ick_lose(IE666, iyylineno, (char *)NULL);
|
|
193 strcpy(textlines[iyylineno], linebuf);
|
|
194 iyylineno++;
|
|
195 eolflag=ick_TRUE;
|
|
196 return('\n');
|
|
197 }
|
|
198 else
|
|
199 {
|
|
200 return(*lineptr++ = c);
|
|
201 }
|
|
202 }
|
|
203 }
|
|
204
|
|
205 /* replace YY_INPUT so that it uses our getc function. */
|
|
206 #undef YY_INPUT
|
|
207 #define YY_INPUT(buf,result,max_size) \
|
|
208 { \
|
|
209 int c = getc(yyin); \
|
|
210 if (c == EOF) { \
|
|
211 if (ferror(yyin)) \
|
|
212 YY_FATAL_ERROR("input in flex scanner failed"); \
|
|
213 result = YY_NULL; \
|
|
214 } else { \
|
|
215 buf[0] = c; \
|
|
216 result = 1; \
|
|
217 } \
|
|
218 }
|
|
219
|
|
220 %}
|
|
221
|
|
222 W [\ \t\n]*
|
|
223 D [0-9][\ \t\n0-9]*
|
|
224 I [A-Z]
|
|
225
|
|
226 %%
|
|
227
|
|
228 {D} {yylval.numval = myatoi(yytext); return(NUMBER);}
|
|
229 \_ {return(NOSPOT);}
|
|
230 \. {return(ick_ONESPOT);}
|
|
231 \: {return(ick_TWOSPOT);}
|
|
232 \, {return(ick_TAIL);}
|
|
233 \; {return(ick_HYBRID);}
|
|
234 \# {return(MESH);}
|
|
235
|
|
236 \xBD |
|
|
237 "c^H/" |
|
|
238 "c^H|" {return(MINGLE); /* AIS: CLC-INTERCAL ick_mingle symbols.
|
|
239 The \xBD is ISO-8859-1 for cent. */}
|
|
240 \$ |
|
|
241 \xA2 |
|
|
242 \xA3 |
|
|
243 \xA4 |
|
|
244 \xC2\xA2 |
|
|
245 \xC2\xA3 |
|
|
246 \xC2\xA4 |
|
|
247 \xE2\x82\xA0 |
|
|
248 \xE2\x82\xA1 |
|
|
249 \xE2\x82\xA2 |
|
|
250 \xE2\x82\xA3 |
|
|
251 \xE2\x82\xA4 |
|
|
252 \xE2\x82\xA5 |
|
|
253 \xE2\x82\xA6 |
|
|
254 \xE2\x82\xA7 |
|
|
255 \xE2\x82\xA8 |
|
|
256 \xE2\x82\xA9 |
|
|
257 \xE2\x82\xAA |
|
|
258 \xE2\x82\xAB |
|
|
259 \xE2\x82\xAC |
|
|
260 \xE0\xA7\xB2 |
|
|
261 \xE0\xA7\xB3 |
|
|
262 \xE0\xB8\xBF {return(MINGLE);}
|
|
263
|
|
264 \~ {return(SELECT);}
|
|
265
|
|
266 \/ {return(SLAT); /* AIS: Operand overloading */}
|
|
267 \\ {return(BACKSLAT); /* ditto */}
|
|
268
|
|
269 \& {yylval.numval = AND; return(UNARY);}
|
|
270 V {yylval.numval = OR; return(UNARY);}
|
|
271 \xA5 |
|
|
272 \xBE |
|
|
273 "V^H-" |
|
|
274 \xE2\x88\x80 {yylval.numval = XOR; return(UNARY);
|
|
275 /* AIS: CLC-INTERCAL uses \xBE, ISO-8859-1 for yen;
|
|
276 for some reason, \xA5 is what was detected by the compiler
|
|
277 during my tests, so that's here too */}
|
|
278 \? {if(clclex) yylval.numval = WHIRL;
|
|
279 else yylval.numval = XOR; return(UNARY);
|
|
280 /* AIS: ? is a unary operator in both C-INTERCAL and
|
|
281 CLC-INTERCAL, but with different meanings. */}
|
|
282 \| |
|
|
283 \^ {yylval.numval = FIN; return(UNARY); /* AIS: | is CLC */}
|
|
284 @ {if(clclex) return(NOSPOT); /* AIS: a C/CLC ambiguity */
|
|
285 else {yylval.numval = WHIRL; return(UNARY);}}
|
|
286 [2-5]{W}@ {yylval.numval = WHIRL + myatoi(yytext) - 1; return(UNARY);}
|
|
287
|
|
288 \' {char temp = sparkearsstack[sparkearslev/32]&1;
|
|
289 STACKSPARKEARS(0); /* AIS: I added all mentions of
|
|
290 STACKSPARKEARS, OPEN\(SPARK\|EARS\),
|
|
291 CLOSE\(SPARK\|EARS\),
|
|
292 and CLEARSPARKEARSTACK */
|
|
293 return(temp?OPENSPARK:CLOSESPARK);}
|
|
294 \" {char temp = sparkearsstack[sparkearslev/32]&1;
|
|
295 STACKSPARKEARS(1);
|
|
296 return(temp?CLOSEEARS:OPENEARS);}
|
|
297
|
|
298 \({W}{D}\) {SETLINENO; yylval.numval = myatoi(yytext); return(LABEL);}
|
|
299
|
|
300 DO {SETLINENO; CLEARSPARKEARSTACK; return(DO);}
|
|
301 FAC {SETLINENO; CLEARSPARKEARSTACK; return(DO);}
|
|
302 PLEASE {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);}
|
|
303 PLACET {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);}
|
|
304 PLEASE{W}DO {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);}
|
|
305 PLACET{W}FACERE {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(DO);}
|
|
306 MAYBE {SETLINENO; CLEARSPARKEARSTACK; return(MAYBE);}
|
|
307 MAYBE{W}DO {SETLINENO; CLEARSPARKEARSTACK; return(MAYBE);}
|
|
308 MAYBE{W}PLEASE {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(MAYBE);}
|
|
309 MAYBE{W}PLEASE{W}DO {SETLINENO; CLEARSPARKEARSTACK; politesse++; return(MAYBE);
|
|
310 /* AIS: I added all the MAYBE cases. It seems that MAYBE
|
|
311 has no simple Latin synonym. */}
|
|
312
|
|
313 NOT {return(NOT);}
|
|
314 N\'T {return(NOT);}
|
|
315 NON {return(NOT);}
|
|
316 \xAA {return(NOT); /* AIS: CLC-INTERCAL again, this time it's
|
|
317 ISO-8859-1 for the logical NOT symbol... */}
|
|
318 \xAC {return(NOT); /* ... but my computer translates it to \xAC */}
|
|
319
|
|
320 ONCE {return(ONCE);}
|
|
321 QUONDAM {return(ONCE);}
|
|
322 AGAIN {return(AGAIN);}
|
|
323 ITERUM {return(AGAIN);}
|
|
324
|
|
325 \%{W}{D} {yylval.numval = myatoi(yytext);
|
|
326 if (yylval.numval && yylval.numval < 100)
|
|
327 return(OHOHSEVEN);
|
|
328 else
|
|
329 ick_lose(IE017, iyylineno, (char *)NULL);}
|
|
330 SUB {return(SUB);}
|
|
331 MULTIPLICATUS{W}A |
|
|
332 BY {return(BY);}
|
|
333
|
|
334 \<- {return(GETS);}
|
|
335 CALCULANDUM |
|
|
336 CALCULATING {yylval.numval = GETS; return(GERUND);}
|
|
337
|
|
338 ALIENERE |
|
|
339 FORGET {return(FORGET);}
|
|
340 ALIENENDUM |
|
|
341 FORGETTING {yylval.numval = FORGET; return(GERUND);}
|
|
342 RECOLERE |
|
|
343 RESUME {return(RESUME);}
|
|
344 RECOLERENDUM |
|
|
345 RESUMING {yylval.numval = RESUME; return(GERUND);}
|
|
346 EXUERE |
|
|
347 STASH {return(STASH);}
|
|
348 EXUENDUM |
|
|
349 STASHING {yylval.numval = STASH; return(GERUND);}
|
|
350 INUERE |
|
|
351 RETRIEVE {return(RETRIEVE);}
|
|
352 INUENDUM |
|
|
353 RETRIEVING {yylval.numval = RETRIEVE; return(GERUND);}
|
|
354 DISSIMULARE |
|
|
355 IGNORE {return(IGNORE);}
|
|
356 DISSIMULANDUM |
|
|
357 IGNORING {yylval.numval = IGNORE; return(GERUND);}
|
|
358 MEMINISSE |
|
|
359 REMEMBER {return(REMEMBER);}
|
|
360 MEMINISSENDUM |
|
|
361 REMEMBERING {yylval.numval = REMEMBER; return(GERUND);}
|
|
362 ABSTINERE |
|
|
363 ABSTAIN {return(ABSTAIN);}
|
|
364 ABSTINENDUM |
|
|
365 ABSTAINING {yylval.numval = ABSTAIN; return(GERUND);}
|
|
366 REINSTARE |
|
|
367 REINSTATE {return(REINSTATE);}
|
|
368 REINSTATANDUM |
|
|
369 REINSTATING {yylval.numval = REINSTATE; return(GERUND);}
|
|
370 LEGERE{W}EX |
|
|
371 READ{W}OUT {return(READ_OUT);}
|
|
372 LEGENDUM |
|
|
373 READING{W}OUT {yylval.numval = READ_OUT; return(GERUND);}
|
|
374 SCRIBERE{W}IN |
|
|
375 WRITE{W}IN {return(WRITE_IN);}
|
|
376 SCRIBENDUM |
|
|
377 WRITING{W}IN {yylval.numval = WRITE_IN; return(GERUND);}
|
|
378 COMMEMERO |
|
|
379 COMMENTS |
|
|
380 COMMENTING |
|
|
381 COMMENT {yylval.numval = UNKNOWN; return(GERUND);
|
|
382 /* AIS: An idea stolen from CLC-INTERCAL.
|
|
383 The Latin means literally 'remind' or 'mention'. */}
|
|
384 PIN {/* By AIS. I can't find a Latin translation for this. */
|
|
385 return(PIN);}
|
|
386 PINNING {/* By AIS */ yylval.numval = PIN; return(GERUND);}
|
|
387 DEINDERE{W}A{W}\({W}{D}\) |
|
|
388 NEXT{W}FROM{W}\({W}{D}\) {/* AIS */ yylval.numval = myatoi(yytext);
|
|
389 return(NEXTFROMLABEL);}
|
|
390 DEINDERE{W}A |
|
|
391 NEXT{W}FROM {/* AIS: 'next' is not a verb, so the Latin is invented */
|
|
392 return(NEXTFROMEXPR);}
|
|
393 DEINDENDUM |
|
|
394 NEXTING{W}FROM {/* AIS */ yylval.numval = NEXTFROMLABEL; return(GERUND);}
|
|
395 ADVENIRE{W}DE{W}\({W}{D}\) |
|
|
396 COME{W}FROM{W}\({W}{D}\) {/* AIS */ yylval.numval = myatoi(yytext);
|
|
397 return(COME_FROM);}
|
|
398 ADVENIRE{W}DE |
|
|
399 COME{W}FROM {/* AIS */ return(COMPUCOME);}
|
|
400 ADVENENDUM |
|
|
401 COMING{W}FROM {yylval.numval = COME_FROM; return(GERUND);}
|
|
402 DEINDE |
|
|
403 NEXT {stbeginline = 0; return(NEXT);}
|
|
404 PROXIMANDUM |
|
|
405 NEXTING {yylval.numval = NEXT; return(GERUND);}
|
|
406 FROM {return(FROM); /* AIS: Latin is 'A', which confuses the rest
|
|
407 of the parser */}
|
|
408 CONCEDERE |
|
|
409 DESPERARE |
|
|
410 GIVE{W}UP {return(GIVE_UP);}
|
|
411 CONOR{W}ITERUM |
|
|
412 TRY{W}AGAIN {return(TRY_AGAIN);}
|
|
413 WHILE {return(WHILE); /* AIS. Latin for this is needed. */}
|
|
414 WHILING |
|
|
415 LOOPING {yylval.numval = WHILE; return(GERUND);}
|
|
416 TRYING{W}AGAIN {yylval.numval = TRY_AGAIN; return(GERUND);}
|
|
417 GO{W}BACK |
|
|
418 REDIRE {return(GO_BACK);}
|
|
419 GOING{W}BACK |
|
|
420 REDENDUM {yylval.numval = GO_BACK; return(GERUND);}
|
|
421 GO{W}AHEAD |
|
|
422 GRASSOR {return(GO_AHEAD);}
|
|
423 GOING{W}AHEAD {yylval.numval = GO_AHEAD; return(GERUND);
|
|
424 /* AIS: I'm having a few deponent troubles with the Latin, so
|
|
425 there are no Latin gerunds around here. Besides, the Latin
|
|
426 'gerunds' look somewhat like gerundives to me, but that's
|
|
427 purely based on memory so I may be wrong. */}
|
|
428 CREATE{W}\({W}{D}\) |
|
|
429 CONFICE{W}\({W}{D}\) {yylval.numval = myatoi(yytext); return(CREATE);}
|
|
430 CREATE |
|
|
431 CONFICE {return(COMPUCREATE);}
|
|
432 CREATING |
|
|
433 CREATION |
|
|
434 CONFICENDUM {yylval.numval = CREATE; return(GERUND);}
|
|
435
|
|
436 \+ {return(INTERSECTION);}
|
|
437
|
|
438 {W} ;
|
|
439 {I} {/* AIS */ yylval.numval = *yytext; return(UNKNOWNID);}
|
|
440 .\^H. {/* AIS */ yylval.numval = yytext[0]*256 + yytext[3];
|
|
441 if(yytext[0] > yytext[3])
|
|
442 yylval.numval = yytext[0] + yytext[3]*256;
|
|
443 return(BADCHAR);}
|
|
444 . {yylval.numval = yytext[0]; /* AIS: The line below for debug */
|
|
445 if(yydebug) fprintf(stdout, "yylex: bad char %#x\n",(unsigned char)yytext[0]);
|
|
446 return(BADCHAR);}
|
|
447
|
|
448
|
|
449 %%
|
|
450
|
|
451 int lexer(void)
|
|
452 {
|
|
453 static int tok = BADCHAR;
|
|
454
|
|
455 if (re_send_token)
|
|
456 re_send_token = ick_FALSE;
|
|
457 else
|
|
458 {
|
|
459 tok = yylex();
|
|
460 #ifdef YYDEBUG
|
|
461 if (yydebug)
|
|
462 (void) fprintf(stdout, "yylex: returning token %d\n", tok);
|
|
463 #endif /* YYDEBUG */
|
|
464 }
|
|
465
|
|
466 #ifdef YYDEBUG
|
|
467 if (yydebug)
|
|
468 (void) fprintf(stdout, "lexer: returning token %d\n", tok);
|
|
469 #endif /* YYDEBUG */
|
|
470 return(tok);
|
|
471 }
|
|
472
|
|
473 static int myatoi(const char *text) /* AIS */
|
|
474 {
|
|
475 #define MAXTEXT 100
|
|
476 static char buf[MAXTEXT];
|
|
477 static char thinbuf[MAXTEXT];
|
|
478 char* bp;
|
|
479 char* tp;
|
|
480 register int i;
|
|
481
|
|
482 for(buf[i = 0] = '\0';*text && i < MAXTEXT;text++) {
|
|
483 if(isdigit(*text)) {
|
|
484 buf[i++] = *text;
|
|
485 }
|
|
486 }
|
|
487 buf[i] = '\0';
|
|
488 bp=buf; tp=thinbuf;
|
|
489 while(((*tp++=*bp++))); /* thinbuf code added by an AIS
|
|
490 in case we want to work with wchar_t;
|
|
491 the extra brackets tell GCC that this is
|
|
492 intended and not a mistaken assignment */
|
|
493 return atoi(thinbuf);
|
|
494 }
|
|
495
|
|
496 void yyerror(const char *errtype)
|
|
497 {
|
|
498 #ifdef MAIN
|
|
499 (void) printf("lextest: lexer error: %s.\n", errtype);
|
|
500 #else /* MAIN */
|
|
501 (void) errtype;
|
|
502 #endif /* MAIN */
|
|
503 }
|
|
504
|
|
505 #ifdef MAIN
|
|
506 int ick_main(void)
|
|
507 {
|
|
508 int t;
|
|
509
|
|
510 while ((t = yylex()) > 0)
|
|
511 {
|
|
512 (void) printf("%03d %09d\n", t, yylval.numval);
|
|
513 yylval.numval = 0;
|
|
514 }
|
|
515 return 0;
|
|
516 }
|
|
517 #endif /* MAIN */
|