Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. | expression AND expression
  2. {
  3. if ($1.type == $3.type)
  4. {
  5.  
  6. if ($1.type == Language::Type::BOOLEAN && $1.type == Language::Type::BOOLEAN)
  7. {
  8. $$.type == $1.type;
  9. $$.value.bool_val = $1.value.int_val && $3.value.int_val;
  10.  
  11. }
  12. else
  13. {
  14.  
  15. yyfmterror("Can't and on this type");
  16. }
  17. }
  18. else
  19. {
  20. yyfmterror("Invalid types for conspiring");
  21. }
  22. }
  23. | expression OR expression
  24. {
  25. if ($1.type == $3.type)
  26. {
  27.  
  28. if ($1.type == Language::Type::BOOLEAN && $1.type == Language::Type::BOOLEAN)
  29. {
  30. $$.type == $1.type;
  31. $$.value.bool_val = $1.value.int_val || $3.value.int_val;
  32.  
  33. }
  34. else
  35. {
  36.  
  37. yyfmterror("Can't or on this type");
  38. }
  39. }
  40. else
  41. {
  42. yyfmterror("Invalid types for conspiring");
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement