inter.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef VIRTUALMATH_INTER_H
  2. #define VIRTUALMATH_INTER_H
  3. struct Result;
  4. struct Inter{
  5. struct Value *base;
  6. struct LinkValue *link_base;
  7. struct HashTable *hash_base;
  8. struct Var *base_var;
  9. struct LinkValue *base_father;
  10. struct VarList *var_list;
  11. struct InterData{
  12. FILE *inter_stdout;
  13. FILE *inter_stderr;
  14. FILE *inter_stdin;
  15. bool is_stdout;
  16. bool is_stderr;
  17. bool is_stdin;
  18. struct Value *object;
  19. struct Value *vobject;
  20. struct Value *num;
  21. struct Value *str;
  22. struct Value *bool_;
  23. struct Value *pass_;
  24. struct Value *list;
  25. struct Value *dict;
  26. struct Value *function;
  27. struct Value *none;
  28. struct Value *list_iter;
  29. struct Value *dict_iter;
  30. struct Value *base_exc;
  31. struct Value *exc;
  32. struct Value *type_exc;
  33. struct Value *arg_exc;
  34. struct Value *per_exc;
  35. struct Value *name_exc;
  36. struct Value *goto_exc;
  37. struct Value *result_exc;
  38. struct Value *assert_exc;
  39. struct Value *key_exc;
  40. struct Value *index_exc;
  41. struct Value *stride_exc;
  42. struct Value *super_exc;
  43. struct Value *iterstop_exc;
  44. struct Value *import_exc;
  45. struct Value *include_exp;
  46. char *var_str_prefix;
  47. char *var_num_prefix;
  48. char *var_bool_prefix;
  49. char *var_none;
  50. char *var_pass;
  51. char *var_class_prefix;
  52. char *var_object_prefix;
  53. char *object_init;
  54. char *object_new;
  55. char *object_call;
  56. char *object_enter;
  57. char *object_exit;
  58. char *object_add;
  59. char *object_sub;
  60. char *object_mul;
  61. char *object_div;
  62. char *object_del;
  63. char *object_down;
  64. char *object_slice;
  65. char *object_iter;
  66. char *object_next;
  67. int default_pt_type;
  68. } data;
  69. };
  70. typedef struct Inter Inter;
  71. typedef struct Statement Statement;
  72. typedef enum ResultType ResultType;
  73. Inter *makeInter(char *out, char *error_, char *in, LinkValue *belong);
  74. void freeInter(Inter *inter, bool show_gc);
  75. void setBaseInterData(struct Inter *inter);
  76. ResultType runCodeBlock(char *code_file, Inter *inter);
  77. ResultType runCodeStdin(Inter *inter);
  78. void runParser(char *code_file, Inter *inter, bool is_one, Statement **st);
  79. ResultType runCode(Statement *st, Inter *inter);
  80. void mergeInter(Inter *new, Inter *base);
  81. #endif //VIRTUALMATH_INTER_H