]> git.sur5r.net Git - cc65/commitdiff
Renamed the Token enumeration to token_t.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 16 Jan 2011 14:51:13 +0000 (14:51 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 16 Jan 2011 14:51:13 +0000 (14:51 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4909 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/condasm.c
src/ca65/expr.c
src/ca65/macro.c
src/ca65/nexttok.c
src/ca65/nexttok.h
src/ca65/scanner.c
src/ca65/scanner.h
src/ca65/token.c
src/ca65/token.h
src/ca65/toklist.c
src/ca65/toklist.h

index e89bcf62b52f708129d75637d62db0d0eacde71e..5309a981d639876bda5ace3a8c226a38a37e1447 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2010, Ullrich von Bassewitz                                      */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
index fce0d157969a59059ebf1df8cbdb45be7fb6c12a..c299218d064fa86ef35effddb6c65065f5f0203c 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -333,7 +333,7 @@ static ExprNode* FuncBlank (void)
     /* We have a list of tokens that ends with the closing paren. Skip
      * the tokens, and count them. Allow optionally curly braces.
      */
-    Token Term = GetTokListTerm (TOK_RPAREN);
+    token_t Term = GetTokListTerm (TOK_RPAREN);
     unsigned Count = 0;
     while (Tok != Term) {
 
@@ -437,7 +437,7 @@ static ExprNode* DoMatch (enum TC EqualityLevel)
      * single linked list of tokens including attributes. The list is
      * either enclosed in curly braces, or terminated by a comma.
      */
-    Token Term = GetTokListTerm (TOK_COMMA);
+    token_t Term = GetTokListTerm (TOK_COMMA);
     while (Tok != Term) {
 
        /* We may not end-of-line of end-of-file here */
@@ -781,7 +781,7 @@ static ExprNode* FuncTCount (void)
     /* We have a list of tokens that ends with the closing paren. Skip
      * the tokens, and count them. Allow optionally curly braces.
      */
-    Token Term = GetTokListTerm (TOK_RPAREN);
+    token_t Term = GetTokListTerm (TOK_RPAREN);
     int Count = 0;
     while (Tok != Term) {
 
@@ -1046,7 +1046,7 @@ static ExprNode* Term (void)
         ExprNode* Right;
 
         /* Remember the token and skip it */
-        Token T = Tok;
+        token_t T = Tok;
         NextTok ();
 
         /* Move root to left side and read the right side */
@@ -1147,7 +1147,7 @@ static ExprNode* SimpleExpr (void)
         ExprNode* Right;
 
         /* Remember the token and skip it */
-        Token T = Tok;
+        token_t T = Tok;
         NextTok ();
 
         /* Move root to left side and read the right side */
@@ -1209,7 +1209,7 @@ static ExprNode* BoolExpr (void)
         ExprNode* Right;
 
         /* Remember the token and skip it */
-        Token T = Tok;
+        token_t T = Tok;
         NextTok ();
 
         /* Move root to left side and read the right side */
@@ -1276,7 +1276,7 @@ static ExprNode* Expr2 (void)
         ExprNode* Right;
 
         /* Remember the token and skip it */
-        Token T = Tok;
+        token_t T = Tok;
         NextTok ();
 
         /* Move root to left side and read the right side */
@@ -1335,7 +1335,7 @@ static ExprNode* Expr1 (void)
         ExprNode* Right;
 
         /* Remember the token and skip it */
-        Token T = Tok;
+        token_t T = Tok;
         NextTok ();
 
         /* Move root to left side and read the right side */
index 68ecda6f66f22a5dd966dbecd64ed52e12a2b45a..fdb65794bfa143d6ac4d398c36688ce1759e7786 100644 (file)
@@ -667,7 +667,7 @@ static void StartExpClassic (Macro* M)
 /* Start expanding the classic macro M */
 {
     MacExp*     E;
-    Token       Term;
+    token_t     Term;
 
 
     /* Skip the macro name */
@@ -769,7 +769,7 @@ static void StartExpDefine (Macro* M)
                TokNode*   Last;
 
         /* The macro may optionally be enclosed in curly braces */
-        Token Term = GetTokListTerm (TOK_COMMA);
+        token_t Term = GetTokListTerm (TOK_COMMA);
 
                /* Check if there is really a parameter */
                if (TokIsSep (Tok) || Tok == Term) {
index 5aa3d0217a0da4ab00074933572a83effca35adf..598f16104095aeed734444435ad4e774b2745724 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2010, Ullrich von Bassewitz                                      */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -102,7 +102,7 @@ static TokList* CollectTokens (unsigned Start, unsigned Count)
     TokList* List = NewTokList ();
 
     /* Determine if the list is enclosed in curly braces. */
-    Token Term = GetTokListTerm (TOK_RPAREN);
+    token_t Term = GetTokListTerm (TOK_RPAREN);
 
     /* Read the token list */
     unsigned Current = 0;
@@ -203,7 +203,7 @@ static void FuncIdent (void)
 /* Handle the .IDENT function */
 {
     StrBuf    Buf = STATIC_STRBUF_INITIALIZER;
-    Token     Id;
+    token_t Id;
     unsigned  I;
 
     /* Skip it */
@@ -701,7 +701,7 @@ void NextTok (void)
 
 
 
-void Consume (Token Expected, const char* ErrMsg)
+void Consume (token_t Expected, const char* ErrMsg)
 /* Consume Expected, print an error if we don't find it */
 {
     if (Tok == Expected) {
index 164c8c6b716b5d9d92ad3ad3b2a62ace444e6d8c..28806f94ed0c0644945b34fed2cd9586f6f7b442 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2007 Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -51,7 +51,7 @@
 void NextTok (void);
 /* Get next token and handle token level functions */
 
-void Consume (Token Expected, const char* ErrMsg);
+void Consume (token_t Expected, const char* ErrMsg);
 /* Consume Token, print an error if we don't find it */
 
 void ConsumeSep (void);
index 2c4b2292e6a6fb5dad429b1e3a2a0efc86074ab1..1444cacbe3e9abb6b6da576fe01e9ac880dc8244 100644 (file)
 
 
 
-Token Tok = TOK_NONE;                   /* Current token */
+token_t Tok = TOK_NONE;                 /* Current token */
 int WS;                                        /* Flag: Whitespace before token */
 long IVal;                             /* Integer token attribute */
 StrBuf SVal = STATIC_STRBUF_INITIALIZER;/* String token attribute */
 
-FilePos        CurPos = { 0, 0, 0 };           /* Name and position in current file */
+FilePos        CurPos = STATIC_FILEPOS_INITIALIZER;  /* Name and position in current file */
 
 
 
@@ -84,7 +84,7 @@ typedef struct InputFile InputFile;
 struct InputFile {
     FILE*                  F;                  /* Input file descriptor */
     FilePos        Pos;                /* Position in file */
-    Token           Tok;               /* Last token */
+    token_t         Tok;               /* Last token */
     int                    C;                  /* Last character */
     char                   Line[256];          /* The current input line */
     int             IncSearchPath;      /* True if we've added a search path */
@@ -98,7 +98,7 @@ struct InputData {
     char*                  Text;               /* Pointer to the text data */
     const char*     Pos;               /* Pointer to current position */
     int                    Malloced;           /* Memory was malloced */
-    Token           Tok;               /* Last token */
+    token_t         Tok;               /* Last token */
     int                    C;                  /* Last character */
     InputData*     Next;               /* Linked list of input data */
 };
@@ -117,7 +117,7 @@ struct CharSourceFunctions {
 /* Input source: Either file or data */
 struct CharSource {
     CharSource*                 Next;   /* Linked list of char sources */
-    Token                       Tok;   /* Last token */
+    token_t                     Tok;   /* Last token */
     int                                C;      /* Last character */
     const CharSourceFunctions*  Func;   /* Pointer to function table */
     union {
@@ -137,7 +137,7 @@ int                   ForcedEnd     = 0;
 /* List of dot keywords with the corresponding tokens */
 struct DotKeyword {
     const char*        Key;                    /* MUST be first field */
-    Token       Tok;
+    token_t     Tok;
 } DotKeywords [] = {
     { ".A16",                  TOK_A16         },
     { ".A8",                   TOK_A8          },
index fcbdd9c6475e2975fcb60d7924f7a47e24a715d0..be081dce7fe64f5479e8268be9d254616d3b9c45 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       */
@@ -54,7 +54,7 @@
 
 
 /* Scanner variables */
-extern Token Tok;                       /* Current token */
+extern token_t Tok;                     /* Current token */
 extern int WS;                                 /* Flag: Whitespace before token */
 extern long IVal;                              /* Integer token attribute */
 extern StrBuf SVal;                     /* String token attribute */
index 20c0fd9b1ac9a195a102fcc0844d3833097f023c..b389b85119428876d22d223f45882644cb6a1589 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2007      Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2007-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -44,7 +44,7 @@
 
 
 
-int TokHasSVal (Token Tok)
+int TokHasSVal (token_t Tok)
 /* Return true if the given token has an attached SVal */
 {
     return (Tok == TOK_IDENT || Tok == TOK_LOCAL_IDENT || Tok == TOK_STRCON);
@@ -52,7 +52,7 @@ int TokHasSVal (Token Tok)
 
 
 
-int TokHasIVal (Token Tok)
+int TokHasIVal (token_t Tok)
 /* Return true if the given token has an attached IVal */
 {
     return (Tok == TOK_INTCON || Tok == TOK_CHARCON || Tok == TOK_REG);
index c5fe629eb4d9bb6d0bca18a0eb8646a1d88b7835..b334c5bbf0e7fdb871229a85d4fb2abce56d1f48 100644 (file)
@@ -49,8 +49,8 @@
 
 
 
-/* Tokens */
-typedef enum Token {
+/* Tokens */ 
+typedef enum token_t {
     TOK_NONE,          /* Start value, invalid */
     TOK_EOF,                   /* End of input file */
     TOK_SEP,           /* Separator (usually newline) */
@@ -254,7 +254,7 @@ typedef enum Token {
     TOK_LASTPSEUDO     = TOK_ZEROPAGE,
 
     TOK_COUNT                  /* Count of tokens */
-} Token;
+} token_t;
 
 
 
@@ -264,14 +264,14 @@ typedef enum Token {
 
 
 
-int TokHasSVal (Token Tok);
+int TokHasSVal (token_t Tok);
 /* Return true if the given token has an attached SVal */
 
-int TokHasIVal (Token Tok);
+int TokHasIVal (token_t Tok);
 /* Return true if the given token has an attached IVal */
 
 #if defined(HAVE_INLINE)
-INLINE int TokIsSep (enum Token T)
+INLINE int TokIsSep (enum token_t T)
 /* Return true if this is a separator token */
 {
     return (T == TOK_SEP || T == TOK_EOF);
index 66847dcaca061b919bbdde8676cb1364d543c0a3..343e64e404686652ee27cd48120e68e3a5e4b5be 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -176,7 +176,7 @@ void FreeTokList (TokList* List)
 
 
 
-enum Token GetTokListTerm (enum Token Term)
+enum token_t GetTokListTerm (enum token_t Term)
 /* Determine if the following token list is enclosed in curly braces. This is
  * the case if the next token is the opening brace. If so, skip it and return
  * a closing brace, otherwise return Term.
index bdf5a76b28cc02c7633f814521de259bb8d5a234..08e64d0d1c79a2daff75072d36e7757560ddf137 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2008, Ullrich von Bassewitz                                      */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -56,7 +56,7 @@
 typedef struct TokNode TokNode;
 struct TokNode {
     TokNode*   Next;                   /* For single linked list */
-    Token      Tok;                    /* Token value */
+    token_t     Tok;                   /* Token value */
     int                WS;                     /* Whitespace before token? */
     long               IVal;                   /* Integer token attribute */
     StrBuf      SVal;                   /* String attribute, dyn. allocated */
@@ -113,7 +113,7 @@ TokList* NewTokList (void);
 void FreeTokList (TokList* T);
 /* Delete the token list including all token nodes */
 
-Token GetTokListTerm (Token Term);
+token_t GetTokListTerm (token_t Term);
 /* Determine if the following token list is enclosed in curly braces. This is
  * the case if the next token is the opening brace. If so, skip it and return
  * a closing brace, otherwise return Term.