|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 5158 (0x1426)
Types: TextFile
Names: »clex_sym.h«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec1/clex/clex_sym.h«
/* clex_sym.h:
// This file defines both an enum {} type named "symbol", and
// a variable sym_str[] with string representations of the
// symbols. It is intended to maintain an exact
// correspondence between array entries and symbol values.
*/
/*
This file is #include'd twice: once for the enum
(with CLEX_IMPLEMENTATION turned off) and once for
the array initialization (with it turned on). The
lower-numbered symbols have uppercase name strings,
but the keyword symbol strings are stored separately.
If a keyword is to be added, add it first to the
standalone program kwhash.c and generate a new
perfect hash function for the new set. Then add
it to both places below and modify the hash function
and table size in clex.c.
*/
#ifndef CLEX_IMPLEMENTATION
#define CLEX_S(sym) sym
#define CLEX_S2(sym1,sym2) sym1
enum Clex_sym
{
#else /* CLEX_IMPLEMENTATION */
#undef CLEX_S
#undef CLEX_S2
#define CLEX_S(sym) "sym"
#define CLEX_S2(sym1,sym2) sym2
static char* sym_str[] =
{
#endif /* CLEX_IMPLEMENTATION */
CLEX_S(NONE_S = 0), /* should never get this */
CLEX_S(ERROR_S),
CLEX_S( ERROR_EOLN_S),
CLEX_S( ERROR_EOF_S),
CLEX_S( ERROR_UNKN_S),
#ifndef CLEX_IMPLEMENTATION
CLEX_S(ERROR_MAX = ERROR_UNKN_S),
#endif
CLEX_S(EOF_S),
CLEX_S(EOLN_S), // \n
CLEX_S(BANG_S), // !
CLEX_S( NE_S), // !=
CLEX_S(QUOTE_S), // "
CLEX_S(POUND_S), // #
CLEX_S(MOD_S), // %
CLEX_S( MODAS_S), // %=
CLEX_S(AMPER_S), // &
CLEX_S( LAND_S), // &&
CLEX_S( ANDAS_S), // &=
CLEX_S(APOS_S), // '
CLEX_S(LPAR_S), // (
CLEX_S(RPAR_S), // )
CLEX_S(STAR_S), // *
CLEX_S( MULAS_S), // *=
CLEX_S(PLUS_S), // +
CLEX_S( INCRE_S), // ++
CLEX_S( ADDAS_S), // +=
CLEX_S(COMMA_S), // ),
CLEX_S(MINUS_S), // -
CLEX_S( DECRE_S), // --
CLEX_S( SUBAS_S), // -=
CLEX_S( DEREF_S), // ->
CLEX_S(DOT_S), // .
CLEX_S( ELLIP_S), // ...
CLEX_S(SLASH_S), // /
CLEX_S( DIVAS_S), // /=
CLEX_S(COLON_S), // :
CLEX_S( SCOPE_S), // ::
CLEX_S(SEMI_S), // ;
CLEX_S(LT_S), // <
CLEX_S( LE_S), // <=
CLEX_S( SHL_S), // <<
CLEX_S( SHLAS_S), // <<=
CLEX_S(AS_S), // =
CLEX_S( EQ_S), // ==
CLEX_S(GT_S), // >
CLEX_S( GE_S), // >=
CLEX_S( SHR_S), // >>
CLEX_S( SHRAS_S), // >>=
CLEX_S(QUEST_S), // ?
CLEX_S(AT_S), // @ (undefined)
CLEX_S(LBRACK_S), // [
CLEX_S(BSLASH_S), // \
CLEX_S(RBRACK_S), // ]
CLEX_S(CARET_S), // ^
CLEX_S( XORAS_S), // ^=
CLEX_S(GRAVE_S), // ` (undefined)
CLEX_S(LBRACE_S), // {
CLEX_S(VBAR_S), // |
CLEX_S( LOR_S), // ||
CLEX_S( ORAS_S), // |=
CLEX_S(RBRACE_S), // }
CLEX_S(TILDE_S), // ~
CLEX_S(IDENT_S), // a name, or string that could be a name
CLEX_S(NUM_S), // a numeric string
CLEX_S(FLOATNUM_S) // a recognizably floating-point num
#ifndef CLEX_IMPLEMENTATION
, CLEX_S(KEYWORD_S),
#else
};
static char *keywords[] =
{
#endif
CLEX_S2(ASM_S = KEYWORD_S, "asm"),
CLEX_S2(AUTO_S, "auto"),
CLEX_S2(BREAK_S, "break"),
CLEX_S2(CASE_S, "case"),
CLEX_S2(CHAR_S, "char"),
CLEX_S2(CLASS_S, "class"),
CLEX_S2(CONST_S, "const"),
CLEX_S2(CONTINUE_S, "continue"),
CLEX_S2(DEFAULT_S, "default"),
CLEX_S2(DELETE_S, "delete"),
CLEX_S2(DO_S, "do"),
CLEX_S2(DOUBLE_S, "double"),
CLEX_S2(ELSE_S, "else"),
CLEX_S2(ENUM_S, "enum"),
CLEX_S2(EXTERN_S, "extern"),
CLEX_S2(FLOAT_S, "float"),
CLEX_S2(FOR_S, "for"),
CLEX_S2(FRIEND_S, "friend"),
CLEX_S2(GOTO_S, "goto"),
CLEX_S2(IF_S, "if"),
CLEX_S2(INLINE_S, "inline"),
CLEX_S2(INT_S, "int"),
CLEX_S2(LONG_S, "long"),
CLEX_S2(NEW_S, "new"),
CLEX_S2(OPERATOR_S, "operator"),
CLEX_S2(OVERLOAD_S, "overload"),
CLEX_S2(PRIVATE_S, "private"),
CLEX_S2(PROTECTED_S,"protected"),
CLEX_S2(PUBLIC_S, "public"),
CLEX_S2(REGISTER_S, "register"),
CLEX_S2(RETURN_S, "return"),
CLEX_S2(SHORT_S, "short"),
CLEX_S2(SIGNED_S, "signed"),
CLEX_S2(SIZEOF_S, "sizeof"),
CLEX_S2(STATIC_S, "static"),
CLEX_S2(STRUCT_S, "struct"),
CLEX_S2(SWITCH_S, "switch"),
CLEX_S2(THIS_S, "this"),
CLEX_S2(TYPEDEF_S, "typedef"),
CLEX_S2(UNION_S, "union"),
CLEX_S2(UNSIGNED_S, "unsigned"),
CLEX_S2(VIRTUAL_S, "virtual"),
CLEX_S2(VOLATILE_S, "volatile"),
CLEX_S2(VOID_S, "void"),
CLEX_S2(WHILE_S, "while"),
CLEX_S2(END_OF_SYMBOLS_S, NULL)
};
#ifndef CLEX_IMPLEMENTATION
const CLEX_NUMKEYS = (END_OF_SYMBOLS_S - KEYWORD_S);
#endif