1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +00:00

Renamed the Token enumeration to token_t.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4909 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-01-16 14:51:13 +00:00
parent 1d36b7f1b3
commit dbfae85f54
11 changed files with 49 additions and 49 deletions

View 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 */

View 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 */

View 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) {

View 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) {

View 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);

View File

@ -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 },

View 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 */

View 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);

View 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);

View 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.

View 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.