#include "token/ellipsis-tlist.h"
Go to the source code of this file.
Functions | |
ellipsis‿token * | ellipsis‿expression‿evaluate (ellipsis‿token‿list *) |
bool | ellipsis‿expression‿make_integer (ellipsis‿token *t) |
void | ellipsis‿expression‿resolve_defined (ellipsis‿token‿list *in, ellipsis‿token‿list *out) |
ellipsis‿token * ellipsis‿expression‿evaluate | ( | ellipsis‿token‿list * | expr | ) |
This function uses a trick to ensure that only operators of the same priority appear on the same level of parenthesis. It consists of surrounding the expression with a large number of matching pairs of parenthesis and then surrounding operators by anti-matching pairs. For example an expression with addition and multiplication
a * b + c
is then replaced by
(...(( a )*( b ))+(( c ))...) ^^^ * has priority 1 ^^^^^ + has priority 2
(...(( a )*( b ))+(( c ))...) ^^^^^^^^^^^ inner expression (...( ab )+(( c ))...) ^^^^^^^^^^^^^^^^^^^^^ outer expression
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
defer needs braces and a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿expression‿recurse(), ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿destroy(), exp_signed, exp_unsigned, ellipsis‿token::next, and punctuator.
Referenced by _Atomic(), ellipsis‿macros‿cb‿evaluate(), and evaluate_expression().
bool ellipsis‿expression‿make_integer | ( | ellipsis‿token * | t | ) |
References ellipsis‿str32‿dup, exp_signed, exp_unsigned, and numeral.
Referenced by ellipsis‿directive‿line_common(), and ellipsis‿expression‿prefix().
void ellipsis‿expression‿resolve_defined | ( | ellipsis‿token‿list * | in, |
ellipsis‿token‿list * | out | ||
) |
start inner defer anchor at level 1
defer needs braces and a semicolon
start inner defer anchor at level 2
defer needs braces and a semicolon
end inner defer anchor, level 2
start inner defer anchor at level 2
defer needs braces and a semicolon
end inner defer anchor, level 2
end inner defer anchor, level 1
References ellipsis‿token::callback, ellipsis‿token::cat, ellipsis‿token::contents, ellipsis‿macros‿find(), ellipsis‿macros‿functions_find(), ellipsis‿str32‿delete(), ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿collect_call(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿pop(), ellipsis‿token‿list‿top(), ELLIPSIS_CONTRACT, exp_signed, and ellipsis‿str32::length.
Referenced by ellipsis‿macros‿cb‿evaluate(), and evaluate_expression().