Get properties of an expression.
More...
Get properties of an expression.
- Since
- version
1.0.0
Expression type inspection
The type of an expression can and should be inspected using expression_get_type().
Constant expressions have dedicated inspection functions:
Number expressions
If an expression is a number, it is possible to:
Boolean expressions
If an expression is a boolean value, it is possible to:
Other expressions
For identifier expressions, the identifier can be obtained with expression_get_identifier().
The left and right operands of a binary operation can be obtained with expression_get_left() and expression_get_right().
- Warning
- Please note that it is only safe to use the appropriate getter(s) on an expression:
-
| bool expression_get_boolean |
( |
const expression * |
e | ) |
|
|
related |
Get an expression's boolean.
- Since
- version
1.0.0
- Parameters
-
- Returns
- Boolean.
| const char * expression_get_identifier |
( |
const expression * |
e | ) |
|
|
related |
Get an expression's identifier.
- Since
- version
1.0.0
- Parameters
-
- Returns
- Identifier.
Get an expression's left operand.
- Since
- version
1.0.0
- Parameters
-
- Returns
- Left operand.
| long int expression_get_number |
( |
const expression * |
e | ) |
|
|
related |
Get an expression's number.
- Since
- version
1.0.0
- Parameters
-
- Returns
- Number.
Get an expression's right operand.
- Since
- version
1.0.0
- Parameters
-
- Returns
- Right operand.
Get an expression's type.
- Since
- version
1.0.0
- Parameters
-
- Returns
- The expression's type.
| bool expression_is_boolean |
( |
const expression * |
e | ) |
|
|
related |
Determine whether an expression is a boolean expression.
- Since
- version
1.0.0
- Parameters
-
- Return values
-
| true | if the expression is a boolean. |
| false | otherwise. |
Determine whether an expression is false.
- Since
- version
1.0.0
- Parameters
-
- Return values
-
| true | if the expression is true. |
| otherwise. | |
| bool expression_is_identifier |
( |
const expression * |
e | ) |
|
|
related |
Determine whether an expression is an identifier.
- Since
- version
1.0.0
- Parameters
-
- Return values
-
| true | if the expression is an identifier. |
| false | otherwise. |
Determine whether an expression is a number expression.
- Since
- version
1.0.0
- Parameters
-
- Return values
-
| true | if the expression is a number. |
| false | otherwise. |
Determine whether an expression is 1.
- Since
- version
1.0.0
- Parameters
-
- Return values
-
| true | if the expression is 1. |
| otherwise. | |
Determine whether an expression is true.
- Since
- version
1.0.0
- Parameters
-
- Return values
-
| true | if the expression is true. |
| otherwise. | |
Determine whether an expression is 0.
- Since
- version
1.0.0
- Parameters
-
- Return values
-
| true | if the expression is 0. |
| otherwise. | |