]> git.sur5r.net Git - cc65/blobdiff - src/ca65/scanner.h
More lineinfo usage.
[cc65] / src / ca65 / scanner.h
index 5d14c2e74fcf94d8ad748489b6dbff938afef958..0fad248d13fc31116f89684a6b04af1498b109c9 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2007 Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 
-/* common */
-#include "filepos.h"
-#include "inline.h"
-
 /* ca65 */
 #include "token.h"
 
 
 
 /* Scanner variables */
-#define MAX_INPUT_FILES        254             /* No more than this files total */
-#define MAX_STR_LEN            255             /* Maximum length of any string */
-extern enum Token Tok;                 /* Current token */
-extern int WS;                                 /* Flag: Whitespace before token */
-extern long IVal;                              /* Integer token attribute */
-extern char SVal[MAX_STR_LEN+1];        /* String token attribute */
-
-extern FilePos         CurPos;                 /* Name and position in file */
-extern int             ForcedEnd;              /* Force end of assembly */
+extern Token CurTok;            /* Current input token incl. attributes */
+extern int   ForcedEnd;                /* Force end of assembly */
 
 
 
@@ -78,8 +67,10 @@ int IsIdChar (int C);
 int IsIdStart (int C);
 /* Return true if the character may start an identifier */
 
-void NewInputFile (const char* Name);
-/* Open a new input file */
+int NewInputFile (const char* Name);
+/* Open a new input file. Returns true if the file could be successfully opened
+ * and false otherwise.
+ */
 
 void NewInputData (char* Text, int Malloced);
 /* Add a chunk of input data to the input stream */
@@ -93,22 +84,6 @@ void UpcaseSVal (void);
 void NextRawTok (void);
 /* Read the next raw token from the input stream */
 
-int TokHasSVal (enum Token Tok);
-/* Return true if the given token has an attached SVal */
-
-int TokHasIVal (enum Token Tok);
-/* Return true if the given token has an attached IVal */
-
-#if defined(HAVE_INLINE)
-INLINE int TokIsSep (enum Token T)
-/* Return true if this is a separator token */
-{
-    return (T == TOK_SEP || T == TOK_EOF);
-}
-#else
-#  define TokIsSep(T)   (T == TOK_SEP || T == TOK_EOF)
-#endif
-
 int GetSubKey (const char** Keys, unsigned Count);
 /* Search for a subkey in a table of keywords. The current token must be an
  * identifier and all keys must be in upper case. The identifier will be
@@ -136,3 +111,4 @@ void DoneScanner (void);
 
 
 
+