// Mnemonics, token categoty, token class, yacc token value
 
// Separators

DEF_TOKEN(" ",   WSPC, TKN_SPACE, 0)  
DEF_TOKEN("\n",  WSPC, TKN_LN, 0)
DEF_TOKEN(NULL,  WSPC, TKN_CMNT, 0)

// Numbers

DEF_TOKEN(NULL, NUM, TKN_ICONST, ICONST)
DEF_TOKEN(NULL, NUM, TKN_RCONST, RCONST)
DEF_TOKEN(NULL, STR, TKN_SCONST, SCONST)

// special symbols

DEF_TOKEN("(", PUT, TKN_LPAR, '(')
DEF_TOKEN(")", PUT, TKN_RPAR, ')')
DEF_TOKEN("[", PUT, TKN_LBR, '[')
DEF_TOKEN("]", PUT, TKN_RBR, ']')
DEF_TOKEN("+", PUT, TKN_PLUS, PLUS)
DEF_TOKEN("-", PUT, TKN_MINUS, MINUS)
DEF_TOKEN("*", PUT, TKN_MUL, MUL)
DEF_TOKEN("/", PUT, TKN_DIVR, DIVR)
DEF_TOKEN("&", PUT, TKN_C_AND, AND)
DEF_TOKEN("|", PUT, TKN_C_OR, OR)
DEF_TOKEN("~", PUT, TKN_C_NOT, NOT)
DEF_TOKEN(">>", PUT, TKN_C_SHR, SHR)
DEF_TOKEN("<<", PUT, TKN_C_SHL, SHL)
DEF_TOKEN("+=", PUT, TKN_LETADD, LETADD)
DEF_TOKEN("-=", PUT, TKN_LETSUB, LETSUB)
DEF_TOKEN("*=", PUT, TKN_LETMUL, LETMUL)
DEF_TOKEN("/=", PUT, TKN_LETDIV, LETDIV)
DEF_TOKEN("&=", PUT, TKN_LETAND, LETAND)
DEF_TOKEN("|=", PUT, TKN_LETOR, LETOR)
DEF_TOKEN(">>=", PUT, TKN_LETSHR, LETSHR)
DEF_TOKEN("<<=", PUT, TKN_LETSHL, LETSHL)
DEF_TOKEN(":", PUT, TKN_COLON, ':')
DEF_TOKEN(";", PUT, TKN_SEMICOLON, ';')
DEF_TOKEN(",", PUT, TKN_COMMA, ',')
DEF_TOKEN(".", PUT, TKN_DOT, '.')
DEF_TOKEN("^", PUT, TKN_HEAP, '^')
DEF_TOKEN("..", PUT, TKN_DOTS, DOTS)
DEF_TOKEN("=", PUT, TKN_EQ, EQ)
DEF_TOKEN(">=", PUT, TKN_GE, GE)
DEF_TOKEN(">", PUT, TKN_GT, GT)
DEF_TOKEN("<=", PUT, TKN_LE, LE)
DEF_TOKEN("<", PUT, TKN_LT, LT)
DEF_TOKEN("<>", PUT, TKN_NE, NE)
DEF_TOKEN(":=", PUT, TKN_LET, LET)
DEF_TOKEN("@", PUT, TKN_ADDR, '@')

