LLlex.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* $Header$ */
  2. /* D E F I N I T I O N S F O R T H E L E X I C A L A N A L Y Z E R */
  3. /* A token from the input stream is represented by an integer,
  4. called a "symbol", but it may have other information associated
  5. to it.
  6. */
  7. /* the structure of a token: */
  8. struct token {
  9. int tok_symb; /* the token itself */
  10. char *tok_file; /* the file it (probably) comes from */
  11. unsigned int tok_line; /* the line it (probably) comes from */
  12. union {
  13. struct idf *tok_idf; /* for IDENTIFIER & TYPE_IDENTIFIER */
  14. char *tok_str; /* for STRING: text */
  15. struct { /* for INTEGER */
  16. int tok_fund; /* INT or LONG */
  17. arith tok_ival;
  18. } tok_integer;
  19. char *tok_fval;
  20. } tok_data;
  21. };
  22. #define tk_symb tok_symb
  23. #define tk_file tok_file
  24. #define tk_line tok_line
  25. #define tk_idf tok_data.tok_idf
  26. #define tk_str tok_data.tok_str
  27. #define tk_fund tok_data.tok_integer.tok_fund
  28. #define tk_ival tok_data.tok_integer.tok_ival
  29. #define tk_fval tok_data.tok_fval
  30. extern struct token dot, ahead, aside;
  31. extern unsigned int LineNumber; /* "LLlex.c" */
  32. extern char *FileName; /* "LLlex.c" */
  33. extern int ReplaceMacros; /* "LLlex.c" */
  34. extern int EoiForNewline; /* "LLlex.c" */
  35. extern int PreProcKeys; /* "LLlex.c" */
  36. extern int AccFileSpecifier; /* "LLlex.c" */
  37. extern int AccDefined; /* "LLlex.c" */
  38. extern int UnknownIdIsZero; /* "LLlex.c" */
  39. extern int SkipEscNewline; /* "LLlex.c" */
  40. extern int NoUnstack; /* buffer.c */
  41. extern int err_occurred; /* "error.c" */
  42. #define DOT dot.tk_symb
  43. #define AHEAD ahead.tk_symb
  44. #define ASIDE aside.tk_symb
  45. #define EOF (-1)