tree.h 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef tree_h
  2. #define tree_h
  3. #include "lists.h"
  4. typedef struct Node *Node;
  5. typedef Node Command;
  6. typedef List Cmdlist;
  7. #include "operators.h"
  8. #include "symbols.h"
  9. #include "events.h"
  10. #define MAXNARGS 5
  11. struct Node {
  12. Operator op;
  13. Symbol nodetype;
  14. union treevalue {
  15. Symbol sym;
  16. Name name;
  17. long lcon;
  18. double fcon;
  19. String scon;
  20. Node arg[MAXNARGS];
  21. struct {
  22. Node cond;
  23. Cmdlist actions;
  24. } event;
  25. struct {
  26. Boolean inst;
  27. Event event;
  28. Cmdlist actions;
  29. } trace;
  30. struct {
  31. Boolean source;
  32. Boolean skipcalls;
  33. } step;
  34. struct {
  35. String mode;
  36. Node beginaddr;
  37. Node endaddr;
  38. Integer count;
  39. } examine;
  40. } value;
  41. };
  42. #define evalcmd(cmd) eval(cmd)
  43. #define cmdlist_append(cmd, cl) list_append(list_item(cmd), nil, cl)
  44. Node build(/* op, args */);
  45. Cmdlist buildcmdlist(/* cmd */);
  46. Node amper(/* p */);
  47. Node concrete(/* p */);
  48. printcmd(/* f, cmd */);
  49. prtree(/* f, p */);
  50. tfree(/* p */);
  51. Boolean tr_equal(/* t1, t2 */);
  52. #endif