Move more stuff from scanner.c into the new module token.c.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3801 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2007-08-28 21:14:21 +00:00
parent aa4df9f98b
commit 3894b074a6
11 changed files with 138 additions and 83 deletions

View File

@@ -1,6 +1,6 @@
/*****************************************************************************/
/* */
/* token.c */
/* token.h */
/* */
/* Token list for the ca65 macro assembler */
/* */
@@ -38,6 +38,11 @@
/* common */
#include "inline.h"
/*****************************************************************************/
/* Data */
/*****************************************************************************/
@@ -45,7 +50,7 @@
/* Tokens */
enum Token {
typedef enum Token {
TOK_NONE, /* Start value, invalid */
TOK_EOF, /* End of input file */
TOK_SEP, /* Separator (usually newline) */
@@ -98,7 +103,7 @@ enum Token {
TOK_HASH, /* # */
TOK_COLON, /* : */
TOK_LPAREN, /* ( */
TOK_RPAREN, /* ) */
TOK_RPAREN, /* ) */
TOK_LBRACK, /* [ */
TOK_RBRACK, /* ] */
TOK_LCURLY, /* { */
@@ -241,7 +246,7 @@ enum Token {
TOK_LASTPSEUDO = TOK_ZEROPAGE,
TOK_COUNT /* Count of tokens */
};
} Token;
@@ -251,6 +256,24 @@ enum Token {
int TokHasSVal (Token Tok);
/* Return true if the given token has an attached SVal */
int TokHasIVal (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
/* End of token.h */
#endif