pastebin

Paste Search Dynamic
Recent pastes
Untitled
  1. %{
  2. #define YYSTYPE double
  3. #include "calcparse.tab.h"
  4. #include <math.h>
  5. extern double yylval;
  6. %}
  7. D       09.
  8.  
  9. [ \t]   { ; }
  10. log      return LOG;
  11. pi      return PIVAL;
  12. sin     return SIN;
  13. cos     return COS;
  14. tan     return TAN;
  15. and     return AND;
  16. not     return NOT;
  17. xor     return XOR;
  18. or      return OR;
  19. reg     return REGA;
  20. ans     return ANS;
  21. fix     return FIX;
  22. sci     return SCI;
  23. eng     return ENG;
  24. const   return const;
  25. bintodec return BINTODEC;
  26. dectobin return DECTOBIN;
  27. {D}+    { sscanf( yytext, "%lf", &yylval ); return NUMBER ; }
  28. [a‑zA‑Z_]+ return IDENT;
  29. "["     return OPENREG;
  30. "]"     return CLOSEREG;
  31. "<<"    return LEFTSHIFT;
  32. ">>"    return RIGHTSHIFT;
  33. "++"    return INC;
  34. "‑‑"    return DEC;
  35. "+"     return PLUS;
  36. "‑"     return MINUS;
  37. "~"     return UNARYMINUS;
  38. "/"     return DIV;
  39. "∗"     return MUL;
  40. "^"     return POW;
  41. "!"     return FACT;
  42. "("     return OPENBRACKET;
  43. ")"     return CLOSEBRACKET;
  44. "%"     return MOD;
  45. "^^"     return XOR;
  46. "!!"     return NOT;
  47. "="     return ASSIGN;
  48. "&&"    return LAND;
  49. "||"    return OR;
  50. "|"     return IOR;
  51. "&"     return AND;
  52. "~~"     return COMPLEMENT;
  53. "\n"    return EOLN;
Parsed in 0.019 seconds