LLlex.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  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 <em_arith.h>
  12. #include "system.h"
  13. #include "print.h"
  14. /* the structure of a token: */
  15. struct token {
  16. int tok_symb; /* the token itself */
  17. union {
  18. arith tok_val; /* numeric values */
  19. char *tok_str; /* string/filespecifier */
  20. } tok_data;
  21. };
  22. #include "file_info.h"
  23. #define tk_symb tok_symb
  24. #define tk_val tok_data.tok_val
  25. #define tk_str tok_data.tok_str
  26. extern struct token dot;
  27. extern int ReplaceMacros; /* "LLlex.c" */
  28. extern int AccFileSpecifier; /* "LLlex.c" */
  29. extern int AccDefined; /* "LLlex.c" */
  30. extern int UnknownIdIsZero; /* "LLlex.c" */
  31. extern int NoUnstack; /* "input.c" */
  32. extern int Unstacked; /* "input.c" */
  33. extern int err_occurred; /* "error.c" */
  34. #define DOT dot.tk_symb
  35. #define EOF (-1)
  36. #include <symbol2str.h>
  37. struct idf;
  38. struct token;
  39. char *string_token(char *nm, int stop_char);
  40. void skipcomment();
  41. int GetToken(struct token *ptok);
  42. void fatal(char *fmt, ...);
  43. void EnableMacros();
  44. int replace(struct idf *idef);
  45. void error(char *fmt, ...);
  46. int quoted(int c);
  47. int val_in_base(int c, int base);
  48. void crash(char *fmt, ...);
  49. void skipline();
  50. void warning(char *fmt, ...);
  51. void PushLex();
  52. void If_expr(void);
  53. void PopLex();
  54. void add_dependency(char *s);
  55. int skipspaces(int ch, int skipnl);
  56. void macro_def(struct idf *id, char *text, int nformals, int length, int flags);
  57. void DoUnstack();
  58. void init_pp();
  59. void do_option(char *text);
  60. void preprocess(char *fn);
  61. void domacro();
  62. int rank_of(int oper);
  63. char *GetIdentifier();
  64. char **getactuals(struct idf *idef);
  65. /* External */
  66. int InsertFile(char *, char **, char **);