bytecode.h 1015 B

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