1 /*****************************************************************************/
5 /* Token list for the ca65 macro assembler */
9 /* (C) 2007-2010, Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
46 /*****************************************************************************/
48 /*****************************************************************************/
54 TOK_NONE, /* Start value, invalid */
55 TOK_EOF, /* End of input file */
56 TOK_SEP, /* Separator (usually newline) */
57 TOK_IDENT, /* An identifier */
58 TOK_LOCAL_IDENT, /* A cheap local identifier */
60 TOK_INTCON, /* Integer constant */
61 TOK_CHARCON, /* Character constant */
62 TOK_STRCON, /* String constant */
64 TOK_A, /* A)ccumulator */
65 TOK_X, /* X register */
66 TOK_Y, /* Y register */
67 TOK_S, /* S register */
68 TOK_REG, /* Sweet16 R.. register (in sweet16 mode) */
71 TOK_ULABEL, /* :++ or :-- */
80 TOK_BOOLAND, /* .and */
82 TOK_BOOLXOR, /* .xor */
83 TOK_BOOLNOT, /* .not */
88 TOK_STAR = TOK_MUL, /* Alias */
93 TOK_BANK = TOK_XOR, /* Alias */
99 TOK_PC, /* $ if enabled */
100 TOK_NAMESPACE, /* :: */
111 TOK_AT, /* @ - in Sweet16 mode */
113 TOK_OVERRIDE_ZP, /* z: */
114 TOK_OVERRIDE_ABS, /* a: */
115 TOK_OVERRIDE_FAR, /* f: */
117 TOK_MACPARAM, /* Macro parameter, not generated by scanner */
118 TOK_REPCOUNTER, /* Repeat counter, not generated by scanner */
120 /* The next ones are tokens for the pseudo instructions. Keep together! */
122 TOK_A16 = TOK_FIRSTPSEUDO,
253 TOK_LASTPSEUDO = TOK_ZEROPAGE,
255 TOK_COUNT /* Count of tokens */
260 /*****************************************************************************/
262 /*****************************************************************************/
266 int TokHasSVal (Token Tok);
267 /* Return true if the given token has an attached SVal */
269 int TokHasIVal (Token Tok);
270 /* Return true if the given token has an attached IVal */
272 #if defined(HAVE_INLINE)
273 INLINE int TokIsSep (enum Token T)
274 /* Return true if this is a separator token */
276 return (T == TOK_SEP || T == TOK_EOF);
279 # define TokIsSep(T) (T == TOK_SEP || T == TOK_EOF)