DEF_TOKEN("abstract", ID, TKN_ABSTRACT, IDENT)
DEF_TOKEN("and", KWD, TKN_AND, AND)
DEF_TOKEN("array", KWD, TKN_ARRAY, ARRAY)
DEF_TOKEN("begin", KWD, TKN_BEGIN, BEGIN)
DEF_TOKEN("c", ID, TKN_C, IDENT)
DEF_TOKEN("case", KWD, TKN_CASE, CASE)
DEF_TOKEN("const", KWD, TKN_CONST, CONST)
DEF_TOKEN("constructor", KWD, TKN_CONSTRUCTOR, IDENT)
DEF_TOKEN("destructor", KWD, TKN_DESTRUCTOR, IDENT)
DEF_TOKEN("div", KWD, TKN_DIV, DIV)
DEF_TOKEN("do", KWD, TKN_DO, DO)
DEF_TOKEN("downto", KWD, TKN_DOWNTO, TO)
DEF_TOKEN("else", KWD, TKN_ELSE, ELSE)
DEF_TOKEN("end", KWD, TKN_END, END)
DEF_TOKEN("external", ID, TKN_EXTERNAL, SCOPE)
DEF_TOKEN("exit", ID, TKN_EXIT, IDENT)
DEF_TOKEN("far", KWD, TKN_FAR, IDENT)
DEF_TOKEN("file", KWD, TKN_FILE, FIL)
DEF_TOKEN("for", KWD, TKN_FOR, FOR)
DEF_TOKEN("function", KWD, TKN_FUNCTION, FUNCTION)
DEF_TOKEN("goto", KWD, TKN_GOTO, GOTO)
DEF_TOKEN("ident", KWD, TKN_IDENT, IDENT)
DEF_TOKEN("if", KWD, TKN_IF, IF)
DEF_TOKEN("halt", ID, TKN_HALT, IDENT)
DEF_TOKEN("implementation", KWD, TKN_IMPLEMENTATION, IDENT)
DEF_TOKEN("interface", KWD, TKN_INTERFACE, IDENT)
DEF_TOKEN("in", KWD, TKN_IN, IN)
DEF_TOKEN("label", KWD, TKN_LABEL, LABEL)
DEF_TOKEN("loophole", KWD, TKN_LOOPHOLE, LOOPHOLE)
DEF_TOKEN("mod", KWD, TKN_MOD, MOD)
DEF_TOKEN("not", KWD, TKN_NOT, NOT)
DEF_TOKEN("object", KWD, TKN_OBJECT, IDENT)
DEF_TOKEN("of", KWD, TKN_OF, OF)
DEF_TOKEN("or", KWD, TKN_OR, OR)
DEF_TOKEN("origin", KWD, TKN_ORIGIN, IDENT)
DEF_TOKEN("otherwise", KWD, TKN_OTHERWISE, OTHERWISE)
DEF_TOKEN("packed", KWD, TKN_PACKED, PACKED)
DEF_TOKEN("procedure", KWD, TKN_PROCEDURE, PROCEDURE)
DEF_TOKEN("program", KWD, TKN_PROGRAM, PROGRAM)
DEF_TOKEN("record", KWD, TKN_RECORD, RECORD)
DEF_TOKEN("repeat", KWD, TKN_REPEAT, REPEAT)
DEF_TOKEN("self", ID, TKN_SELF, IDENT)
DEF_TOKEN("set", KWD, TKN_SET, SET)
DEF_TOKEN("shl", KWD, TKN_SHL, IDENT)
DEF_TOKEN("shr", KWD, TKN_SHR, IDENT)
DEF_TOKEN("static", ID, TKN_STATIC, SCOPE)
DEF_TOKEN("str", ID, TKN_STR, IDENT)
DEF_TOKEN("string", ID, TKN_STRING, IDENT)
DEF_TOKEN("then", KWD, TKN_THEN, THEN)
DEF_TOKEN("to", KWD, TKN_TO, TO)
DEF_TOKEN("type", KWD, TKN_TYPE, TYPE)
DEF_TOKEN("until", KWD, TKN_UNTIL, UNTIL)
DEF_TOKEN("unit", KWD, TKN_UNIT, IDENT)
DEF_TOKEN("var", KWD, TKN_VAR, VAR)
DEF_TOKEN("virtual", ID, TKN_VIRTUAL, IDENT)
DEF_TOKEN("while", KWD, TKN_WHILE, WHILE)
DEF_TOKEN("with", KWD, TKN_WITH, WITH)
DEF_TOKEN("xor", KWD, TKN_XOR, IDENT)

DEF_TOKEN("succ",      ID, TKN_SUCC, IDENT)
DEF_TOKEN("pred",      ID, TKN_PRED, IDENT)
DEF_TOKEN("inc",       ID, TKN_INC, IDENT)
DEF_TOKEN("dec",       ID, TKN_DEC, IDENT)
DEF_TOKEN("read",      ID, TKN_READ, READ)
DEF_TOKEN("readln",    ID, TKN_READLN, READ)
DEF_TOKEN("write",     ID, TKN_WRITE, WRITE)
DEF_TOKEN("writeln",   ID, TKN_WRITELN, WRITE)
DEF_TOKEN("new",       ID, TKN_NEW, IDENT)
DEF_TOKEN("ref",       ID, TKN_REF, IDENT)
DEF_TOKEN("dispose",   ID, TKN_DISPOSE, IDENT)

DEF_TOKEN(NULL,      SPEC, TKN_GEN, 0)
DEF_TOKEN(NULL,      WSPC, TKN_PUSH_FILE,  0)
DEF_TOKEN(NULL,      WSPC, TKN_PUSH_UNIT,  0)
DEF_TOKEN(NULL,      WSPC, TKN_POP_FILE,  0)
DEF_TOKEN(NULL,      WSPC, TKN_SOURCE_FILE,  0)
DEF_TOKEN(NULL,      SPEC, TKN_UNIT_END, UNIT_END)
DEF_TOKEN(NULL,      SPEC, TKN_RESERVED, 0)
DEF_TOKEN(NULL,      SPEC, TKN_BEG_SHIFT, 0)
DEF_TOKEN(NULL,      SPEC, TKN_END_SHIFT, 0)
DEF_TOKEN(NULL,      SPEC, TKN_DUMMY, EOF)

#undef DEF_TOKEN



