BSD 3 development
[unix-history] / usr / src / cmd / as / astoks.h
CommitLineData
629188b5
JR
1/* Copyright (c) 1979 Regents of the University of California */
2/*
3 * Message to the wary: The order of tokens has been
4 * hand optimized and assigned to that all switch statements
5 * are implemented by a casel instruction on the VAX.
6 * there are 4 switch statements that have to be worried about:
7 * l) Per character switch in the character scanner (scan_dot_s)
8 * 2) Per token switch in the buffer manager (yylex)
9 * 3) Per keyword switch in the parser (yyparse)
10 * 4) Leading token switch for argments to opcodes
11 *
12 * You can't just add new tokens willy-nilly; make sure that you
13 * add them into the proper order!
14 */
15# define FIRSTTOKEN 0
16
17/*
18 * Tokens between ISPACE and INSTn are used by the per keyword switch
19 */
20# define ISPACE 1
21# define IBYTE 2
22# define IWORD 3
23# define IINT 4
24# define ILONG 5
25# define IDATA 6
26# define IGLOBAL 7
27# define ISET 8
28# define ITEXT 9
29# define ICOMM 10
30# define ILCOMM 11
31# define IFLOAT 12
32# define IDOUBLE 13
33# define IORG 14
34# define IASCII 15
35# define IASCIZ 16
36# define ILSYM 17
37# define IFILE 18
38# define ILINENO 19
39# define IABORT 20
40/*
41 * Tokens between ISTAB and REG are used in the per token switch
42 */
43# define ISTAB 23
44# define ISTABSTR 24
45# define ISTABNONE 25
46# define ISTABDOT 26
47# define IJXXX 27
48# define IALIGN 28
49# define INST0 29
50# define INSTn 30
51
52# define PARSEEOF 32
53# define ILINESKIP 33
54# define VOID 34
55# define SKIP 35
56# define INT 36
57# define FLTNUM 37
58# define NAME 38
59# define STRING 39
60/*
61 * Tokens between SIZESPEC and REGOP are used in the instruction
62 * argument switch
63 */
64# define SIZESPEC 41
65# define REG 42
66# define MUL 43
67# define LITOP 44
68# define LP 45
69# define MP 46
70/*
71 * Tokens between REGOP and DIV are used in the per character switch
72 */
73# define NEEDSBUF 48 /*signal refilling the input buffer*/
74# define REGOP 49 /*the percent sign*/
75# define NL 50
76# define SCANEOF 51
77# define BADCHAR 52
78# define SP 53
79# define ALPH 54
80# define DIG 55
81# define SQ 56
82# define DQ 57
83# define SH 58
84# define LSH 59
85# define RSH 60
86# define MINUS 61
87# define SIZEQUOTE 62
88/*
89 * Tokens between XOR and RP are used at random (primarily by the
90 * expression analyzer), and not used in any switch
91 */
92# define XOR 64
93# define DIV 65
94
95# define SEMI 66
96# define COLON 67
97# define PLUS 68
98# define IOR 69
99# define AND 70
100# define TILDE 71
101# define ORNOT 72
102# define CM 73
103# define LB 74
104# define RB 75
105# define RP 76
106
107# define LASTTOKEN 80