Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | expression AND expression
- {
- if ($1.type == $3.type)
- {
- if ($1.type == Language::Type::BOOLEAN && $1.type == Language::Type::BOOLEAN)
- {
- $$.type == $1.type;
- $$.value.bool_val = $1.value.int_val && $3.value.int_val;
- }
- else
- {
- yyfmterror("Can't and on this type");
- }
- }
- else
- {
- yyfmterror("Invalid types for conspiring");
- }
- }
- | expression OR expression
- {
- if ($1.type == $3.type)
- {
- if ($1.type == Language::Type::BOOLEAN && $1.type == Language::Type::BOOLEAN)
- {
- $$.type == $1.type;
- $$.value.bool_val = $1.value.int_val || $3.value.int_val;
- }
- else
- {
- yyfmterror("Can't or on this type");
- }
- }
- else
- {
- yyfmterror("Invalid types for conspiring");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement