run.h 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef VIRTUALMATH_RUN_H
  2. #define VIRTUALMATH_RUN_H
  3. #include "__macro.h"
  4. enum StatementInfoStatus;
  5. typedef struct Result Result;
  6. typedef enum ResultType ResultType;
  7. typedef struct LinkValue LinkValue;
  8. typedef struct Value Value;
  9. typedef struct Statement Statement;
  10. typedef struct StatementList StatementList;
  11. typedef struct Inter Inter;
  12. typedef struct VarList VarList;
  13. typedef struct Parameter Parameter;
  14. typedef struct DecorationStatement DecorationStatement;
  15. typedef ResultType (*VarInfo)(char **name, int *times, INTER_FUNCTIONSIG);
  16. ResultType globalIterStatement(Result *result, LinkValue *base_father, Inter *inter, Statement *st);
  17. bool operationSafeInterStatement(INTER_FUNCTIONSIG);
  18. bool ifBranchSafeInterStatement(INTER_FUNCTIONSIG);
  19. bool functionSafeInterStatement(INTER_FUNCTIONSIG);
  20. bool blockSafeInterStatement(INTER_FUNCTIONSIG);
  21. bool cycleBranchSafeInterStatement(INTER_FUNCTIONSIG);
  22. bool tryBranchSafeInterStatement(INTER_FUNCTIONSIG);
  23. Statement *checkLabel(Statement *base, char *label);
  24. ResultType operationStatement(INTER_FUNCTIONSIG);
  25. ResultType setClass(INTER_FUNCTIONSIG);
  26. ResultType setFunction(INTER_FUNCTIONSIG);
  27. ResultType setLambda(INTER_FUNCTIONSIG);
  28. ResultType callBack(INTER_FUNCTIONSIG);
  29. ResultType callBackCore(LinkValue *function_value, Parameter *parameter, long line, char *file, INTER_FUNCTIONSIG_NOT_ST);
  30. ResultType callClass(LinkValue *class_value, Parameter *parameter, long int line, char *file, INTER_FUNCTIONSIG_NOT_ST);
  31. ResultType callFunction(LinkValue *function_value, Parameter *parameter, long int line, char *file, INTER_FUNCTIONSIG_NOT_ST);
  32. ResultType setDecoration(DecorationStatement *ds, LinkValue *value, INTER_FUNCTIONSIG_NOT_ST);
  33. ResultType getVar(INTER_FUNCTIONSIG, VarInfo var_info);
  34. ResultType getBaseValue(INTER_FUNCTIONSIG);
  35. ResultType getList(INTER_FUNCTIONSIG);
  36. ResultType getDict(INTER_FUNCTIONSIG);
  37. ResultType setDefault(INTER_FUNCTIONSIG);
  38. ResultType ifBranch(INTER_FUNCTIONSIG);
  39. ResultType whileBranch(INTER_FUNCTIONSIG);
  40. ResultType withBranch(INTER_FUNCTIONSIG);
  41. ResultType tryBranch(INTER_FUNCTIONSIG);
  42. ResultType breakCycle(INTER_FUNCTIONSIG);
  43. ResultType continueCycle(INTER_FUNCTIONSIG);
  44. ResultType regoIf(INTER_FUNCTIONSIG);
  45. ResultType restartCode(INTER_FUNCTIONSIG);
  46. ResultType returnCode(INTER_FUNCTIONSIG);
  47. ResultType yieldCode(INTER_FUNCTIONSIG);
  48. ResultType raiseCode(INTER_FUNCTIONSIG);
  49. ResultType assertCode(INTER_FUNCTIONSIG);
  50. ResultType gotoLabel(INTER_FUNCTIONSIG);
  51. ResultType runLabel(INTER_FUNCTIONSIG);
  52. ResultType includeFile(INTER_FUNCTIONSIG);
  53. ResultType importFile(INTER_FUNCTIONSIG);
  54. ResultType fromImportFile(INTER_FUNCTIONSIG);
  55. ResultType pointAss(Statement *name, LinkValue *value, INTER_FUNCTIONSIG_NOT_ST);
  56. ResultType assCore(Statement *name, LinkValue *value, INTER_FUNCTIONSIG_NOT_ST);
  57. char *setStrVarName(char *old, bool free_old, INTER_FUNCTIONSIG_CORE);
  58. char *setNumVarName(NUMBER_TYPE num, INTER_FUNCTIONSIG_CORE);
  59. char *getNameFromValue(Value *value, INTER_FUNCTIONSIG_CORE);
  60. ResultType getBaseVarInfo(char **name, int *times, INTER_FUNCTIONSIG);
  61. ResultType getBaseSVarInfo(char **name, int *times, INTER_FUNCTIONSIG);
  62. ResultType getVarInfo(char **name, int *times, INTER_FUNCTIONSIG);
  63. Statement *getRunInfoStatement(Statement *funtion_st);
  64. bool popStatementVarList(Statement *funtion_st, VarList **function_var, VarList *out_var, Inter *inter);
  65. void newFunctionYield(Statement *funtion_st, Statement *node, VarList *new_var, Inter *inter);
  66. void updateFunctionYield(Statement *function_st, Statement *node);
  67. void freeFunctionYield(Statement *function_st, Inter *inter);
  68. void updateBranchYield(Statement *branch_st, Statement *node, StatementList *sl_node, enum StatementInfoStatus status);
  69. void newWithBranchYield(Statement *branch_st, Statement *node, StatementList *sl_node, VarList *new_var, enum StatementInfoStatus status,
  70. Inter *inter, LinkValue *value, LinkValue *_exit_, LinkValue *_enter_);
  71. void updateBranchYield(Statement *branch_st, Statement *node, StatementList *sl_node, enum StatementInfoStatus status);
  72. #endif //VIRTUALMATH_RUN_H