dcalc.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* calc.h
  2. * include file for calc.c
  3. */
  4. /* 32 bit memory addresses: */
  5. #define LARGEMEM 1
  6. /* data structure of symbol table */
  7. struct symbol
  8. {
  9. char *spel;
  10. short attrib;
  11. #if LARGEMEM
  12. long sym;
  13. #else
  14. short sym;
  15. #endif
  16. };
  17. struct funent
  18. {
  19. char *spel;
  20. short attrib;
  21. double (*fun )();
  22. };
  23. struct varent
  24. {
  25. char *spel;
  26. short attrib;
  27. double *value;
  28. };
  29. struct strent
  30. {
  31. char *spel;
  32. short attrib;
  33. char *string;
  34. };
  35. /* general symbol attributes: */
  36. #define OPR 0x8000
  37. #define VAR 0x4000
  38. #define CONST 0x2000
  39. #define FUNC 0x1000
  40. #define ILLEG 0x800
  41. #define BUSY 0x400
  42. #define TEMP 0x200
  43. #define STRING 0x100
  44. #define COMMAN 0x80
  45. #define IND 0x1
  46. /* attributes of operators (ordered by precedence): */
  47. #define BOL 1
  48. #define EOL 2
  49. /* end of expression (comma): */
  50. #define EOE 3
  51. #define EQU 4
  52. #define PLUS 5
  53. #define MINUS 6
  54. #define MULT 7
  55. #define DIV 8
  56. #define UMINUS 9
  57. #define LPAREN 10
  58. #define RPAREN 11
  59. #define COMP 12
  60. #define MOD 13
  61. #define LAND 14
  62. #define LOR 15
  63. #define LXOR 16
  64. extern struct funent funtbl[];
  65. /*extern struct symbol symtbl[];*/
  66. extern struct varent indtbl[];