parse.clu 866 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. setup = proc (n: string);
  2. strs := strtab$create();
  3. chars := chartab$create();
  4. ints := inttab$create();
  5. types := typetab$create();
  6. idents := identtab$create();
  7. inf := file$open_read(n || " TEST");
  8. erf := file$open_write(n || " ERRORS");
  9. env := p_env$create({strs: strs,
  10. chars: chars,
  11. ints: ints,
  12. types: types,
  13. idents: idents,
  14. inf: inf,
  15. erf: erf});
  16. end setup;
  17. parse = proc ();
  18. def: definition := p_definition(env);
  19. file$putc(erf, '\n');
  20. set_margin(0);
  21. print(def, erf);
  22. pt_newline(erf);
  23. end parse;
  24. finish = proc ();
  25. chartab$print(chars, erf);
  26. pt_newline(erf);
  27. inttab$print(ints, erf);
  28. pt_newline(erf);
  29. typetab$print(types, erf);
  30. pt_newline(erf);
  31. identtab$print_names(idents, erf);
  32. pt_newline(erf);
  33. identtab$print_idns(idents, erf);
  34. file$close(inf);
  35. file$close(erf);
  36. end finish;