lang.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. /* This file is part of the software similarity tester SIM.
  2. Written by Dick Grune, Vrije Universiteit, Amsterdam.
  3. $Id: lang.h,v 1.2 1998/01/21 14:27:51 dick Exp $
  4. */
  5. /*
  6. The token-providing module 'lang' has three interfaces:
  7. - lang.h, which provides access to the lowest-level token
  8. routines, to be used by the next level.
  9. - lex.h, which provides the lex variables, to be used by
  10. all and sundry.
  11. - language.h, which provides language-specific info about
  12. tokens, concerning their suitability as initial
  13. and final tokens, to be used by higher levels.
  14. This structure is not satisfactory, but it is also unreasonable
  15. to combine them in one interface.
  16. There is no single lang.c; rather it is represented by the
  17. various Xlang.c files generated from the Xlang.l files.
  18. */
  19. #include "token.h"
  20. /* useful macros */
  21. #define return_tk(tk) {lex_tk_cnt++; lex_token = (tk); return 1;}
  22. #define return_ch(ch) {lex_tk_cnt++; lex_token = int2TOKEN((int)(ch)); return 1;}
  23. #define return_eol() {lex_nl_cnt++; lex_token = EOL; return 1;}
  24. extern int yylex(void);
  25. extern void yystart(void);
  26. extern FILE *yyin;