]> git.sur5r.net Git - cc65/blob - src/cc65/scanner.c
Fixed a bug
[cc65] / src / cc65 / scanner.c
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 scanner.c                                 */
4 /*                                                                           */
5 /*                      Source file line info structure                      */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1998-2003 Ullrich von Bassewitz                                       */
10 /*               Römerstrasse 52                                             */
11 /*               D-70794 Filderstadt                                         */
12 /* EMail:        uz@cc65.org                                                 */
13 /*                                                                           */
14 /*                                                                           */
15 /* This software is provided 'as-is', without any expressed or implied       */
16 /* warranty.  In no event will the authors be held liable for any damages    */
17 /* arising from the use of this software.                                    */
18 /*                                                                           */
19 /* Permission is granted to anyone to use this software for any purpose,     */
20 /* including commercial applications, and to alter it and redistribute it    */
21 /* freely, subject to the following restrictions:                            */
22 /*                                                                           */
23 /* 1. The origin of this software must not be misrepresented; you must not   */
24 /*    claim that you wrote the original software. If you use this software   */
25 /*    in a product, an acknowledgment in the product documentation would be  */
26 /*    appreciated but is not required.                                       */
27 /* 2. Altered source versions must be plainly marked as such, and must not   */
28 /*    be misrepresented as being the original software.                      */
29 /* 3. This notice may not be removed or altered from any source              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #include <stdio.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <errno.h>
40 #include <ctype.h>
41
42 /* common */
43 #include "chartype.h"
44 #include "tgttrans.h"
45
46 /* cc65 */
47 #include "datatype.h"
48 #include "error.h"
49 #include "function.h"
50 #include "global.h"
51 #include "hexval.h"
52 #include "ident.h"
53 #include "input.h"
54 #include "litpool.h"
55 #include "preproc.h"
56 #include "symtab.h"
57 #include "util.h"
58 #include "scanner.h"
59
60
61
62 /*****************************************************************************/
63 /*                                   data                                    */
64 /*****************************************************************************/
65
66
67
68 Token CurTok;           /* The current token */
69 Token NextTok;          /* The next token */
70
71
72
73 /* Token types */
74 #define TT_C    0               /* ANSI C token */
75 #define TT_EXT  1               /* cc65 extension */
76
77 /* Token table */
78 static const struct Keyword {
79     char*           Key;        /* Keyword name */
80     unsigned char   Tok;        /* The token */
81     unsigned char   Type;       /* Token type */
82 } Keywords [] = {
83     { "_Pragma",        TOK_PRAGMA,     TT_C    },
84     { "__AX__",         TOK_AX,         TT_C    },
85     { "__EAX__",        TOK_EAX,        TT_C    },
86     { "__A__",          TOK_A,          TT_C    },
87     { "__X__",          TOK_X,          TT_C    },
88     { "__Y__",          TOK_Y,          TT_C    },
89     { "__asm__",        TOK_ASM,        TT_C    },
90     { "__attribute__",  TOK_ATTRIBUTE,  TT_C    },
91     { "__far__",        TOK_FAR,        TT_C    },
92     { "__fastcall__",   TOK_FASTCALL,   TT_C    },
93     { "__near__",       TOK_NEAR,       TT_C    },
94     { "asm",            TOK_ASM,        TT_EXT  },
95     { "auto",           TOK_AUTO,       TT_C    },
96     { "break",          TOK_BREAK,      TT_C    },
97     { "case",           TOK_CASE,       TT_C    },
98     { "char",           TOK_CHAR,       TT_C    },
99     { "const",          TOK_CONST,      TT_C    },
100     { "continue",       TOK_CONTINUE,   TT_C    },
101     { "default",        TOK_DEFAULT,    TT_C    },
102     { "do",             TOK_DO,         TT_C    },
103     { "double",         TOK_DOUBLE,     TT_C    },
104     { "else",           TOK_ELSE,       TT_C    },
105     { "enum",           TOK_ENUM,       TT_C    },
106     { "extern",         TOK_EXTERN,     TT_C    },
107     { "far",            TOK_FAR,        TT_EXT  },
108     { "fastcall",       TOK_FASTCALL,   TT_EXT  },
109     { "float",          TOK_FLOAT,      TT_C    },
110     { "for",            TOK_FOR,        TT_C    },
111     { "goto",           TOK_GOTO,       TT_C    },
112     { "if",             TOK_IF,         TT_C    },
113     { "int",            TOK_INT,        TT_C    },
114     { "long",           TOK_LONG,       TT_C    },
115     { "near",           TOK_NEAR,       TT_EXT  },
116     { "register",       TOK_REGISTER,   TT_C    },
117     { "restrict",       TOK_RESTRICT,   TT_C    },
118     { "return",         TOK_RETURN,     TT_C    },
119     { "short",          TOK_SHORT,      TT_C    },
120     { "signed",         TOK_SIGNED,     TT_C    },
121     { "sizeof",         TOK_SIZEOF,     TT_C    },
122     { "static",         TOK_STATIC,     TT_C    },
123     { "struct",         TOK_STRUCT,     TT_C    },
124     { "switch",         TOK_SWITCH,     TT_C    },
125     { "typedef",        TOK_TYPEDEF,    TT_C    },
126     { "union",          TOK_UNION,      TT_C    },
127     { "unsigned",       TOK_UNSIGNED,   TT_C    },
128     { "void",           TOK_VOID,       TT_C    },
129     { "volatile",       TOK_VOLATILE,   TT_C    },
130     { "while",          TOK_WHILE,      TT_C    },
131 };
132 #define KEY_COUNT       (sizeof (Keywords) / sizeof (Keywords [0]))
133
134
135
136 /* Stuff for determining the type of an integer constant */
137 #define IT_INT          0x01
138 #define IT_UINT         0x02
139 #define IT_LONG         0x04
140 #define IT_ULONG        0x08
141
142
143
144 /*****************************************************************************/
145 /*                                   code                                    */
146 /*****************************************************************************/
147
148
149
150 static int CmpKey (const void* Key, const void* Elem)
151 /* Compare function for bsearch */
152 {
153     return strcmp ((const char*) Key, ((const struct Keyword*) Elem)->Key);
154 }
155
156
157
158 static int FindKey (const char* Key)
159 /* Find a keyword and return the token. Return IDENT if the token is not a
160  * keyword.
161  */
162 {
163     struct Keyword* K;
164     K = bsearch (Key, Keywords, KEY_COUNT, sizeof (Keywords [0]), CmpKey);
165     if (K && (K->Type != TT_EXT || ANSI == 0)) {
166         return K->Tok;
167     } else {
168         return TOK_IDENT;
169     }
170 }
171
172
173
174 static int SkipWhite (void)
175 /* Skip white space in the input stream, reading and preprocessing new lines
176  * if necessary. Return 0 if end of file is reached, return 1 otherwise.
177  */
178 {
179     while (1) {
180         while (CurC == 0) {
181             if (NextLine () == 0) {
182                 return 0;
183             }
184             Preprocess ();
185         }
186         if (IsSpace (CurC)) {
187             NextChar ();
188         } else {
189             return 1;
190         }
191     }
192 }
193
194
195
196 void SymName (char* s)
197 /* Get symbol from input stream */
198 {
199     unsigned k = 0;
200     do {
201         if (k != MAX_IDENTLEN) {
202             ++k;
203             *s++ = CurC;
204         }
205         NextChar ();
206     } while (IsIdent (CurC) || IsDigit (CurC));
207     *s = '\0';
208 }
209
210
211
212 int IsSym (char *s)
213 /* Get symbol from input stream or return 0 if not a symbol. */
214 {
215     if (IsIdent (CurC)) {
216         SymName (s);
217         return 1;
218     } else {
219         return 0;
220     }
221 }
222
223
224
225 static void UnknownChar (char C)
226 /* Error message for unknown character */
227 {
228     Error ("Invalid input character with code %02X", C & 0xFF);
229     NextChar ();                        /* Skip */
230 }
231
232
233
234 static void SetTok (int tok)
235 /* Set NextTok.Tok and bump line ptr */
236 {
237     NextTok.Tok = tok;
238     NextChar ();
239 }
240
241
242
243 static int ParseChar (void)
244 /* Parse a character. Converts \n into EOL, etc. */
245 {
246     int i;
247     unsigned val;
248     int C;
249
250     /* Check for escape chars */
251     if (CurC == '\\') {
252         NextChar ();
253         switch (CurC) {
254             case 'b':
255                 C = '\b';
256                 break;
257             case 'f':
258                 C = '\f';
259                 break;
260             case 'r':
261                 C = '\r';
262                 break;
263             case 'n':
264                 C = '\n';
265                 break;
266             case 't':
267                 C = '\t';
268                 break;
269             case '\"':
270                 C = '\"';
271                 break;
272             case '\'':
273                 C = '\'';
274                 break;
275             case '\\':
276                 C = '\\';
277                 break;
278             case 'x':
279             case 'X':
280                 /* Hex character constant */
281                 NextChar ();
282                 val = HexVal (CurC) << 4;
283                 NextChar ();
284                 C = val | HexVal (CurC);        /* Do not translate */
285                 break;
286             case '0':
287             case '1':
288             case '2':
289             case '3':
290                 /* Octal constant */
291                 i = 0;
292                 C = CurC - '0';
293                 while (NextC >= '0' && NextC <= '7' && i++ < 4) {
294                     NextChar ();
295                     C = (C << 3) | (CurC - '0');
296                 }
297                 break;
298             default:
299                 Error ("Illegal character constant");
300                 C = ' ';
301                 break;
302         }
303     } else {
304         C = CurC;
305     }
306
307     /* Skip the character read */
308     NextChar ();
309
310     /* Do correct sign extension */
311     return SignExtendChar (C);
312 }
313
314
315
316 static void CharConst (void)
317 /* Parse a character constant. */
318 {
319     int C;
320
321     /* Skip the quote */
322     NextChar ();
323
324     /* Get character */
325     C = ParseChar ();
326
327     /* Check for closing quote */
328     if (CurC != '\'') {
329         Error ("`\'' expected");
330     } else {
331         /* Skip the quote */
332         NextChar ();
333     }
334
335     /* Setup values and attributes */
336     NextTok.Tok  = TOK_CCONST;
337
338     /* Translate into target charset */
339     NextTok.IVal = SignExtendChar (TgtTranslateChar (C));
340
341     /* Character constants have type int */
342     NextTok.Type = type_int;
343 }
344
345
346
347 static void StringConst (void)
348 /* Parse a quoted string */
349 {
350     NextTok.IVal = GetLiteralPoolOffs ();
351     NextTok.Tok  = TOK_SCONST;
352
353     /* Be sure to concatenate strings */
354     while (CurC == '\"') {
355
356         /* Skip the quote char */
357         NextChar ();
358
359         while (CurC != '\"') {
360             if (CurC == '\0') {
361                 Error ("Unexpected newline");
362                 break;
363             }
364             AddLiteralChar (ParseChar ());
365         }
366
367         /* Skip closing quote char if there was one */
368         NextChar ();
369
370         /* Skip white space, read new input */
371         SkipWhite ();
372
373     }
374
375     /* Terminate the string */
376     AddLiteralChar ('\0');
377 }
378
379
380
381 void NextToken (void)
382 /* Get next token from input stream */
383 {
384     ident token;
385
386     /* We have to skip white space here before shifting tokens, since the
387      * tokens and the current line info is invalid at startup and will get
388      * initialized by reading the first time from the file. Remember if
389      * we were at end of input and handle that later.
390      */
391     int GotEOF = (SkipWhite() == 0);
392
393     /* Current token is the lookahead token */
394     if (CurTok.LI) {
395         ReleaseLineInfo (CurTok.LI);
396     }
397     CurTok = NextTok;
398
399     /* Remember the starting position of the next token */
400     NextTok.LI = UseLineInfo (GetCurLineInfo ());
401
402     /* Now handle end of input. */
403     if (GotEOF) {
404         /* End of file reached */
405         NextTok.Tok = TOK_CEOF;
406         return;
407     }
408
409     /* Determine the next token from the lookahead */
410     if (IsDigit (CurC)) {
411
412         /* A number */
413         int HaveSuffix;         /* True if we have a type suffix */
414         unsigned types;         /* Possible types */
415         unsigned Base;
416         unsigned DigitVal;
417         unsigned long k;        /* Value */
418
419         k     = 0;
420         Base  = 10;
421         types = IT_INT | IT_LONG | IT_ULONG;
422
423         if (CurC == '0') {
424             /* Octal or hex constants may also be of type unsigned int */
425             types = IT_INT | IT_UINT | IT_LONG | IT_ULONG;
426             /* gobble 0 and examin next char */
427             NextChar ();
428             if (toupper (CurC) == 'X') {
429                 Base = 16;
430                 NextTok.Type = type_uint;
431                 NextChar ();    /* gobble "x" */
432             } else {
433                 Base = 8;
434             }
435         }
436         while (IsXDigit (CurC) && (DigitVal = HexVal (CurC)) < Base) {
437             k = k * Base + DigitVal;
438             NextChar ();
439         }
440         /* Check for errorneous digits */
441         if (Base == 8 && IsDigit (CurC)) {
442             Error ("Numeric constant contains digits beyond the radix");
443             /* Do error recovery */
444             do {
445                 NextChar ();
446             } while (IsDigit (CurC));
447         } else if (Base != 16 && IsXDigit (CurC)) {
448             Error ("Nondigits in number and not hexadecimal");
449             do {
450                 NextChar ();
451             } while (IsXDigit (CurC));
452         }
453
454         /* Check for a suffix */
455         HaveSuffix = 1;
456         if (CurC == 'u' || CurC == 'U') {
457             /* Unsigned type */
458             NextChar ();
459             if (toupper (CurC) != 'L') {
460                 types = IT_UINT | IT_ULONG;
461             } else {
462                 NextChar ();
463                 types = IT_ULONG;
464             }
465         } else if (CurC == 'l' || CurC == 'L') {
466             /* Long type */
467             NextChar ();
468             if (toupper (CurC) != 'U') {
469                 types = IT_LONG | IT_ULONG;
470             } else {
471                 NextChar ();
472                 types = IT_ULONG;
473             }
474         } else {
475             HaveSuffix = 0;
476         }
477
478         /* Check the range to determine the type */
479         if (k > 0x7FFF) {
480             /* Out of range for int */
481             types &= ~IT_INT;
482             /* If the value is in the range 0x8000..0xFFFF, unsigned int is not
483              * allowed, and we don't have a type specifying suffix, emit a
484              * warning.
485              */
486             if (k <= 0xFFFF && (types & IT_UINT) == 0 && !HaveSuffix) {
487                 Warning ("Constant is long");
488             }
489         }
490         if (k > 0xFFFF) {
491             /* Out of range for unsigned int */
492             types &= ~IT_UINT;
493         }
494         if (k > 0x7FFFFFFF) {
495             /* Out of range for long int */
496             types &= ~IT_LONG;
497         }
498
499         /* Now set the type string to the smallest type in types */
500         if (types & IT_INT) {
501             NextTok.Type = type_int;
502         } else if (types & IT_UINT) {
503             NextTok.Type = type_uint;
504         } else if (types & IT_LONG) {
505             NextTok.Type = type_long;
506         } else {
507             NextTok.Type = type_ulong;
508         }
509
510         /* Set the value and the token */
511         NextTok.IVal = k;
512         NextTok.Tok  = TOK_ICONST;
513         return;
514     }
515
516     if (IsSym (token)) {
517
518         /* Check for a keyword */
519         if ((NextTok.Tok = FindKey (token)) != TOK_IDENT) {
520             /* Reserved word found */
521             return;
522         }
523         /* No reserved word, check for special symbols */
524         if (token [0] == '_') {
525             /* Special symbols */
526             if (strcmp (token, "__FILE__") == 0) {
527                 NextTok.IVal = AddLiteral (GetCurrentFile());
528                 NextTok.Tok  = TOK_SCONST;
529                 return;
530             } else if (strcmp (token, "__LINE__") == 0) {
531                 NextTok.Tok  = TOK_ICONST;
532                 NextTok.IVal = GetCurrentLine();
533                 NextTok.Type = type_int;
534                 return;
535             } else if (strcmp (token, "__func__") == 0) {
536                 /* __func__ is only defined in functions */
537                 if (CurrentFunc) {
538                     NextTok.IVal = AddLiteral (F_GetFuncName (CurrentFunc));
539                     NextTok.Tok  = TOK_SCONST;
540                     return;
541                 }
542             }
543         }
544
545         /* No reserved word but identifier */
546         strcpy (NextTok.Ident, token);
547         NextTok.Tok = TOK_IDENT;
548         return;
549     }
550
551     /* Monstrous switch statement ahead... */
552     switch (CurC) {
553
554         case '!':
555             NextChar ();
556             if (CurC == '=') {
557                 SetTok (TOK_NE);
558             } else {
559                 NextTok.Tok = TOK_BOOL_NOT;
560             }
561             break;
562
563         case '\"':
564             StringConst ();
565             break;
566
567         case '%':
568             NextChar ();
569             if (CurC == '=') {
570                 SetTok (TOK_MOD_ASSIGN);
571             } else {
572                 NextTok.Tok = TOK_MOD;
573             }
574             break;
575
576         case '&':
577             NextChar ();
578             switch (CurC) {
579                 case '&':
580                     SetTok (TOK_BOOL_AND);
581                     break;
582                 case '=':
583                     SetTok (TOK_AND_ASSIGN);
584                     break;
585                 default:
586                     NextTok.Tok = TOK_AND;
587             }
588             break;
589
590         case '\'':
591             CharConst ();
592             break;
593
594         case '(':
595             SetTok (TOK_LPAREN);
596             break;
597
598         case ')':
599             SetTok (TOK_RPAREN);
600             break;
601
602         case '*':
603             NextChar ();
604             if (CurC == '=') {
605                 SetTok (TOK_MUL_ASSIGN);
606             } else {
607                 NextTok.Tok = TOK_STAR;
608             }
609             break;
610
611         case '+':
612             NextChar ();
613             switch (CurC) {
614                 case '+':
615                     SetTok (TOK_INC);
616                     break;
617                 case '=':
618                     SetTok (TOK_PLUS_ASSIGN);
619                     break;
620                 default:
621                     NextTok.Tok = TOK_PLUS;
622             }
623             break;
624
625         case ',':
626             SetTok (TOK_COMMA);
627             break;
628
629         case '-':
630             NextChar ();
631             switch (CurC) {
632                 case '-':
633                     SetTok (TOK_DEC);
634                     break;
635                 case '=':
636                     SetTok (TOK_MINUS_ASSIGN);
637                     break;
638                 case '>':
639                     SetTok (TOK_PTR_REF);
640                     break;
641                 default:
642                     NextTok.Tok = TOK_MINUS;
643             }
644             break;
645
646         case '.':
647             NextChar ();
648             if (CurC == '.') {
649                 NextChar ();
650                 if (CurC == '.') {
651                     SetTok (TOK_ELLIPSIS);
652                 } else {
653                     UnknownChar (CurC);
654                 }
655             } else {
656                 NextTok.Tok = TOK_DOT;
657             }
658             break;
659
660         case '/':
661             NextChar ();
662             if (CurC == '=') {
663                 SetTok (TOK_DIV_ASSIGN);
664             } else {
665                 NextTok.Tok = TOK_DIV;
666             }
667             break;
668
669         case ':':
670             SetTok (TOK_COLON);
671             break;
672
673         case ';':
674             SetTok (TOK_SEMI);
675             break;
676
677         case '<':
678             NextChar ();
679             switch (CurC) {
680                 case '=':
681                     SetTok (TOK_LE);
682                     break;
683                 case '<':
684                     NextChar ();
685                     if (CurC == '=') {
686                         SetTok (TOK_SHL_ASSIGN);
687                     } else {
688                         NextTok.Tok = TOK_SHL;
689                     }
690                     break;
691                 default:
692                     NextTok.Tok = TOK_LT;
693             }
694             break;
695
696         case '=':
697             NextChar ();
698             if (CurC == '=') {
699                 SetTok (TOK_EQ);
700             } else {
701                 NextTok.Tok = TOK_ASSIGN;
702             }
703             break;
704
705         case '>':
706             NextChar ();
707             switch (CurC) {
708                 case '=':
709                     SetTok (TOK_GE);
710                     break;
711                 case '>':
712                     NextChar ();
713                     if (CurC == '=') {
714                         SetTok (TOK_SHR_ASSIGN);
715                     } else {
716                         NextTok.Tok = TOK_SHR;
717                     }
718                     break;
719                 default:
720                     NextTok.Tok = TOK_GT;
721             }
722             break;
723
724         case '?':
725             SetTok (TOK_QUEST);
726             break;
727
728         case '[':
729             SetTok (TOK_LBRACK);
730             break;
731
732         case ']':
733             SetTok (TOK_RBRACK);
734             break;
735
736         case '^':
737             NextChar ();
738             if (CurC == '=') {
739                 SetTok (TOK_XOR_ASSIGN);
740             } else {
741                 NextTok.Tok = TOK_XOR;
742             }
743             break;
744
745         case '{':
746             SetTok (TOK_LCURLY);
747             break;
748
749         case '|':
750             NextChar ();
751             switch (CurC) {
752                 case '|':
753                     SetTok (TOK_BOOL_OR);
754                     break;
755                 case '=':
756                     SetTok (TOK_OR_ASSIGN);
757                     break;
758                 default:
759                     NextTok.Tok = TOK_OR;
760             }
761             break;
762
763         case '}':
764             SetTok (TOK_RCURLY);
765             break;
766
767         case '~':
768             SetTok (TOK_COMP);
769             break;
770
771         default:
772             UnknownChar (CurC);
773
774     }
775
776 }
777
778
779
780 void SkipTokens (const token_t* TokenList, unsigned TokenCount)
781 /* Skip tokens until we reach TOK_CEOF or a token in the given token list.
782  * This routine is used for error recovery.
783  */
784 {
785     while (CurTok.Tok != TOK_CEOF) {
786
787         /* Check if the current token is in the token list */
788         unsigned I;
789         for (I = 0; I < TokenCount; ++I) {
790             if (CurTok.Tok == TokenList[I]) {
791                 /* Found a token in the list */
792                 return;
793             }
794         }
795
796         /* Not in the list: Skip it */
797         NextToken ();
798
799     }
800 }
801
802
803
804 int Consume (token_t Token, const char* ErrorMsg)
805 /* Eat token if it is the next in the input stream, otherwise print an error
806  * message. Returns true if the token was found and false otherwise.
807  */
808 {
809     if (CurTok.Tok == Token) {
810         NextToken ();
811         return 1;
812     } else {
813         Error (ErrorMsg);
814         return 0;
815     }
816 }
817
818
819
820 int ConsumeColon (void)
821 /* Check for a colon and skip it. */
822 {
823     return Consume (TOK_COLON, "`:' expected");
824 }
825
826
827
828 int ConsumeSemi (void)
829 /* Check for a semicolon and skip it. */
830 {
831     /* Try do be smart about typos... */
832     if (CurTok.Tok == TOK_SEMI) {
833         NextToken ();
834         return 1;
835     } else {
836         Error ("`;' expected");
837         if (CurTok.Tok == TOK_COLON || CurTok.Tok == TOK_COMMA) {
838             NextToken ();
839         }
840         return 0;
841     }
842 }
843
844
845
846 int ConsumeComma (void)
847 /* Check for a comma and skip it. */
848 {
849     /* Try do be smart about typos... */
850     if (CurTok.Tok == TOK_COMMA) {
851         NextToken ();
852         return 1;
853     } else {
854         Error ("`,' expected");
855         if (CurTok.Tok == TOK_SEMI) {
856             NextToken ();
857         }
858         return 0;
859     }
860 }
861
862
863
864 int ConsumeLParen (void)
865 /* Check for a left parenthesis and skip it */
866 {
867     return Consume (TOK_LPAREN, "`(' expected");
868 }
869
870
871
872 int ConsumeRParen (void)
873 /* Check for a right parenthesis and skip it */
874 {
875     return Consume (TOK_RPAREN, "`)' expected");
876 }
877
878
879
880 int ConsumeLBrack (void)
881 /* Check for a left bracket and skip it */
882 {
883     return Consume (TOK_LBRACK, "`[' expected");
884 }
885
886
887
888 int ConsumeRBrack (void)
889 /* Check for a right bracket and skip it */
890 {
891     return Consume (TOK_RBRACK, "`]' expected");
892 }
893
894
895
896 int ConsumeLCurly (void)
897 /* Check for a left curly brace and skip it */
898 {
899     return Consume (TOK_LCURLY, "`{' expected");
900 }
901
902
903
904 int ConsumeRCurly (void)
905 /* Check for a right curly brace and skip it */
906 {
907     return Consume (TOK_RCURLY, "`}' expected");
908 }
909
910
911