axe_expressions.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Andrea Di Biagio
  3. * Politecnico di Milano, 2007
  4. *
  5. * axe_expressions.h
  6. * Formal Languages & Compilers Machine, 2007/2008
  7. *
  8. */
  9. #ifndef _AXE_EXPRESSIONS_H
  10. #define _AXE_EXPRESSIONS_H
  11. #include "axe_engine.h"
  12. /* This function generats instructions for binary numeric
  13. * operations. It takes as input two expressions and a binary
  14. * operation identifier, and it returns a new expression that
  15. * represents the result of the specified binary operation
  16. * applied to `exp1' and `exp2'.
  17. *
  18. * Valid values for `binop' are:
  19. * ADD
  20. * ANDB
  21. * ORB
  22. * SUB
  23. * MUL
  24. * DIV */
  25. extern t_axe_expression handle_bin_numeric_op (t_program_infos *program
  26. , t_axe_expression exp1, t_axe_expression exp2, int binop);
  27. /* This function generates instructions that perform a
  28. * comparison between two values. It takes as input two
  29. * expressions and a binary comparison identifier, and it
  30. * returns a new expression that represents the result of the
  31. * specified binary comparison between `exp1' and `exp2'.
  32. *
  33. * Valid values for `condition' are:
  34. * _LT_ (used when is needed to test if the value of `exp1' is less than
  35. * the value of `exp2')
  36. * _GT_ (used when is needed to test if the value of `exp1' is greater than
  37. * the value of `exp2')
  38. * _EQ_ (used when is needed to test if the value of `exp1' is equal to
  39. * the value of `exp2')
  40. * _NOTEQ_ (used when is needed to test if the value of `exp1' is not equal to
  41. * the value of `exp2')
  42. * _LTEQ_ (used when is needed to test if the value of `exp1' is less than
  43. * or equal to the value of `exp2')
  44. * _GTEQ_ (used when is needed to test if the value of `exp1' is greater than
  45. * the value of `exp2') */
  46. extern t_axe_expression handle_binary_comparison (t_program_infos *program
  47. , t_axe_expression exp1, t_axe_expression exp2, int condition);
  48. #endif