Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. #pragma once
  3.  
  4. // error codes
  5. #define ERR_BADFUNCTION -1
  6. #define ERR_BADNUMER -2
  7. #define ERR_GENERAL -3
  8. #define ERR_NOBRACKET -4
  9. #define ERR_BADVARIABLE -5
  10. #define ERR_OVERFLOW -6
  11. #define ERR_BADPARAM -7
  12.  
  13. typedef double variable_callback(char *s);
  14.  
  15. void set_exp(char *exp);
  16. // puts the token back to line
  17. void putback(double *hold);
  18. // gets the expression. This function is used externally
  19. int get_exp(double *hold);
  20.  
  21. // logic binary
  22. void level1(double *hold);
  23.  
  24. // unary !
  25. void level1_5(double *hold);
  26.  
  27. // works with +-
  28. void level2(double *hold);
  29. // works with */%
  30. void level3(double *hold);
  31. // works with ^
  32. void level4(double *hold);
  33. // works with ()
  34. void level5(double *hold);
  35. // works with elementary tokens
  36. void level6(double *hold);
  37. // gets value of number, function or variable
  38. void primitive(double *hold);
  39. // performs arithmetical operation
  40. void arith(char op, double *r, double *h);
  41.  
  42. void logic(char *op, double *r, double *h);
  43.  
  44.  
  45. // performs unary (one-operand) operation
  46. void unary(char op, double *r);
  47. // gets variable value by name
  48. extern variable_callback *find_var;
  49.  
  50. extern double rand_seed;
  51.  
  52. // stops execution of parser and return error code
  53. void serror(int code);
  54. // checks the function table to see if such a function exists
  55. int look_up(char *s);
  56.  
  57. bool strcmp(char *s1, char *s2);
  58. bool strncmp(char *s1, char *s2, int n);
  59.  
  60. extern double epsilon;
  61.  
  62.  
  63. int isdelim(char c);
  64. int isdigit(char c);
  65. int isalpha2(char c);
  66. int iswhite(char c);
  67.  
  68.  
  69.  
  70.  
  71.