C++: Add tables for ConditionalExprs

This commit is contained in:
Ian Lynagh
2018-12-04 13:32:50 +00:00
parent 54520003f8
commit dc3d87f2fc
2 changed files with 53 additions and 3 deletions

View File

@@ -1171,6 +1171,41 @@ expr_deallocator(
int form: int ref
);
/**
* Holds if the `@conditionalexpr` is of the two operand form
* `guard ? : false`.
*/
expr_cond_two_operand(
unique int cond: @conditionalexpr ref
);
/**
* The guard of `@conditionalexpr` `guard ? true : false`
*/
expr_cond_guard(
unique int cond: @conditionalexpr ref,
int guard: @expr ref
);
/**
* The expression used when the guard of `@conditionalexpr`
* `guard ? true : false` holds. For the two operand form
* `guard ?: false` consider using `expr_cond_guard` instead.
*/
expr_cond_true(
unique int cond: @conditionalexpr ref,
int true: @expr ref
);
/**
* The expression used when the guard of `@conditionalexpr`
* `guard ? true : false` does not hold.
*/
expr_cond_false(
unique int cond: @conditionalexpr ref,
int false: @expr ref
);
// the second field is a string representation of the value
// the third field is the actual text in the source or the same as the second field
values(