Compiler.h 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef __COMPILER_H
  2. #define __COMPILER_H
  3. #define FN_ASSIGN 0
  4. #define FN_MULTIPLY 1
  5. #define FN_DIVIDE 2
  6. #define FN_MODULO 3
  7. #define FN_ADD 4
  8. #define FN_SUB 5
  9. #define FN_AND 6
  10. #define FN_OR 7
  11. #define FN_UMINUS 8
  12. #define FN_UPLUS 9
  13. #define MATH_SIMPLE 0
  14. #define MATH_FN 1
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. int compileCode(char *exp);
  19. void executeCode(int handle, char visdata[2][2][576]);
  20. void freeCode(int handle);
  21. typedef struct {
  22. char *name;
  23. void *afunc;
  24. void *func_e;
  25. int nParams;
  26. } functionType;
  27. extern functionType *getFunctionFromTable(int idx);
  28. int createCompiledValue(double value, double *addrValue);
  29. int createCompiledFunction1(int fntype, int fn, int code);
  30. int createCompiledFunction2(int fntype, int fn, int code1, int code2);
  31. int createCompiledFunction3(int fntype, int fn, int code1, int code2, int code3);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif