c++: add fixed test [PR94100]
[official-gcc.git] / gcc / m2 / mc-boot / GmcLexBuf.cc
blob4f2293165aea49d692f6a43b22d03d29daf895b4
1 /* do not edit automatically generated by mc from mcLexBuf. */
2 /* mcLexBuf.mod provides a buffer for the all the tokens created by m2.lex.
4 Copyright (C) 2015-2025 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 This file is part of GNU Modula-2.
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.
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.
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/>. */
23 #include "config.h"
24 #include "system.h"
25 #include <stdbool.h>
26 # if !defined (PROC_D)
27 # define PROC_D
28 typedef void (*PROC_t) (void);
29 typedef struct { PROC_t proc; } PROC;
30 # endif
32 # if !defined (TRUE)
33 # define TRUE (1==1)
34 # endif
36 # if !defined (FALSE)
37 # define FALSE (1==0)
38 # endif
40 # include "GStorage.h"
41 #if defined(__cplusplus)
42 # undef NULL
43 # define NULL 0
44 #endif
45 #define _mcLexBuf_C
47 #include "GmcLexBuf.h"
48 # include "Gmcflex.h"
49 # include "Glibc.h"
50 # include "GSYSTEM.h"
51 # include "GStorage.h"
52 # include "GDynamicStrings.h"
53 # include "GFormatStrings.h"
54 # include "GnameKey.h"
55 # include "GmcReserved.h"
56 # include "GmcComment.h"
57 # include "GmcPrintf.h"
58 # include "GmcDebug.h"
59 # include "GM2RTS.h"
61 # define MaxBucketSize 100
62 # define Debugging false
63 typedef struct mcLexBuf_tokenDesc_r mcLexBuf_tokenDesc;
65 typedef struct mcLexBuf_listDesc_r mcLexBuf_listDesc;
67 typedef struct mcLexBuf__T1_r mcLexBuf__T1;
69 typedef mcLexBuf__T1 *mcLexBuf_sourceList;
71 typedef struct mcLexBuf__T2_r mcLexBuf__T2;
73 typedef mcLexBuf__T2 *mcLexBuf_tokenBucket;
75 typedef struct mcLexBuf__T3_a mcLexBuf__T3;
77 struct mcLexBuf_tokenDesc_r {
78 mcReserved_toktype token;
79 nameKey_Name str;
80 int int_;
81 mcComment_commentDesc com;
82 unsigned int line;
83 unsigned int col;
84 mcLexBuf_sourceList file;
87 struct mcLexBuf_listDesc_r {
88 mcLexBuf_tokenBucket head;
89 mcLexBuf_tokenBucket tail;
90 unsigned int lastBucketOffset;
93 struct mcLexBuf__T1_r {
94 mcLexBuf_sourceList left;
95 mcLexBuf_sourceList right;
96 DynamicStrings_String name;
97 unsigned int line;
98 unsigned int col;
101 struct mcLexBuf__T3_a { mcLexBuf_tokenDesc array[MaxBucketSize+1]; };
102 struct mcLexBuf__T2_r {
103 mcLexBuf__T3 buf;
104 unsigned int len;
105 mcLexBuf_tokenBucket next;
108 static mcComment_commentDesc procedureComment;
109 static mcComment_commentDesc bodyComment;
110 static mcComment_commentDesc afterComment;
111 static mcLexBuf_sourceList currentSource;
112 static bool useBufferedTokens;
113 static bool currentUsed;
114 static mcLexBuf_listDesc listOfTokens;
115 static unsigned int nextTokNo;
118 getProcedureComment - returns the procedure comment if it exists,
119 or NIL otherwise.
122 extern "C" mcComment_commentDesc mcLexBuf_getProcedureComment (void);
125 getBodyComment - returns the body comment if it exists,
126 or NIL otherwise. The body comment is
127 removed if found.
130 extern "C" mcComment_commentDesc mcLexBuf_getBodyComment (void);
133 getAfterComment - returns the after comment if it exists,
134 or NIL otherwise. The after comment is
135 removed if found.
138 extern "C" mcComment_commentDesc mcLexBuf_getAfterComment (void);
141 openSource - attempts to open the source file, s.
142 The success of the operation is returned.
145 extern "C" bool mcLexBuf_openSource (DynamicStrings_String s);
148 closeSource - closes the current open file.
151 extern "C" void mcLexBuf_closeSource (void);
154 reInitialize - re-initialize the all the data structures.
157 extern "C" void mcLexBuf_reInitialize (void);
160 resetForNewPass - reset the buffer pointers to the beginning ready for
161 a new pass
164 extern "C" void mcLexBuf_resetForNewPass (void);
167 getToken - gets the next token into currenttoken.
170 extern "C" void mcLexBuf_getToken (void);
173 insertToken - inserts a symbol, token, infront of the current token
174 ready for the next pass.
177 extern "C" void mcLexBuf_insertToken (mcReserved_toktype token);
180 insertTokenAndRewind - inserts a symbol, token, infront of the current token
181 and then moves the token stream back onto the inserted token.
184 extern "C" void mcLexBuf_insertTokenAndRewind (mcReserved_toktype token);
187 getPreviousTokenLineNo - returns the line number of the previous token.
190 extern "C" unsigned int mcLexBuf_getPreviousTokenLineNo (void);
193 getLineNo - returns the current line number where the symbol occurs in
194 the source file.
197 extern "C" unsigned int mcLexBuf_getLineNo (void);
200 getTokenNo - returns the current token number.
203 extern "C" unsigned int mcLexBuf_getTokenNo (void);
206 tokenToLineNo - returns the line number of the current file for the
207 tokenNo. The depth refers to the include depth.
208 A depth of 0 is the current file, depth of 1 is the file
209 which included the current file. Zero is returned if the
210 depth exceeds the file nesting level.
213 extern "C" unsigned int mcLexBuf_tokenToLineNo (unsigned int tokenNo, unsigned int depth);
216 getColumnNo - returns the current column where the symbol occurs in
217 the source file.
220 extern "C" unsigned int mcLexBuf_getColumnNo (void);
223 tokenToColumnNo - returns the column number of the current file for the
224 tokenNo. The depth refers to the include depth.
225 A depth of 0 is the current file, depth of 1 is the file
226 which included the current file. Zero is returned if the
227 depth exceeds the file nesting level.
230 extern "C" unsigned int mcLexBuf_tokenToColumnNo (unsigned int tokenNo, unsigned int depth);
233 findFileNameFromToken - returns the complete FileName for the appropriate
234 source file yields the token number, tokenNo.
235 The, Depth, indicates the include level: 0..n
236 Level 0 is the current. NIL is returned if n+1
237 is requested.
240 extern "C" DynamicStrings_String mcLexBuf_findFileNameFromToken (unsigned int tokenNo, unsigned int depth);
243 getFileName - returns a String defining the current file.
246 extern "C" DynamicStrings_String mcLexBuf_getFileName (void);
249 addTok - adds a token to the buffer.
252 extern "C" void mcLexBuf_addTok (mcReserved_toktype t);
255 addTokCharStar - adds a token to the buffer and an additional string, s.
256 A copy of string, s, is made.
259 extern "C" void mcLexBuf_addTokCharStar (mcReserved_toktype t, void * s);
262 addTokInteger - adds a token and an integer to the buffer.
265 extern "C" void mcLexBuf_addTokInteger (mcReserved_toktype t, int i);
268 addTokComment - adds a token to the buffer and a comment descriptor, com.
271 extern "C" void mcLexBuf_addTokComment (mcReserved_toktype t, mcComment_commentDesc com);
274 setFile - sets the current filename to, filename.
277 extern "C" void mcLexBuf_setFile (void * filename);
280 pushFile - indicates that, filename, has just been included.
283 extern "C" void mcLexBuf_pushFile (void * filename);
286 popFile - indicates that we are returning to, filename, having finished
287 an include.
290 extern "C" void mcLexBuf_popFile (void * filename);
293 debugLex - display the last, n, tokens.
296 static void debugLex (unsigned int n);
299 seekTo -
302 static void seekTo (unsigned int t);
305 peeptokenBucket -
308 static mcLexBuf_tokenBucket peeptokenBucket (unsigned int *t);
311 peepAfterComment - peeps ahead looking for an after statement comment. It stops at an END token
312 or if the line number changes.
315 static void peepAfterComment (void);
318 init - initializes the token list and source list.
321 static void init (void);
324 addTo - adds a new element to the end of sourceList, currentSource.
327 static void addTo (mcLexBuf_sourceList l);
330 subFrom - subtracts, l, from the source list.
333 static void subFrom (mcLexBuf_sourceList l);
336 newElement - returns a new sourceList
339 static mcLexBuf_sourceList newElement (void * s);
342 newList - initializes an empty list with the classic dummy header element.
345 static mcLexBuf_sourceList newList (void);
348 checkIfNeedToDuplicate - checks to see whether the currentSource has
349 been used, if it has then duplicate the list.
352 static void checkIfNeedToDuplicate (void);
355 killList - kills the sourceList providing that it has not been used.
358 static void killList (void);
361 displayToken -
364 static void displayToken (mcReserved_toktype t);
367 updateFromBucket - updates the global variables: currenttoken,
368 currentstring, currentcolumn and currentinteger
369 from tokenBucket, b, and, offset.
372 static void updateFromBucket (mcLexBuf_tokenBucket b, unsigned int offset);
375 doGetToken - fetch the next token into currenttoken.
378 static void doGetToken (void);
381 syncOpenWithBuffer - synchronise the buffer with the start of a file.
382 Skips all the tokens to do with the previous file.
385 static void syncOpenWithBuffer (void);
388 findtokenBucket - returns the tokenBucket corresponding to the tokenNo.
391 static mcLexBuf_tokenBucket findtokenBucket (unsigned int *tokenNo);
394 getFileName - returns a String defining the current file.
397 static void stop (void);
400 addTokToList - adds a token to a dynamic list.
403 static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment_commentDesc comment, unsigned int l, unsigned int c, mcLexBuf_sourceList f);
406 isLastTokenEof - returns TRUE if the last token was an eoftok
409 static bool isLastTokenEof (void);
413 debugLex - display the last, n, tokens.
416 static void debugLex (unsigned int n)
418 unsigned int c;
419 unsigned int i;
420 unsigned int o;
421 unsigned int t;
422 mcLexBuf_tokenBucket b;
424 if (nextTokNo > n)
426 o = nextTokNo-n;
428 else
430 o = 0;
432 i = 0;
433 do {
434 t = o+i;
435 if (nextTokNo == t)
437 mcPrintf_printf0 ((const char *) "nextTokNo ", 10);
439 b = findtokenBucket (&t);
440 if (b == NULL)
442 t = o+i;
443 mcPrintf_printf1 ((const char *) "end of buf (%d is further ahead than the buffer contents)\\n", 60, (const unsigned char *) &t, (sizeof (t)-1));
445 else
447 c = o+i;
448 mcPrintf_printf2 ((const char *) "entry %d %d ", 13, (const unsigned char *) &c, (sizeof (c)-1), (const unsigned char *) &t, (sizeof (t)-1));
449 displayToken (b->buf.array[t].token);
450 mcPrintf_printf0 ((const char *) "\\n", 2);
451 i += 1;
453 } while (! (b == NULL));
458 seekTo -
461 static void seekTo (unsigned int t)
463 mcLexBuf_tokenBucket b;
465 nextTokNo = t;
466 if (t > 0)
468 t -= 1;
469 b = findtokenBucket (&t);
470 if (b == NULL)
472 updateFromBucket (b, t);
479 peeptokenBucket -
482 static mcLexBuf_tokenBucket peeptokenBucket (unsigned int *t)
484 mcReserved_toktype ct;
485 unsigned int old;
486 unsigned int n;
487 mcLexBuf_tokenBucket b;
488 mcLexBuf_tokenBucket c;
490 ct = mcLexBuf_currenttoken;
491 if (Debugging)
493 debugLex (5);
495 old = mcLexBuf_getTokenNo ();
496 do {
497 n = (*t);
498 b = findtokenBucket (&n);
499 if (b == NULL)
501 doGetToken ();
502 n = (*t);
503 b = findtokenBucket (&n);
504 if ((b == NULL) || (mcLexBuf_currenttoken == mcReserved_eoftok))
506 /* bailing out. */
507 nextTokNo = old+1;
508 b = findtokenBucket (&old);
509 updateFromBucket (b, old);
510 return NULL;
513 } while (! ((b != NULL) || (mcLexBuf_currenttoken == mcReserved_eoftok)));
514 (*t) = n;
515 nextTokNo = old+1;
516 if (Debugging)
518 mcPrintf_printf2 ((const char *) "nextTokNo = %d, old = %d\\n", 26, (const unsigned char *) &nextTokNo, (sizeof (nextTokNo)-1), (const unsigned char *) &old, (sizeof (old)-1));
520 b = findtokenBucket (&old);
521 if (Debugging)
523 mcPrintf_printf1 ((const char *) " adjusted old = %d\\n", 21, (const unsigned char *) &old, (sizeof (old)-1));
525 if (b != NULL)
527 updateFromBucket (b, old);
529 if (Debugging)
531 debugLex (5);
533 mcDebug_assert (ct == mcLexBuf_currenttoken);
534 return b;
535 /* static analysis guarentees a RETURN statement will be used before here. */
536 __builtin_unreachable ();
541 peepAfterComment - peeps ahead looking for an after statement comment. It stops at an END token
542 or if the line number changes.
545 static void peepAfterComment (void)
547 unsigned int oldTokNo;
548 unsigned int t;
549 unsigned int peep;
550 unsigned int cno;
551 unsigned int nextline;
552 unsigned int curline;
553 mcLexBuf_tokenBucket b;
554 bool finished;
556 oldTokNo = nextTokNo;
557 cno = mcLexBuf_getTokenNo ();
558 curline = mcLexBuf_tokenToLineNo (cno, 0);
559 nextline = curline;
560 peep = 0;
561 finished = false;
562 do {
563 t = cno+peep;
564 b = peeptokenBucket (&t);
565 if ((b == NULL) || (mcLexBuf_currenttoken == mcReserved_eoftok))
567 finished = true;
569 else
571 nextline = b->buf.array[t].line;
572 if (nextline == curline)
574 switch (b->buf.array[t].token)
576 case mcReserved_eoftok:
577 case mcReserved_endtok:
578 finished = true;
579 break;
581 case mcReserved_commenttok:
582 if (mcComment_isAfterComment (b->buf.array[t].com))
584 afterComment = b->buf.array[t].com;
586 break;
589 default:
590 break;
593 else
595 finished = true;
598 peep += 1;
599 } while (! (finished));
600 seekTo (oldTokNo);
605 init - initializes the token list and source list.
608 static void init (void)
610 mcLexBuf_currenttoken = mcReserved_eoftok;
611 nextTokNo = 0;
612 currentSource = NULL;
613 listOfTokens.head = NULL;
614 listOfTokens.tail = NULL;
615 useBufferedTokens = false;
616 procedureComment = static_cast<mcComment_commentDesc> (NULL);
617 bodyComment = static_cast<mcComment_commentDesc> (NULL);
618 afterComment = static_cast<mcComment_commentDesc> (NULL);
619 mcLexBuf_lastcomment = static_cast<mcComment_commentDesc> (NULL);
624 addTo - adds a new element to the end of sourceList, currentSource.
627 static void addTo (mcLexBuf_sourceList l)
629 l->right = currentSource;
630 l->left = currentSource->left;
631 currentSource->left->right = l;
632 currentSource->left = l;
633 l->left->line = mcflex_getLineNo ();
634 l->left->col = mcflex_getColumnNo ();
639 subFrom - subtracts, l, from the source list.
642 static void subFrom (mcLexBuf_sourceList l)
644 l->left->right = l->right;
645 l->right->left = l->left;
650 newElement - returns a new sourceList
653 static mcLexBuf_sourceList newElement (void * s)
655 mcLexBuf_sourceList l;
657 Storage_ALLOCATE ((void **) &l, sizeof (mcLexBuf__T1));
658 if (l == NULL)
660 M2RTS_HALT (-1);
661 __builtin_unreachable ();
663 else
665 l->name = DynamicStrings_InitStringCharStar (s);
666 l->left = NULL;
667 l->right = NULL;
669 return l;
670 /* static analysis guarentees a RETURN statement will be used before here. */
671 __builtin_unreachable ();
676 newList - initializes an empty list with the classic dummy header element.
679 static mcLexBuf_sourceList newList (void)
681 mcLexBuf_sourceList l;
683 Storage_ALLOCATE ((void **) &l, sizeof (mcLexBuf__T1));
684 l->left = l;
685 l->right = l;
686 l->name = static_cast<DynamicStrings_String> (NULL);
687 return l;
688 /* static analysis guarentees a RETURN statement will be used before here. */
689 __builtin_unreachable ();
694 checkIfNeedToDuplicate - checks to see whether the currentSource has
695 been used, if it has then duplicate the list.
698 static void checkIfNeedToDuplicate (void)
700 mcLexBuf_sourceList l;
701 mcLexBuf_sourceList h;
703 if (currentUsed)
705 l = currentSource->right;
706 h = currentSource;
707 currentSource = newList ();
708 while (l != h)
710 addTo (newElement (reinterpret_cast <void *> (l->name)));
711 l = l->right;
718 killList - kills the sourceList providing that it has not been used.
721 static void killList (void)
723 mcLexBuf_sourceList l;
724 mcLexBuf_sourceList k;
726 if (! currentUsed && (currentSource != NULL))
728 l = currentSource;
729 do {
730 k = l;
731 l = l->right;
732 Storage_DEALLOCATE ((void **) &k, sizeof (mcLexBuf__T1));
733 } while (! (l == currentSource));
739 displayToken -
742 static void displayToken (mcReserved_toktype t)
744 switch (t)
746 case mcReserved_eoftok:
747 mcPrintf_printf0 ((const char *) "eoftok\\n", 8);
748 break;
750 case mcReserved_plustok:
751 mcPrintf_printf0 ((const char *) "plustok\\n", 9);
752 break;
754 case mcReserved_minustok:
755 mcPrintf_printf0 ((const char *) "minustok\\n", 10);
756 break;
758 case mcReserved_timestok:
759 mcPrintf_printf0 ((const char *) "timestok\\n", 10);
760 break;
762 case mcReserved_dividetok:
763 mcPrintf_printf0 ((const char *) "dividetok\\n", 11);
764 break;
766 case mcReserved_becomestok:
767 mcPrintf_printf0 ((const char *) "becomestok\\n", 12);
768 break;
770 case mcReserved_ambersandtok:
771 mcPrintf_printf0 ((const char *) "ambersandtok\\n", 14);
772 break;
774 case mcReserved_periodtok:
775 mcPrintf_printf0 ((const char *) "periodtok\\n", 11);
776 break;
778 case mcReserved_commatok:
779 mcPrintf_printf0 ((const char *) "commatok\\n", 10);
780 break;
782 case mcReserved_commenttok:
783 mcPrintf_printf0 ((const char *) "commenttok\\n", 12);
784 break;
786 case mcReserved_semicolontok:
787 mcPrintf_printf0 ((const char *) "semicolontok\\n", 14);
788 break;
790 case mcReserved_lparatok:
791 mcPrintf_printf0 ((const char *) "lparatok\\n", 10);
792 break;
794 case mcReserved_rparatok:
795 mcPrintf_printf0 ((const char *) "rparatok\\n", 10);
796 break;
798 case mcReserved_lsbratok:
799 mcPrintf_printf0 ((const char *) "lsbratok\\n", 10);
800 break;
802 case mcReserved_rsbratok:
803 mcPrintf_printf0 ((const char *) "rsbratok\\n", 10);
804 break;
806 case mcReserved_lcbratok:
807 mcPrintf_printf0 ((const char *) "lcbratok\\n", 10);
808 break;
810 case mcReserved_rcbratok:
811 mcPrintf_printf0 ((const char *) "rcbratok\\n", 10);
812 break;
814 case mcReserved_uparrowtok:
815 mcPrintf_printf0 ((const char *) "uparrowtok\\n", 12);
816 break;
818 case mcReserved_singlequotetok:
819 mcPrintf_printf0 ((const char *) "singlequotetok\\n", 16);
820 break;
822 case mcReserved_equaltok:
823 mcPrintf_printf0 ((const char *) "equaltok\\n", 10);
824 break;
826 case mcReserved_hashtok:
827 mcPrintf_printf0 ((const char *) "hashtok\\n", 9);
828 break;
830 case mcReserved_lesstok:
831 mcPrintf_printf0 ((const char *) "lesstok\\n", 9);
832 break;
834 case mcReserved_greatertok:
835 mcPrintf_printf0 ((const char *) "greatertok\\n", 12);
836 break;
838 case mcReserved_lessgreatertok:
839 mcPrintf_printf0 ((const char *) "lessgreatertok\\n", 16);
840 break;
842 case mcReserved_lessequaltok:
843 mcPrintf_printf0 ((const char *) "lessequaltok\\n", 14);
844 break;
846 case mcReserved_greaterequaltok:
847 mcPrintf_printf0 ((const char *) "greaterequaltok\\n", 17);
848 break;
850 case mcReserved_periodperiodtok:
851 mcPrintf_printf0 ((const char *) "periodperiodtok\\n", 17);
852 break;
854 case mcReserved_colontok:
855 mcPrintf_printf0 ((const char *) "colontok\\n", 10);
856 break;
858 case mcReserved_doublequotestok:
859 mcPrintf_printf0 ((const char *) "doublequotestok\\n", 17);
860 break;
862 case mcReserved_bartok:
863 mcPrintf_printf0 ((const char *) "bartok\\n", 8);
864 break;
866 case mcReserved_andtok:
867 mcPrintf_printf0 ((const char *) "andtok\\n", 8);
868 break;
870 case mcReserved_arraytok:
871 mcPrintf_printf0 ((const char *) "arraytok\\n", 10);
872 break;
874 case mcReserved_begintok:
875 mcPrintf_printf0 ((const char *) "begintok\\n", 10);
876 break;
878 case mcReserved_bytok:
879 mcPrintf_printf0 ((const char *) "bytok\\n", 7);
880 break;
882 case mcReserved_casetok:
883 mcPrintf_printf0 ((const char *) "casetok\\n", 9);
884 break;
886 case mcReserved_consttok:
887 mcPrintf_printf0 ((const char *) "consttok\\n", 10);
888 break;
890 case mcReserved_definitiontok:
891 mcPrintf_printf0 ((const char *) "definitiontok\\n", 15);
892 break;
894 case mcReserved_divtok:
895 mcPrintf_printf0 ((const char *) "divtok\\n", 8);
896 break;
898 case mcReserved_dotok:
899 mcPrintf_printf0 ((const char *) "dotok\\n", 7);
900 break;
902 case mcReserved_elsetok:
903 mcPrintf_printf0 ((const char *) "elsetok\\n", 9);
904 break;
906 case mcReserved_elsiftok:
907 mcPrintf_printf0 ((const char *) "elsiftok\\n", 10);
908 break;
910 case mcReserved_endtok:
911 mcPrintf_printf0 ((const char *) "endtok\\n", 8);
912 break;
914 case mcReserved_exittok:
915 mcPrintf_printf0 ((const char *) "exittok\\n", 9);
916 break;
918 case mcReserved_exporttok:
919 mcPrintf_printf0 ((const char *) "exporttok\\n", 11);
920 break;
922 case mcReserved_fortok:
923 mcPrintf_printf0 ((const char *) "fortok\\n", 8);
924 break;
926 case mcReserved_fromtok:
927 mcPrintf_printf0 ((const char *) "fromtok\\n", 9);
928 break;
930 case mcReserved_iftok:
931 mcPrintf_printf0 ((const char *) "iftok\\n", 7);
932 break;
934 case mcReserved_implementationtok:
935 mcPrintf_printf0 ((const char *) "implementationtok\\n", 19);
936 break;
938 case mcReserved_importtok:
939 mcPrintf_printf0 ((const char *) "importtok\\n", 11);
940 break;
942 case mcReserved_intok:
943 mcPrintf_printf0 ((const char *) "intok\\n", 7);
944 break;
946 case mcReserved_looptok:
947 mcPrintf_printf0 ((const char *) "looptok\\n", 9);
948 break;
950 case mcReserved_modtok:
951 mcPrintf_printf0 ((const char *) "modtok\\n", 8);
952 break;
954 case mcReserved_moduletok:
955 mcPrintf_printf0 ((const char *) "moduletok\\n", 11);
956 break;
958 case mcReserved_nottok:
959 mcPrintf_printf0 ((const char *) "nottok\\n", 8);
960 break;
962 case mcReserved_oftok:
963 mcPrintf_printf0 ((const char *) "oftok\\n", 7);
964 break;
966 case mcReserved_ortok:
967 mcPrintf_printf0 ((const char *) "ortok\\n", 7);
968 break;
970 case mcReserved_pointertok:
971 mcPrintf_printf0 ((const char *) "pointertok\\n", 12);
972 break;
974 case mcReserved_proceduretok:
975 mcPrintf_printf0 ((const char *) "proceduretok\\n", 14);
976 break;
978 case mcReserved_qualifiedtok:
979 mcPrintf_printf0 ((const char *) "qualifiedtok\\n", 14);
980 break;
982 case mcReserved_unqualifiedtok:
983 mcPrintf_printf0 ((const char *) "unqualifiedtok\\n", 16);
984 break;
986 case mcReserved_recordtok:
987 mcPrintf_printf0 ((const char *) "recordtok\\n", 11);
988 break;
990 case mcReserved_repeattok:
991 mcPrintf_printf0 ((const char *) "repeattok\\n", 11);
992 break;
994 case mcReserved_returntok:
995 mcPrintf_printf0 ((const char *) "returntok\\n", 11);
996 break;
998 case mcReserved_settok:
999 mcPrintf_printf0 ((const char *) "settok\\n", 8);
1000 break;
1002 case mcReserved_thentok:
1003 mcPrintf_printf0 ((const char *) "thentok\\n", 9);
1004 break;
1006 case mcReserved_totok:
1007 mcPrintf_printf0 ((const char *) "totok\\n", 7);
1008 break;
1010 case mcReserved_typetok:
1011 mcPrintf_printf0 ((const char *) "typetok\\n", 9);
1012 break;
1014 case mcReserved_untiltok:
1015 mcPrintf_printf0 ((const char *) "untiltok\\n", 10);
1016 break;
1018 case mcReserved_vartok:
1019 mcPrintf_printf0 ((const char *) "vartok\\n", 8);
1020 break;
1022 case mcReserved_whiletok:
1023 mcPrintf_printf0 ((const char *) "whiletok\\n", 10);
1024 break;
1026 case mcReserved_withtok:
1027 mcPrintf_printf0 ((const char *) "withtok\\n", 9);
1028 break;
1030 case mcReserved_asmtok:
1031 mcPrintf_printf0 ((const char *) "asmtok\\n", 8);
1032 break;
1034 case mcReserved_volatiletok:
1035 mcPrintf_printf0 ((const char *) "volatiletok\\n", 13);
1036 break;
1038 case mcReserved_periodperiodperiodtok:
1039 mcPrintf_printf0 ((const char *) "periodperiodperiodtok\\n", 23);
1040 break;
1042 case mcReserved_datetok:
1043 mcPrintf_printf0 ((const char *) "datetok\\n", 9);
1044 break;
1046 case mcReserved_linetok:
1047 mcPrintf_printf0 ((const char *) "linetok\\n", 9);
1048 break;
1050 case mcReserved_filetok:
1051 mcPrintf_printf0 ((const char *) "filetok\\n", 9);
1052 break;
1054 case mcReserved_integertok:
1055 mcPrintf_printf0 ((const char *) "integertok\\n", 12);
1056 break;
1058 case mcReserved_identtok:
1059 mcPrintf_printf0 ((const char *) "identtok\\n", 10);
1060 break;
1062 case mcReserved_realtok:
1063 mcPrintf_printf0 ((const char *) "realtok\\n", 9);
1064 break;
1066 case mcReserved_stringtok:
1067 mcPrintf_printf0 ((const char *) "stringtok\\n", 11);
1068 break;
1071 default:
1072 mcPrintf_printf0 ((const char *) "unknown tok (--fixme--)\\n", 25);
1073 break;
1079 updateFromBucket - updates the global variables: currenttoken,
1080 currentstring, currentcolumn and currentinteger
1081 from tokenBucket, b, and, offset.
1084 static void updateFromBucket (mcLexBuf_tokenBucket b, unsigned int offset)
1086 mcLexBuf_currenttoken = b->buf.array[offset].token;
1087 mcLexBuf_currentstring = nameKey_keyToCharStar (b->buf.array[offset].str);
1088 mcLexBuf_currentcolumn = b->buf.array[offset].col;
1089 mcLexBuf_currentinteger = b->buf.array[offset].int_;
1090 mcLexBuf_currentcomment = b->buf.array[offset].com;
1091 if (mcLexBuf_currentcomment != NULL)
1093 mcLexBuf_lastcomment = mcLexBuf_currentcomment;
1095 if (Debugging)
1097 mcPrintf_printf3 ((const char *) "line %d (# %d %d) ", 19, (const unsigned char *) &b->buf.array[offset].line, (sizeof (b->buf.array[offset].line)-1), (const unsigned char *) &offset, (sizeof (offset)-1), (const unsigned char *) &nextTokNo, (sizeof (nextTokNo)-1));
1103 doGetToken - fetch the next token into currenttoken.
1106 static void doGetToken (void)
1108 void * a;
1109 unsigned int t;
1110 mcLexBuf_tokenBucket b;
1112 if (useBufferedTokens)
1114 t = nextTokNo;
1115 b = findtokenBucket (&t);
1116 updateFromBucket (b, t);
1118 else
1120 if (listOfTokens.tail == NULL)
1122 a = mcflex_getToken ();
1123 if (listOfTokens.tail == NULL)
1125 M2RTS_HALT (-1);
1126 __builtin_unreachable ();
1129 if (nextTokNo >= listOfTokens.lastBucketOffset)
1131 /* nextTokNo is in the last bucket or needs to be read. */
1132 if ((nextTokNo-listOfTokens.lastBucketOffset) < listOfTokens.tail->len)
1134 if (Debugging)
1136 mcPrintf_printf0 ((const char *) "fetching token from buffer (updateFromBucket)\\n", 47);
1138 updateFromBucket (listOfTokens.tail, nextTokNo-listOfTokens.lastBucketOffset);
1140 else
1142 if (Debugging)
1144 mcPrintf_printf0 ((const char *) "calling flex to place token into buffer\\n", 41);
1146 /* call the lexical phase to place a new token into the last bucket. */
1147 a = mcflex_getToken ();
1148 mcLexBuf_getToken (); /* and call ourselves again to collect the token from bucket. */
1149 return; /* and call ourselves again to collect the token from bucket. */
1152 else
1154 if (Debugging)
1156 mcPrintf_printf0 ((const char *) "fetching token from buffer\\n", 28);
1158 t = nextTokNo;
1159 b = findtokenBucket (&t);
1160 updateFromBucket (b, t);
1163 if (Debugging)
1165 displayToken (mcLexBuf_currenttoken);
1167 nextTokNo += 1;
1172 syncOpenWithBuffer - synchronise the buffer with the start of a file.
1173 Skips all the tokens to do with the previous file.
1176 static void syncOpenWithBuffer (void)
1178 if (listOfTokens.tail != NULL)
1180 nextTokNo = listOfTokens.lastBucketOffset+listOfTokens.tail->len;
1186 findtokenBucket - returns the tokenBucket corresponding to the tokenNo.
1189 static mcLexBuf_tokenBucket findtokenBucket (unsigned int *tokenNo)
1191 mcLexBuf_tokenBucket b;
1193 b = listOfTokens.head;
1194 while (b != NULL)
1196 if ((*tokenNo) < b->len)
1198 return b;
1200 else
1202 (*tokenNo) -= b->len;
1204 b = b->next;
1206 return NULL;
1207 /* static analysis guarentees a RETURN statement will be used before here. */
1208 __builtin_unreachable ();
1213 getFileName - returns a String defining the current file.
1216 static void stop (void)
1222 addTokToList - adds a token to a dynamic list.
1225 static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment_commentDesc comment, unsigned int l, unsigned int c, mcLexBuf_sourceList f)
1227 mcLexBuf_tokenBucket b;
1229 if (listOfTokens.head == NULL)
1231 Storage_ALLOCATE ((void **) &listOfTokens.head, sizeof (mcLexBuf__T2));
1232 if (listOfTokens.head == NULL)
1233 {} /* empty. */
1234 /* list error */
1235 listOfTokens.tail = listOfTokens.head;
1236 listOfTokens.tail->len = 0;
1238 else if (listOfTokens.tail->len == MaxBucketSize)
1240 /* avoid dangling else. */
1241 mcDebug_assert (listOfTokens.tail->next == NULL);
1242 Storage_ALLOCATE ((void **) &listOfTokens.tail->next, sizeof (mcLexBuf__T2));
1243 if (listOfTokens.tail->next == NULL)
1244 {} /* empty. */
1245 else
1247 /* list error */
1248 listOfTokens.tail = listOfTokens.tail->next;
1249 listOfTokens.tail->len = 0;
1251 listOfTokens.lastBucketOffset += MaxBucketSize;
1253 listOfTokens.tail->next = NULL;
1254 mcDebug_assert (listOfTokens.tail->len != MaxBucketSize);
1255 listOfTokens.tail->buf.array[listOfTokens.tail->len].token = t;
1256 listOfTokens.tail->buf.array[listOfTokens.tail->len].str = n;
1257 listOfTokens.tail->buf.array[listOfTokens.tail->len].int_ = i;
1258 listOfTokens.tail->buf.array[listOfTokens.tail->len].com = comment;
1259 listOfTokens.tail->buf.array[listOfTokens.tail->len].line = l;
1260 listOfTokens.tail->buf.array[listOfTokens.tail->len].col = c;
1261 listOfTokens.tail->buf.array[listOfTokens.tail->len].file = f;
1262 listOfTokens.tail->len += 1;
1267 isLastTokenEof - returns TRUE if the last token was an eoftok
1270 static bool isLastTokenEof (void)
1272 unsigned int t;
1273 mcLexBuf_tokenBucket b;
1275 if (listOfTokens.tail != NULL)
1277 if (listOfTokens.tail->len == 0)
1279 b = listOfTokens.head;
1280 if (b == listOfTokens.tail)
1282 return false;
1284 while (b->next != listOfTokens.tail)
1286 b = b->next;
1289 else
1291 b = listOfTokens.tail;
1293 mcDebug_assert (b->len > 0); /* len should always be >0 */
1294 return b->buf.array[b->len-1].token == mcReserved_eoftok; /* len should always be >0 */
1296 return false;
1297 /* static analysis guarentees a RETURN statement will be used before here. */
1298 __builtin_unreachable ();
1303 getProcedureComment - returns the procedure comment if it exists,
1304 or NIL otherwise.
1307 extern "C" mcComment_commentDesc mcLexBuf_getProcedureComment (void)
1309 return procedureComment;
1310 /* static analysis guarentees a RETURN statement will be used before here. */
1311 __builtin_unreachable ();
1316 getBodyComment - returns the body comment if it exists,
1317 or NIL otherwise. The body comment is
1318 removed if found.
1321 extern "C" mcComment_commentDesc mcLexBuf_getBodyComment (void)
1323 mcComment_commentDesc b;
1325 b = bodyComment;
1326 bodyComment = static_cast<mcComment_commentDesc> (NULL);
1327 return b;
1328 /* static analysis guarentees a RETURN statement will be used before here. */
1329 __builtin_unreachable ();
1334 getAfterComment - returns the after comment if it exists,
1335 or NIL otherwise. The after comment is
1336 removed if found.
1339 extern "C" mcComment_commentDesc mcLexBuf_getAfterComment (void)
1341 mcComment_commentDesc a;
1343 peepAfterComment ();
1344 a = afterComment;
1345 afterComment = static_cast<mcComment_commentDesc> (NULL);
1346 return a;
1347 /* static analysis guarentees a RETURN statement will be used before here. */
1348 __builtin_unreachable ();
1353 openSource - attempts to open the source file, s.
1354 The success of the operation is returned.
1357 extern "C" bool mcLexBuf_openSource (DynamicStrings_String s)
1359 if (useBufferedTokens)
1361 mcLexBuf_getToken ();
1362 return true;
1364 else
1366 if (mcflex_openSource (DynamicStrings_string (s)))
1368 mcLexBuf_setFile (DynamicStrings_string (s));
1369 syncOpenWithBuffer ();
1370 mcLexBuf_getToken ();
1371 return true;
1373 else
1375 return false;
1378 /* static analysis guarentees a RETURN statement will be used before here. */
1379 __builtin_unreachable ();
1384 closeSource - closes the current open file.
1387 extern "C" void mcLexBuf_closeSource (void)
1389 if (useBufferedTokens)
1391 while (mcLexBuf_currenttoken != mcReserved_eoftok)
1393 mcLexBuf_getToken ();
1396 /* a subsequent call to mcflex.OpenSource will really close the file */
1401 reInitialize - re-initialize the all the data structures.
1404 extern "C" void mcLexBuf_reInitialize (void)
1406 mcLexBuf_tokenBucket s;
1407 mcLexBuf_tokenBucket t;
1409 if (listOfTokens.head != NULL)
1411 t = listOfTokens.head;
1412 do {
1413 s = t;
1414 t = t->next;
1415 Storage_DEALLOCATE ((void **) &s, sizeof (mcLexBuf__T2));
1416 } while (! (t == NULL));
1417 currentUsed = false;
1418 killList ();
1420 init ();
1425 resetForNewPass - reset the buffer pointers to the beginning ready for
1426 a new pass
1429 extern "C" void mcLexBuf_resetForNewPass (void)
1431 nextTokNo = 0;
1432 useBufferedTokens = true;
1437 getToken - gets the next token into currenttoken.
1440 extern "C" void mcLexBuf_getToken (void)
1442 do {
1443 doGetToken ();
1444 if (mcLexBuf_currenttoken == mcReserved_commenttok)
1446 /* avoid gcc warning by using compound statement even if not strictly necessary. */
1447 if (mcComment_isProcedureComment (mcLexBuf_currentcomment))
1449 procedureComment = mcLexBuf_currentcomment;
1450 bodyComment = static_cast<mcComment_commentDesc> (NULL);
1451 afterComment = static_cast<mcComment_commentDesc> (NULL);
1453 else if (mcComment_isBodyComment (mcLexBuf_currentcomment))
1455 /* avoid dangling else. */
1456 bodyComment = mcLexBuf_currentcomment;
1457 afterComment = static_cast<mcComment_commentDesc> (NULL);
1459 else if (mcComment_isAfterComment (mcLexBuf_currentcomment))
1461 /* avoid dangling else. */
1462 procedureComment = static_cast<mcComment_commentDesc> (NULL);
1463 bodyComment = static_cast<mcComment_commentDesc> (NULL);
1464 afterComment = mcLexBuf_currentcomment;
1467 } while (! (mcLexBuf_currenttoken != mcReserved_commenttok));
1472 insertToken - inserts a symbol, token, infront of the current token
1473 ready for the next pass.
1476 extern "C" void mcLexBuf_insertToken (mcReserved_toktype token)
1478 if (listOfTokens.tail != NULL)
1480 if (listOfTokens.tail->len > 0)
1482 listOfTokens.tail->buf.array[listOfTokens.tail->len-1].token = token;
1484 addTokToList (mcLexBuf_currenttoken, nameKey_NulName, 0, static_cast<mcComment_commentDesc> (NULL), mcLexBuf_getLineNo (), mcLexBuf_getColumnNo (), currentSource);
1485 mcLexBuf_getToken ();
1491 insertTokenAndRewind - inserts a symbol, token, infront of the current token
1492 and then moves the token stream back onto the inserted token.
1495 extern "C" void mcLexBuf_insertTokenAndRewind (mcReserved_toktype token)
1497 if (listOfTokens.tail != NULL)
1499 if (listOfTokens.tail->len > 0)
1501 listOfTokens.tail->buf.array[listOfTokens.tail->len-1].token = token;
1503 addTokToList (mcLexBuf_currenttoken, nameKey_NulName, 0, static_cast<mcComment_commentDesc> (NULL), mcLexBuf_getLineNo (), mcLexBuf_getColumnNo (), currentSource);
1504 mcLexBuf_currenttoken = token;
1510 getPreviousTokenLineNo - returns the line number of the previous token.
1513 extern "C" unsigned int mcLexBuf_getPreviousTokenLineNo (void)
1515 return mcLexBuf_getLineNo ();
1516 /* static analysis guarentees a RETURN statement will be used before here. */
1517 __builtin_unreachable ();
1522 getLineNo - returns the current line number where the symbol occurs in
1523 the source file.
1526 extern "C" unsigned int mcLexBuf_getLineNo (void)
1528 if (nextTokNo == 0)
1530 return 0;
1532 else
1534 return mcLexBuf_tokenToLineNo (mcLexBuf_getTokenNo (), 0);
1536 /* static analysis guarentees a RETURN statement will be used before here. */
1537 __builtin_unreachable ();
1542 getTokenNo - returns the current token number.
1545 extern "C" unsigned int mcLexBuf_getTokenNo (void)
1547 if (nextTokNo == 0)
1549 return 0;
1551 else
1553 return nextTokNo-1;
1555 /* static analysis guarentees a RETURN statement will be used before here. */
1556 __builtin_unreachable ();
1561 tokenToLineNo - returns the line number of the current file for the
1562 tokenNo. The depth refers to the include depth.
1563 A depth of 0 is the current file, depth of 1 is the file
1564 which included the current file. Zero is returned if the
1565 depth exceeds the file nesting level.
1568 extern "C" unsigned int mcLexBuf_tokenToLineNo (unsigned int tokenNo, unsigned int depth)
1570 mcLexBuf_tokenBucket b;
1571 mcLexBuf_sourceList l;
1573 b = findtokenBucket (&tokenNo);
1574 if (b == NULL)
1576 return 0;
1578 else
1580 if (depth == 0)
1582 return b->buf.array[tokenNo].line;
1584 else
1586 l = b->buf.array[tokenNo].file->left;
1587 while (depth > 0)
1589 l = l->left;
1590 if (l == b->buf.array[tokenNo].file->left)
1592 return 0;
1594 depth -= 1;
1596 return l->line;
1599 /* static analysis guarentees a RETURN statement will be used before here. */
1600 __builtin_unreachable ();
1605 getColumnNo - returns the current column where the symbol occurs in
1606 the source file.
1609 extern "C" unsigned int mcLexBuf_getColumnNo (void)
1611 if (nextTokNo == 0)
1613 return 0;
1615 else
1617 return mcLexBuf_tokenToColumnNo (mcLexBuf_getTokenNo (), 0);
1619 /* static analysis guarentees a RETURN statement will be used before here. */
1620 __builtin_unreachable ();
1625 tokenToColumnNo - returns the column number of the current file for the
1626 tokenNo. The depth refers to the include depth.
1627 A depth of 0 is the current file, depth of 1 is the file
1628 which included the current file. Zero is returned if the
1629 depth exceeds the file nesting level.
1632 extern "C" unsigned int mcLexBuf_tokenToColumnNo (unsigned int tokenNo, unsigned int depth)
1634 mcLexBuf_tokenBucket b;
1635 mcLexBuf_sourceList l;
1637 b = findtokenBucket (&tokenNo);
1638 if (b == NULL)
1640 return 0;
1642 else
1644 if (depth == 0)
1646 return b->buf.array[tokenNo].col;
1648 else
1650 l = b->buf.array[tokenNo].file->left;
1651 while (depth > 0)
1653 l = l->left;
1654 if (l == b->buf.array[tokenNo].file->left)
1656 return 0;
1658 depth -= 1;
1660 return l->col;
1663 /* static analysis guarentees a RETURN statement will be used before here. */
1664 __builtin_unreachable ();
1669 findFileNameFromToken - returns the complete FileName for the appropriate
1670 source file yields the token number, tokenNo.
1671 The, Depth, indicates the include level: 0..n
1672 Level 0 is the current. NIL is returned if n+1
1673 is requested.
1676 extern "C" DynamicStrings_String mcLexBuf_findFileNameFromToken (unsigned int tokenNo, unsigned int depth)
1678 mcLexBuf_tokenBucket b;
1679 mcLexBuf_sourceList l;
1681 b = findtokenBucket (&tokenNo);
1682 if (b == NULL)
1684 return static_cast<DynamicStrings_String> (NULL);
1686 else
1688 l = b->buf.array[tokenNo].file->left;
1689 while (depth > 0)
1691 l = l->left;
1692 if (l == b->buf.array[tokenNo].file->left)
1694 return static_cast<DynamicStrings_String> (NULL);
1696 depth -= 1;
1698 return l->name;
1700 /* static analysis guarentees a RETURN statement will be used before here. */
1701 __builtin_unreachable ();
1706 getFileName - returns a String defining the current file.
1709 extern "C" DynamicStrings_String mcLexBuf_getFileName (void)
1711 return mcLexBuf_findFileNameFromToken (mcLexBuf_getTokenNo (), 0);
1712 /* static analysis guarentees a RETURN statement will be used before here. */
1713 __builtin_unreachable ();
1718 addTok - adds a token to the buffer.
1721 extern "C" void mcLexBuf_addTok (mcReserved_toktype t)
1723 if (! ((t == mcReserved_eoftok) && (isLastTokenEof ())))
1725 addTokToList (t, nameKey_NulName, 0, static_cast<mcComment_commentDesc> (NULL), mcflex_getLineNo (), mcflex_getColumnNo (), currentSource);
1726 currentUsed = true;
1732 addTokCharStar - adds a token to the buffer and an additional string, s.
1733 A copy of string, s, is made.
1736 extern "C" void mcLexBuf_addTokCharStar (mcReserved_toktype t, void * s)
1738 if ((libc_strlen (s)) > 80)
1740 stop ();
1742 addTokToList (t, nameKey_makekey (s), 0, static_cast<mcComment_commentDesc> (NULL), mcflex_getLineNo (), mcflex_getColumnNo (), currentSource);
1743 currentUsed = true;
1748 addTokInteger - adds a token and an integer to the buffer.
1751 extern "C" void mcLexBuf_addTokInteger (mcReserved_toktype t, int i)
1753 DynamicStrings_String s;
1754 unsigned int c;
1755 unsigned int l;
1757 l = mcflex_getLineNo ();
1758 c = mcflex_getColumnNo ();
1759 s = FormatStrings_Sprintf1 (DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "%d", 2)), (const unsigned char *) &i, (sizeof (i)-1));
1760 addTokToList (t, nameKey_makekey (DynamicStrings_string (s)), i, static_cast<mcComment_commentDesc> (NULL), l, c, currentSource);
1761 s = DynamicStrings_KillString (s);
1762 currentUsed = true;
1767 addTokComment - adds a token to the buffer and a comment descriptor, com.
1770 extern "C" void mcLexBuf_addTokComment (mcReserved_toktype t, mcComment_commentDesc com)
1772 addTokToList (t, nameKey_NulName, 0, com, mcflex_getLineNo (), mcflex_getColumnNo (), currentSource);
1773 currentUsed = true;
1778 setFile - sets the current filename to, filename.
1781 extern "C" void mcLexBuf_setFile (void * filename)
1783 killList ();
1784 currentUsed = false;
1785 currentSource = newList ();
1786 addTo (newElement (filename));
1791 pushFile - indicates that, filename, has just been included.
1794 extern "C" void mcLexBuf_pushFile (void * filename)
1796 mcLexBuf_sourceList l;
1798 checkIfNeedToDuplicate ();
1799 addTo (newElement (filename));
1800 if (Debugging)
1802 if (currentSource->right != currentSource)
1804 l = currentSource;
1805 do {
1806 mcPrintf_printf3 ((const char *) "name = %s, line = %d, col = %d\\n", 32, (const unsigned char *) &l->name, (sizeof (l->name)-1), (const unsigned char *) &l->line, (sizeof (l->line)-1), (const unsigned char *) &l->col, (sizeof (l->col)-1));
1807 l = l->right;
1808 } while (! (l == currentSource));
1815 popFile - indicates that we are returning to, filename, having finished
1816 an include.
1819 extern "C" void mcLexBuf_popFile (void * filename)
1821 mcLexBuf_sourceList l;
1823 checkIfNeedToDuplicate ();
1824 if ((currentSource != NULL) && (currentSource->left != currentSource))
1826 /* avoid dangling else. */
1827 l = currentSource->left; /* last element */
1828 subFrom (l); /* last element */
1829 Storage_DEALLOCATE ((void **) &l, sizeof (mcLexBuf__T1));
1830 if ((currentSource->left != currentSource) && (! (DynamicStrings_Equal (currentSource->name, DynamicStrings_Mark (DynamicStrings_InitStringCharStar (filename))))))
1831 {} /* empty. */
1832 /* mismatch in source file names after preprocessing files */
1834 /* source file list is empty, cannot pop an include.. */
1837 extern "C" void _M2_mcLexBuf_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
1839 init ();
1842 extern "C" void _M2_mcLexBuf_fini (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])