LLlex.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /* the structure of a token: */
  12. struct token {
  13. int tok_symb; /* the token itself */
  14. union {
  15. char *tok_str;
  16. struct {
  17. int tok_unsigned;
  18. arith tok_val; /* for INTEGER */
  19. } tok_int;
  20. } tok_data;
  21. };
  22. #include "file_info.h"
  23. #include <symbol2str.h>
  24. #define tk_symb tok_symb
  25. #define tk_str tok_data.tok_str
  26. #define tk_val tok_data.tok_int.tok_val
  27. #define tk_unsigned tok_data.tok_int.tok_unsigned
  28. extern struct token dot;
  29. extern int ReplaceMacros; /* "LLlex.c" */
  30. extern int AccDefined; /* "LLlex.c" */
  31. extern int Unstacked; /* "LLlex.c" */
  32. extern int UnknownIdIsZero; /* "LLlex.c" */
  33. extern int AccFileSpecifier; /* "LLlex.c" */
  34. extern int NoUnstack; /* buffer.c */
  35. extern int err_occurred; /* "error.c" */
  36. struct idf;
  37. struct repl;
  38. void skipcomment();
  39. void fatal(char *fmt, ...);
  40. void error(char *fmt, ...);
  41. void warning(char *fmt, ...);
  42. void strict(char *fmt, ...);
  43. void crash(char *fmt, ...);
  44. int GetToken(struct token *ptok);
  45. void EnableMacros();
  46. int replace(struct idf *idf);
  47. int skipspaces(int ch, int skipnl);
  48. int SkipToNewLine();
  49. void do_pragma();
  50. int ifexpr();
  51. void If_expr(void);
  52. void add_dependency(char *s);
  53. int getparams(char *buf[], char parbuf[]);
  54. int macroeq(char *s, char *t);
  55. void add2repl(struct repl *repl, int ch);
  56. char *GetIdentifier(int skiponerr);
  57. void macro_def(struct idf *id, char *text, int nformals, int length, int flags);
  58. void unstackrepl();
  59. void init_pp();
  60. void do_option(char *text);
  61. void preprocess(char *fn);
  62. void do_undef(char *argstr);
  63. void domacro();
  64. int actual(struct repl *repl);
  65. void ch3mon(int oper, arith *pval, int *puns);
  66. int rank_of(int oper);
  67. void ch3bin(arith *pval, int *pis_uns, int oper, arith val, int is_uns);
  68. /* External */
  69. int InsertFile(char *, char **, char **);
  70. #define DOT dot.tk_symb
  71. #define EOF (-1)