1 /*****************************************************************************/
5 /* The scanner for the ca65 macroassembler */
9 /* (C) 1998-2008 Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
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. */
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: */
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 */
32 /*****************************************************************************/
41 #include <sys/types.h> /* EMX needs this */
67 /*****************************************************************************/
69 /*****************************************************************************/
73 Token Tok = TOK_NONE; /* Current token */
74 int WS; /* Flag: Whitespace before token */
75 long IVal; /* Integer token attribute */
76 StrBuf SVal = STATIC_STRBUF_INITIALIZER;/* String token attribute */
78 FilePos CurPos = { 0, 0, 0 }; /* Name and position in current file */
82 /* Struct to handle include files. */
83 typedef struct InputFile InputFile;
85 FILE* F; /* Input file descriptor */
86 FilePos Pos; /* Position in file */
87 Token Tok; /* Last token */
88 int C; /* Last character */
89 char Line[256]; /* The current input line */
90 InputFile* Next; /* Linked list of input files */
93 /* Struct to handle textual input data */
94 typedef struct InputData InputData;
96 char* Text; /* Pointer to the text data */
97 const char* Pos; /* Pointer to current position */
98 int Malloced; /* Memory was malloced */
99 Token Tok; /* Last token */
100 int C; /* Last character */
101 InputData* Next; /* Linked list of input data */
104 /* Input source: Either file or data */
105 typedef struct CharSource CharSource;
107 /* Set of input functions */
108 typedef struct CharSourceFunctions CharSourceFunctions;
109 struct CharSourceFunctions {
110 void (*MarkStart) (CharSource*); /* Mark the start pos of a token */
111 void (*NextChar) (CharSource*); /* Read next char from input */
112 void (*Done) (CharSource*); /* Close input source */
115 /* Input source: Either file or data */
117 CharSource* Next; /* Linked list of char sources */
118 Token Tok; /* Last token */
119 int C; /* Last character */
120 const CharSourceFunctions* Func; /* Pointer to function table */
122 InputFile File; /* File data */
123 InputData Data; /* Textual data */
127 /* Current input variables */
128 static CharSource* Source = 0; /* Current char source */
129 static unsigned FCount = 0; /* Count of input files */
130 static int C = 0; /* Current input character */
132 /* Force end of assembly */
135 /* List of dot keywords with the corresponding tokens */
137 const char* Key; /* MUST be first field */
142 { ".ADDR", TOK_ADDR },
143 { ".ALIGN", TOK_ALIGN },
144 { ".AND", TOK_BOOLAND },
145 { ".ASCIIZ", TOK_ASCIIZ },
146 { ".ASSERT", TOK_ASSERT },
147 { ".AUTOIMPORT", TOK_AUTOIMPORT },
148 { ".BANKBYTE", TOK_BANKBYTE },
149 { ".BITAND", TOK_AND },
150 { ".BITNOT", TOK_NOT },
151 { ".BITOR", TOK_OR },
152 { ".BITXOR", TOK_XOR },
153 { ".BLANK", TOK_BLANK },
155 { ".BYT", TOK_BYTE },
156 { ".BYTE", TOK_BYTE },
157 { ".CASE", TOK_CASE },
158 { ".CHARMAP", TOK_CHARMAP },
159 { ".CODE", TOK_CODE },
160 { ".CONCAT", TOK_CONCAT },
161 { ".CONDES", TOK_CONDES },
162 { ".CONST", TOK_CONST },
163 { ".CONSTRUCTOR", TOK_CONSTRUCTOR },
165 { ".DATA", TOK_DATA },
167 { ".DBYT", TOK_DBYT },
168 { ".DEBUGINFO", TOK_DEBUGINFO },
169 { ".DEF", TOK_DEFINED },
170 { ".DEFINE", TOK_DEFINE },
171 { ".DEFINED", TOK_DEFINED },
172 { ".DESTRUCTOR", TOK_DESTRUCTOR },
173 { ".DWORD", TOK_DWORD },
174 { ".ELSE", TOK_ELSE },
175 { ".ELSEIF", TOK_ELSEIF },
177 { ".ENDENUM", TOK_ENDENUM },
178 { ".ENDIF", TOK_ENDIF },
179 { ".ENDMAC", TOK_ENDMACRO },
180 { ".ENDMACRO", TOK_ENDMACRO },
181 { ".ENDPROC", TOK_ENDPROC },
182 { ".ENDREP", TOK_ENDREP },
183 { ".ENDREPEAT", TOK_ENDREP },
184 { ".ENDSCOPE", TOK_ENDSCOPE },
185 { ".ENDSTRUCT", TOK_ENDSTRUCT },
186 { ".ENDUNION", TOK_ENDUNION },
187 { ".ENUM", TOK_ENUM },
188 { ".ERROR", TOK_ERROR },
189 { ".EXITMAC", TOK_EXITMACRO },
190 { ".EXITMACRO", TOK_EXITMACRO },
191 { ".EXPORT", TOK_EXPORT },
192 { ".EXPORTZP", TOK_EXPORTZP },
193 { ".FARADDR", TOK_FARADDR },
194 { ".FEATURE", TOK_FEATURE },
195 { ".FILEOPT", TOK_FILEOPT },
196 { ".FOPT", TOK_FILEOPT },
197 { ".FORCEIMPORT", TOK_FORCEIMPORT },
198 { ".FORCEWORD", TOK_FORCEWORD },
199 { ".GLOBAL", TOK_GLOBAL },
200 { ".GLOBALZP", TOK_GLOBALZP },
201 { ".HIBYTE", TOK_HIBYTE },
202 { ".HIWORD", TOK_HIWORD },
205 { ".IDENT", TOK_MAKEIDENT },
207 { ".IFBLANK", TOK_IFBLANK },
208 { ".IFCONST", TOK_IFCONST },
209 { ".IFDEF", TOK_IFDEF },
210 { ".IFNBLANK", TOK_IFNBLANK },
211 { ".IFNCONST", TOK_IFNCONST },
212 { ".IFNDEF", TOK_IFNDEF },
213 { ".IFNREF", TOK_IFNREF },
214 { ".IFP02", TOK_IFP02 },
215 { ".IFP816", TOK_IFP816 },
216 { ".IFPC02", TOK_IFPC02 },
217 { ".IFPSC02", TOK_IFPSC02 },
218 { ".IFREF", TOK_IFREF },
219 { ".IMPORT", TOK_IMPORT },
220 { ".IMPORTZP", TOK_IMPORTZP },
221 { ".INCBIN", TOK_INCBIN },
222 { ".INCLUDE", TOK_INCLUDE },
223 { ".INTERRUPTOR", TOK_INTERRUPTOR },
224 { ".LEFT", TOK_LEFT },
225 { ".LINECONT", TOK_LINECONT },
226 { ".LIST", TOK_LIST },
227 { ".LISTBYTES", TOK_LISTBYTES },
228 { ".LOBYTE", TOK_LOBYTE },
229 { ".LOCAL", TOK_LOCAL },
230 { ".LOCALCHAR", TOK_LOCALCHAR },
231 { ".LOWORD", TOK_LOWORD },
232 { ".MAC", TOK_MACRO },
233 { ".MACPACK", TOK_MACPACK },
234 { ".MACRO", TOK_MACRO },
235 { ".MATCH", TOK_MATCH },
238 { ".NOT", TOK_BOOLNOT },
239 { ".NULL", TOK_NULL },
240 { ".OR", TOK_BOOLOR },
244 { ".P816", TOK_P816 },
245 { ".PAGELEN", TOK_PAGELENGTH },
246 { ".PAGELENGTH", TOK_PAGELENGTH },
247 { ".PARAMCOUNT", TOK_PARAMCOUNT },
248 { ".PC02", TOK_PC02 },
249 { ".POPSEG", TOK_POPSEG },
250 { ".PROC", TOK_PROC },
251 { ".PSC02", TOK_PSC02 },
252 { ".PUSHSEG", TOK_PUSHSEG },
253 { ".REF", TOK_REFERENCED },
254 { ".REFERENCED", TOK_REFERENCED },
255 { ".RELOC", TOK_RELOC },
256 { ".REPEAT", TOK_REPEAT },
258 { ".RIGHT", TOK_RIGHT },
259 { ".RODATA", TOK_RODATA },
260 { ".SCOPE", TOK_SCOPE },
261 { ".SEGMENT", TOK_SEGMENT },
263 { ".SETCPU", TOK_SETCPU },
266 { ".SIZEOF", TOK_SIZEOF },
267 { ".SMART", TOK_SMART },
268 { ".SPRINTF", TOK_SPRINTF },
269 { ".STRAT", TOK_STRAT },
270 { ".STRING", TOK_STRING },
271 { ".STRLEN", TOK_STRLEN },
272 { ".STRUCT", TOK_STRUCT },
273 { ".SUNPLUS", TOK_SUNPLUS },
275 { ".TCOUNT", TOK_TCOUNT },
276 { ".TIME", TOK_TIME },
277 { ".UNION", TOK_UNION },
278 { ".VERSION", TOK_VERSION },
279 { ".WARNING", TOK_WARNING },
280 { ".WORD", TOK_WORD },
281 { ".XMATCH", TOK_XMATCH },
282 { ".XOR", TOK_BOOLXOR },
283 { ".ZEROPAGE", TOK_ZEROPAGE },
288 /*****************************************************************************/
289 /* CharSource functions */
290 /*****************************************************************************/
294 static void UseCharSource (CharSource* S)
295 /* Initialize a new input source and start to use it. */
297 /* Remember the current input char and token */
301 /* Use the new input source */
305 /* Read the first character from the new file */
306 S->Func->NextChar (S);
308 /* Setup the next token so it will be skipped on the next call to
316 static void DoneCharSource (void)
317 /* Close the top level character source */
321 /* First, call the type specific function */
322 Source->Func->Done (Source);
324 /* Restore the old token */
328 /* Remember the last stacked input source */
331 /* Delete the top level one ... */
334 /* ... and use the one before */
340 /*****************************************************************************/
341 /* InputFile functions */
342 /*****************************************************************************/
346 static void IFMarkStart (CharSource* S)
347 /* Mark the start of the next token */
349 CurPos = S->V.File.Pos;
354 static void IFNextChar (CharSource* S)
355 /* Read the next character from the input file */
357 /* Check for end of line, read the next line if needed */
358 while (S->V.File.Line [S->V.File.Pos.Col] == '\0') {
360 unsigned Len, Removed;
362 /* End of current line reached, read next line */
363 if (fgets (S->V.File.Line, sizeof (S->V.File.Line), S->V.File.F) == 0) {
364 /* End of file. Add an empty line to the listing. This is a
365 * small hack needed to keep the PC output in sync.
367 NewListingLine ("", S->V.File.Pos.Name, FCount);
372 /* For better handling of files with unusual line endings (DOS
373 * files that are accidently translated on Unix for example),
374 * first remove all whitespace at the end, then add a single
377 Len = strlen (S->V.File.Line);
379 while (Len > 0 && IsSpace (S->V.File.Line[Len-1])) {
384 S->V.File.Line[Len+0] = '\n';
385 S->V.File.Line[Len+1] = '\0';
389 S->V.File.Pos.Line++;
390 S->V.File.Pos.Col = 0;
392 /* Remember the new line for the listing */
393 NewListingLine (S->V.File.Line, S->V.File.Pos.Name, FCount);
397 /* Return the next character from the file */
398 C = S->V.File.Line [S->V.File.Pos.Col++];
403 void IFDone (CharSource* S)
404 /* Close the current input file */
406 /* We're at the end of an include file. Check if we have any
407 * open .IFs, or any open token lists in this file. This
408 * enforcement is artificial, using conditionals that start
409 * in one file and end in another are uncommon, and don't
410 * allowing these things will help finding errors.
414 /* Close the input file and decrement the file count. We will ignore
415 * errors here, since we were just reading from the file.
417 (void) fclose (S->V.File.F);
423 /* Set of input file handling functions */
424 static const CharSourceFunctions IFFunc = {
432 void NewInputFile (const char* Name)
433 /* Open a new input file */
437 /* First try to open the file */
438 FILE* F = fopen (Name, "r");
441 /* Error (fatal error if this is the main file) */
443 Fatal ("Cannot open input file `%s': %s", Name, strerror (errno));
446 /* We are on include level. Search for the file in the include
449 PathName = FindInclude (Name);
450 if (PathName == 0 || (F = fopen (PathName, "r")) == 0) {
451 /* Not found or cannot open, print an error and bail out */
452 Error ("Cannot open include file `%s': %s", Name, strerror (errno));
455 /* Use the path name from now on */
459 /* check again if we do now have an open file */
466 /* Stat the file and remember the values. There a race condition here,
467 * since we cannot use fileno() (non standard identifier in standard
468 * header file), and therefore not fstat. When using stat with the
469 * file name, there's a risk that the file was deleted and recreated
470 * while it was open. Since mtime and size are only used to check
471 * if a file has changed in the debugger, we will ignore this problem
475 if (stat (Name, &Buf) != 0) {
476 Fatal ("Cannot stat input file `%s': %s", Name, strerror (errno));
479 /* Add the file to the input file table and remember the index */
480 FileIdx = AddFile (SB_InitFromString (&NameBuf, Name), Buf.st_size, Buf.st_mtime);
482 /* Create a new input source variable and initialize it */
483 S = xmalloc (sizeof (*S));
486 S->V.File.Pos.Line = 0;
487 S->V.File.Pos.Col = 0;
488 S->V.File.Pos.Name = FileIdx;
489 S->V.File.Line[0] = '\0';
491 /* Count active input files */
494 /* Use this input source */
498 /* Free an allocated name buffer */
504 /*****************************************************************************/
505 /* InputData functions */
506 /*****************************************************************************/
510 static void IDMarkStart (CharSource* S attribute ((unused)))
511 /* Mark the start of the next token */
513 /* Nothing to do here */
518 static void IDNextChar (CharSource* S)
519 /* Read the next character from the input text */
521 C = *S->V.Data.Pos++;
523 /* End of input data */
531 void IDDone (CharSource* S)
532 /* Close the current input data */
534 /* Cleanup the current stuff */
535 if (S->V.Data.Malloced) {
536 xfree (S->V.Data.Text);
542 /* Set of input data handling functions */
543 static const CharSourceFunctions IDFunc = {
551 void NewInputData (char* Text, int Malloced)
552 /* Add a chunk of input data to the input stream */
556 /* Create a new input source variable and initialize it */
557 S = xmalloc (sizeof (*S));
559 S->V.Data.Text = Text;
560 S->V.Data.Pos = Text;
561 S->V.Data.Malloced = Malloced;
563 /* Use this input source */
569 /*****************************************************************************/
570 /* Character classification functions */
571 /*****************************************************************************/
576 /* Return true if the character is a valid character for an identifier */
578 return IsAlNum (C) ||
580 (C == '@' && AtInIdents) ||
581 (C == '$' && DollarInIdents);
586 int IsIdStart (int C)
587 /* Return true if the character may start an identifier */
589 return IsAlpha (C) || C == '_';
594 /*****************************************************************************/
596 /*****************************************************************************/
600 static unsigned DigitVal (unsigned char C)
601 /* Convert a digit into it's numerical representation */
606 return toupper (C) - 'A' + 10;
612 static void NextChar (void)
613 /* Read the next character from the input file */
615 Source->Func->NextChar (Source);
620 void LocaseSVal (void)
621 /* Make SVal lower case */
628 void UpcaseSVal (void)
629 /* Make SVal upper case */
636 static int CmpDotKeyword (const void* K1, const void* K2)
637 /* Compare function for the dot keyword search */
639 return strcmp (((struct DotKeyword*)K1)->Key, ((struct DotKeyword*)K2)->Key);
644 static unsigned char FindDotKeyword (void)
645 /* Find the dot keyword in SVal. Return the corresponding token if found,
646 * return TOK_NONE if not found.
650 struct DotKeyword* R;
653 K.Key = SB_GetConstBuf (&SVal);
656 /* If we aren't in ignore case mode, we have to uppercase the keyword */
661 /* Search for the keyword */
662 R = bsearch (&K, DotKeywords, sizeof (DotKeywords) / sizeof (DotKeywords [0]),
663 sizeof (DotKeywords [0]), CmpDotKeyword);
673 static void ReadIdent (void)
674 /* Read an identifier from the current input position into Ident. Filling SVal
675 * starts at the current position with the next character in C. It is assumed
676 * that any characters already filled in are ok, and the character in C is
680 /* Read the identifier */
682 SB_AppendChar (&SVal, C);
684 } while (IsIdChar (C));
685 SB_Terminate (&SVal);
687 /* If we should ignore case, convert the identifier to upper case */
695 static void ReadStringConst (int StringTerm)
696 /* Read a string constant into SVal. */
698 /* Skip the leading string terminator */
701 /* Read the string */
703 if (C == StringTerm) {
706 if (C == '\n' || C == EOF) {
707 Error ("Newline in string constant");
711 /* Append the char to the string */
712 SB_AppendChar (&SVal, C);
714 /* Skip the character */
718 /* Skip the trailing terminator */
721 /* Terminate the string */
722 SB_Terminate (&SVal);
727 static int Sweet16Reg (const StrBuf* Id)
728 /* Check if the given identifier is a sweet16 register. Return -1 if this is
729 * not the case, return the register number otherwise.
735 if (SB_GetLen (Id) < 2) {
738 if (toupper (SB_AtUnchecked (Id, 0)) != 'R') {
741 if (!IsDigit (SB_AtUnchecked (Id, 1))) {
745 if (sscanf (SB_GetConstBuf (Id)+1, "%u%c", &RegNum, &Check) != 1 || RegNum > 15) {
746 /* Invalid register */
750 /* The register number is valid */
756 void NextRawTok (void)
757 /* Read the next raw token from the input stream */
759 /* If we've a forced end of assembly, don't read further */
766 /* Check if we have tokens from another input source */
767 if (InputFromStack ()) {
772 /* Skip whitespace, remember if we had some */
773 if ((WS = IsBlank (C)) != 0) {
776 } while (IsBlank (C));
779 /* Mark the file position of the next token */
780 Source->Func->MarkStart (Source);
782 /* Clear the string attribute */
785 /* Hex number or PC symbol? */
789 /* Hex digit must follow or DollarIsPC must be enabled */
795 Error ("Hexadecimal digit expected");
799 /* Read the number */
801 while (IsXDigit (C)) {
802 if (IVal & 0xF0000000) {
803 Error ("Overflow in hexadecimal number");
806 IVal = (IVal << 4) + DigitVal (C);
810 /* This is an integer constant */
819 /* 0 or 1 must follow */
821 Error ("Binary digit expected");
824 /* Read the number */
826 while (IsBDigit (C)) {
827 if (IVal & 0x80000000) {
828 Error ("Overflow in binary number");
831 IVal = (IVal << 1) + DigitVal (C);
835 /* This is an integer constant */
850 /* Ignore leading zeros */
855 /* Read the number into Buf counting the digits */
857 while (IsXDigit (C)) {
859 /* Buf is big enough to allow any decimal and hex number to
860 * overflow, so ignore excess digits here, they will be detected
861 * when we convert the value.
863 if (Digits < sizeof (Buf)) {
870 /* Allow zilog/intel style hex numbers with a 'h' suffix */
871 if (C == 'h' || C == 'H') {
874 Max = 0xFFFFFFFFUL / 16;
877 Max = 0xFFFFFFFFUL / 10;
880 /* Convert the number using the given base */
882 for (I = 0; I < Digits; ++I) {
884 Error ("Number out of range");
888 DVal = DigitVal (Buf[I]);
890 Error ("Invalid digits in number");
894 IVal = (IVal * Base) + DVal;
897 /* This is an integer constant */
902 /* Control command? */
905 /* Remember and skip the dot */
908 /* Check if it's just a dot */
909 if (!IsIdStart (C)) {
916 /* Read the remainder of the identifier */
917 SB_AppendChar (&SVal, '.');
920 /* Dot keyword, search for it */
921 Tok = FindDotKeyword ();
922 if (Tok == TOK_NONE) {
925 if (!LeadingDotInIdents) {
926 /* Invalid pseudo instruction */
927 Error ("`%m%p' is not a recognized control command", &SVal);
931 /* An identifier with a dot. Check if it's a define style
934 if (IsDefine (&SVal)) {
935 /* This is a define style macro - expand it */
940 /* Just an identifier with a dot */
948 /* Indirect op for sweet16 cpu. Must check this before checking for local
949 * symbols, because these may also use the '@' symbol.
951 if (CPU == CPU_SWEET16 && C == '@') {
958 if (C == LocalStart) {
960 /* Read the identifier. */
963 /* Start character alone is not enough */
964 if (SB_GetLen (&SVal) == 1) {
965 Error ("Invalid cheap local symbol");
969 /* A local identifier */
970 Tok = TOK_LOCAL_IDENT;
975 /* Identifier or keyword? */
978 /* Read the identifier */
981 /* Check for special names. Bail out if we have identified the type of
982 * the token. Go on if the token is an identifier.
984 if (SB_GetLen (&SVal) == 1) {
985 switch (toupper (SB_AtUnchecked (&SVal, 0))) {
990 Tok = TOK_OVERRIDE_ABS;
999 Tok = TOK_OVERRIDE_FAR;
1019 Tok = TOK_OVERRIDE_ZP;
1028 } else if (CPU == CPU_SWEET16 && (IVal = Sweet16Reg (&SVal)) >= 0) {
1030 /* A sweet16 register number in sweet16 mode */
1036 /* Check for define style macro */
1037 if (IsDefine (&SVal)) {
1038 /* Macro - expand it */
1048 /* Ok, let's do the switch */
1103 Tok = TOK_NAMESPACE;
1142 while (C != '\n' && C != EOF) {
1187 } else if (C == '<') {
1190 } else if (C == '>') {
1213 } else if (C == '>') {
1227 /* Hack: If we allow ' as terminating character for strings, read
1228 * the following stuff as a string, and check for a one character
1231 if (LooseStringTerm) {
1232 ReadStringConst ('\'');
1233 if (SB_GetLen (&SVal) == 1) {
1234 IVal = SB_AtUnchecked (&SVal, 0);
1240 /* Always a character constant */
1242 if (C == EOF || IsControl (C)) {
1243 Error ("Illegal character constant");
1250 if (!MissingCharTerm) {
1251 Error ("Illegal character constant");
1260 ReadStringConst ('\"');
1265 /* Line continuation? */
1269 /* Handle as white space */
1284 /* In case of the main file, do not close it, but return EOF. */
1285 if (Source && Source->Next) {
1294 /* If we go here, we could not identify the current character. Skip it
1297 Error ("Invalid input character: 0x%02X", C & 0xFF);
1304 int GetSubKey (const char** Keys, unsigned Count)
1305 /* Search for a subkey in a table of keywords. The current token must be an
1306 * identifier and all keys must be in upper case. The identifier will be
1307 * uppercased in the process. The function returns the index of the keyword,
1308 * or -1 if the keyword was not found.
1313 /* Must have an identifier */
1314 PRECONDITION (Tok == TOK_IDENT);
1316 /* If we aren't in ignore case mode, we have to uppercase the identifier */
1321 /* Do a linear search (a binary search is not worth the effort) */
1322 for (I = 0; I < Count; ++I) {
1323 if (SB_CompareStr (&SVal, Keys [I]) == 0) {
1335 unsigned char ParseAddrSize (void)
1336 /* Check if the next token is a keyword that denotes an address size specifier.
1337 * If so, return the corresponding address size constant, otherwise output an
1338 * error message and return ADDR_SIZE_DEFAULT.
1341 static const char* Keys[] = {
1342 "DIRECT", "ZEROPAGE", "ZP",
1343 "ABSOLUTE", "ABS", "NEAR",
1348 /* Check for an identifier */
1349 if (Tok != TOK_IDENT) {
1350 Error ("Address size specifier expected");
1351 return ADDR_SIZE_DEFAULT;
1354 /* Search for the attribute */
1355 switch (GetSubKey (Keys, sizeof (Keys) / sizeof (Keys [0]))) {
1358 case 2: return ADDR_SIZE_ZP;
1361 case 5: return ADDR_SIZE_ABS;
1362 case 6: return ADDR_SIZE_FAR;
1364 case 8: return ADDR_SIZE_LONG;
1366 Error ("Address size specifier expected");
1367 return ADDR_SIZE_DEFAULT;
1373 void InitScanner (const char* InFile)
1374 /* Initialize the scanner, open the given input file */
1376 /* Open the input file */
1377 NewInputFile (InFile);
1382 void DoneScanner (void)
1383 /* Release scanner resources */