LLlex.h.old 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. /* 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 */
  7. /* A token from the input stream is represented by an integer,
  8. called a "symbol", but it may have other information associated
  9. to it.
  10. */
  11. #include "file_info.h"
  12. #include "nopp.h"
  13. /* the structure of a token: */
  14. struct token {
  15. int tok_symb; /* the token itself */
  16. char *tok_file; /* the file it (probably) comes from */
  17. unsigned int tok_line; /* the line it (probably) comes from */
  18. int tok_fund;
  19. union {
  20. struct idf *tok_idf; /* for IDENTIFIER & TYPE_IDENTIFIER */
  21. struct { /* for STRING */
  22. char *tok_bts; /* row of bytes */
  23. int tok_len; /* length of row of bytes */
  24. } tok_string;
  25. arith tok_ival; /* for INTEGER */
  26. char *tok_fval; /* for FLOATING */
  27. } tok_data;
  28. };
  29. #define tk_symb tok_symb
  30. #define tk_file tok_file
  31. #define tk_line tok_line
  32. #define tk_fund tok_fund
  33. #define tk_idf tok_data.tok_idf
  34. #define tk_bts tok_data.tok_string.tok_bts
  35. #define tk_len tok_data.tok_string.tok_len
  36. #define tk_ival tok_data.tok_ival
  37. #define tk_fval tok_data.tok_fval
  38. extern struct token dot, ahead, aside;
  39. extern int token_nmb; /* number of the ahead token */
  40. extern int tk_nmb_at_last_syn_err; /* token number at last syntax error */
  41. #ifndef NOPP
  42. extern int ReplaceMacros; /* "LLlex.c" */
  43. extern int AccDefined; /* "LLlex.c" */
  44. extern int Unstacked; /* "LLlex.c" */
  45. extern int UnknownIdIsZero; /* "LLlex.c" */
  46. #endif /* NOPP */
  47. extern int EoiForNewline; /* "LLlex.c" */
  48. extern int AccFileSpecifier; /* "LLlex.c" */
  49. extern int File_Inserted; /* "LLlex.c" */
  50. extern int NoUnstack; /* buffer.c */
  51. extern int err_occurred; /* "error.c" */
  52. #define DOT dot.tk_symb
  53. #define AHEAD ahead.tk_symb
  54. #define ASIDE aside.tk_symb
  55. #define EOF (-1)