bytecode.h 1019 B

123456789101112131415161718192021222324
  1. #ifndef AFUN_BYTECODE_H
  2. #define AFUN_BYTECODE_H
  3. // 相关结构体的定义
  4. typedef struct af_ByteCode af_ByteCode;
  5. enum af_BlockType {
  6. parentheses = 0, // 小括号
  7. brackets, // 中括号
  8. curly, // 大括号
  9. };
  10. af_ByteCode *makeLiteralByteCode(char *literal_data, char *func, char prefix, FileLine line, FilePath path);
  11. af_ByteCode *makeVariableByteCode(char *var, char prefix, FileLine line, FilePath path);
  12. af_ByteCode *makeBlockByteCode(enum af_BlockType type, af_ByteCode *element, char prefix, FileLine line, FilePath path, af_ByteCode **next);
  13. af_ByteCode *connectByteCode(af_ByteCode **base, af_ByteCode *next);
  14. af_ByteCode *CopyByteCode(af_ByteCode *base, FilePath *path);
  15. af_ByteCode *freeByteCode(af_ByteCode *bt);
  16. bool freeByteCodeWithElement(af_ByteCode *bt, af_ByteCode **next);
  17. void freeAllByteCode(af_ByteCode *bt);
  18. bool writeAllByteCode(af_ByteCode *bt, FILE *file);
  19. bool readAllByteCode(af_ByteCode **bt, FILE *file);
  20. void printByteCode(af_ByteCode *bt);
  21. #endif //AFUN_BYTECODE_H