lcalc.h 1.1 KB

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