From: uz Date: Sun, 16 Jan 2011 14:51:13 +0000 (+0000) Subject: Renamed the Token enumeration to token_t. X-Git-Tag: V2.13.3~551 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dbfae85f54a8c387d454e4bfbd7cffe3febdb36a;p=cc65 Renamed the Token enumeration to token_t. git-svn-id: svn://svn.cc65.org/cc65/trunk@4909 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/condasm.c b/src/ca65/condasm.c index e89bcf62b..5309a981d 100644 --- a/src/ca65/condasm.c +++ b/src/ca65/condasm.c @@ -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 */ diff --git a/src/ca65/expr.c b/src/ca65/expr.c index fce0d1579..c299218d0 100644 --- a/src/ca65/expr.c +++ b/src/ca65/expr.c @@ -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 */ diff --git a/src/ca65/macro.c b/src/ca65/macro.c index 68ecda6f6..fdb65794b 100644 --- a/src/ca65/macro.c +++ b/src/ca65/macro.c @@ -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) { diff --git a/src/ca65/nexttok.c b/src/ca65/nexttok.c index 5aa3d0217..598f16104 100644 --- a/src/ca65/nexttok.c +++ b/src/ca65/nexttok.c @@ -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) { diff --git a/src/ca65/nexttok.h b/src/ca65/nexttok.h index 164c8c6b7..28806f94e 100644 --- a/src/ca65/nexttok.h +++ b/src/ca65/nexttok.h @@ -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); diff --git a/src/ca65/scanner.c b/src/ca65/scanner.c index 2c4b2292e..1444cacbe 100644 --- a/src/ca65/scanner.c +++ b/src/ca65/scanner.c @@ -70,12 +70,12 @@ -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 }, diff --git a/src/ca65/scanner.h b/src/ca65/scanner.h index fcbdd9c64..be081dce7 100644 --- a/src/ca65/scanner.h +++ b/src/ca65/scanner.h @@ -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 */ diff --git a/src/ca65/token.c b/src/ca65/token.c index 20c0fd9b1..b389b8511 100644 --- a/src/ca65/token.c +++ b/src/ca65/token.c @@ -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); diff --git a/src/ca65/token.h b/src/ca65/token.h index c5fe629eb..b334c5bbf 100644 --- a/src/ca65/token.h +++ b/src/ca65/token.h @@ -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); diff --git a/src/ca65/toklist.c b/src/ca65/toklist.c index 66847dcac..343e64e40 100644 --- a/src/ca65/toklist.c +++ b/src/ca65/toklist.c @@ -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. diff --git a/src/ca65/toklist.h b/src/ca65/toklist.h index bdf5a76b2..08e64d0d1 100644 --- a/src/ca65/toklist.h +++ b/src/ca65/toklist.h @@ -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.