A token element as recognized during processing. More...
#include <ellipsis-token.h>
Public Member Functions | |
ellipsis‿token * | ellipsis‿token‿alloc‿_Ctra (void) |
Allocate a new token instance and initialize it. | |
ellipsis‿token * | ellipsis‿token‿alloc‿_Insta (void) |
Allocate a new token instance and initialize it. | |
ellipsis‿token * | ellipsis‿token‿alloc (void) |
Allocate a new token instance and initialize it. | |
void | ellipsis‿token‿cmove (ellipsis‿token const *__LOC_ID_0_4[restrict static 1], ellipsis‿token const **restrict __LOC_ID_0_5) |
Move a ellipsis‿token const pointed to by the second parameter to the one pointed to by the first. | |
ellipsis‿token * | ellipsis‿token‿cpy‿_Ctra (ellipsis‿token const *t) |
Allocation and copy of the token structure *t , replicating contents and space . | |
ellipsis‿token * | ellipsis‿token‿cpy‿_Insta (ellipsis‿token const *t) |
Allocation and copy of the token structure *t , replicating contents and space . | |
ellipsis‿token * | ellipsis‿token‿cpy (ellipsis‿token const *t) |
Allocation and copy of the token structure *t , replicating contents and space . | |
ellipsis‿token * | ellipsis‿token‿deepcpy‿_Ctra (ellipsis‿token const *t) |
Allocation and deep copy of the token structure. | |
ellipsis‿token * | ellipsis‿token‿deepcpy‿_Insta (ellipsis‿token const *t) |
Allocation and deep copy of the token structure. | |
ellipsis‿token * | ellipsis‿token‿deepcpy (ellipsis‿token const *t) |
Allocation and deep copy of the token structure. | |
void | ellipsis‿token‿delete‿_Ctra (ellipsis‿token t[static 1]) |
Destroy the token structure *t and deallocate it. | |
void | ellipsis‿token‿delete‿_Insta (ellipsis‿token t[static 1]) |
Destroy the token structure *t and deallocate it. | |
void | ellipsis‿token‿delete (ellipsis‿token t[static 1]) |
Destroy the token structure *t and deallocate it. | |
void | ellipsis‿token‿delete_all‿_Ctra (ellipsis‿token t[static 1]) |
Delete the whole token list starting with *t . | |
void | ellipsis‿token‿delete_all‿_Insta (ellipsis‿token t[static 1]) |
Delete the whole token list starting with *t . | |
void | ellipsis‿token‿delete_all (ellipsis‿token t[static 1]) |
Delete the whole token list starting with *t . | |
void | ellipsis‿token‿destroy‿_Ctra (ellipsis‿token t[static 1]) |
Destroy the token structure *t , freeing all linked contents , space and payload or data , and reinitialize. | |
void | ellipsis‿token‿destroy‿_Insta (ellipsis‿token t[static 1]) |
Destroy the token structure *t , freeing all linked contents , space and payload or data , and reinitialize. | |
void | ellipsis‿token‿destroy (ellipsis‿token t[static 1]) |
Destroy the token structure *t , freeing all linked contents , space and payload or data , and reinitialize. | |
void | ellipsis‿token‿drop (ellipsis‿token *head[static 1]) |
drop the top element from the list | |
bool | ellipsis‿token‿equiv‿_Ctra (ellipsis‿token *a, ellipsis‿token *b) |
Check if two token lists are token equivalent. | |
bool | ellipsis‿token‿equiv‿_Insta (ellipsis‿token *a, ellipsis‿token *b) |
Check if two token lists are token equivalent. | |
bool | ellipsis‿token‿equiv (ellipsis‿token *a, ellipsis‿token *b) |
Check if two token lists are token equivalent. | |
bool | ellipsis‿token‿is_inner (ellipsis‿token const *t, size_t len, char32_t const s[restrict static len]) |
void | ellipsis‿token‿move (ellipsis‿token *__LOC_ID_0_2[restrict static 1], ellipsis‿token **restrict __LOC_ID_0_3) |
Move a ellipsis‿token pointed to by the second parameter to the one pointed to by the first. | |
ellipsis‿token * | ellipsis‿token‿nominal‿_Ctra (char const id[static 1]) |
Create a new nominal token with the contents of id . | |
ellipsis‿token * | ellipsis‿token‿nominal‿_Insta (char const id[static 1]) |
Create a new nominal token with the contents of id . | |
ellipsis‿token * | ellipsis‿token‿nominal (char const id[static 1]) |
Create a new nominal token with the contents of id . | |
ellipsis‿token * | ellipsis‿token‿number‿_Ctra (vtype numb) |
Create a new numeral token that contains the value numb . | |
ellipsis‿token * | ellipsis‿token‿number‿_Insta (vtype numb) |
Create a new numeral token that contains the value numb . | |
ellipsis‿token * | ellipsis‿token‿number (vtype numb) |
Create a new numeral token that contains the value numb . | |
ellipsis‿token * | ellipsis‿token‿pop (ellipsis‿token *head[static 1]) |
Take head as pointing to the head of a token list and pop the first element from it. | |
void | ellipsis‿token‿push (ellipsis‿token *head[static 1], ellipsis‿token el[static 1]) |
ellipsis‿token * | ellipsis‿token‿repeat (ellipsis‿token p[static 1], size_t n) |
Return a list consisting of n repetitions of *p . | |
ellipsis‿token * | ellipsis‿token‿string‿_Ctra (char const str[static 1]) |
Create a new string token with the contents of str . | |
ellipsis‿token * | ellipsis‿token‿string‿_Insta (char const str[static 1]) |
Create a new string token with the contents of str . | |
ellipsis‿token * | ellipsis‿token‿string (char const str[static 1]) |
Create a new string token with the contents of str . | |
Data Fields | ||
union { | ||
macro_cb * callback | ||
ellipsis‿str8 * data | ||
ellipsis‿token‿list * payload | ||
}; | ||
bool | back_in:1 | |
ellipsis‿category | cat:ellipsis‿category‿width | |
ellipsis‿str32 const * | contents | |
size_t | file | |
bool | is_functional:1 | |
bool | is_undefinable:1 | |
ellipsis‿token‿what | is_what:2 | |
size_t | line | |
ellipsis‿token * | next | |
ellipsis‿str32 const * | space | |
bool | toeol:1 | |
vtype | value | |
Related Symbols | |
(Note that these are not member symbols.) | |
ellipsis‿token * | ellipsis‿token‿new (ellipsis‿token const __LOC_ID_0_1) |
Allocate a new ellipsis‿token as a shallow copy of the argument. | |
#define | TOKEN_IS(T, S) ellipsis‿token‿is_inner(T, (sizeof(U"" S U"")/sizeof(U' '))-1, U"" S U"") |
Check if the contents of the token T is the string S | |
#define | TOKEN_NEW(...) ellipsis‿token‿new((ellipsis‿token){__VA_ARGS__}) |
Allocate a new token instance and initialize it. | |
A token element as recognized during processing.
These are organized in a list DS.
Such a token comprises a contents
which is basically the text that led to the recognition
During processing token are allocated dynamically, be sure to use TOKEN_NEW() for_DEFER_REPLAY_FOR allocation and ellipsis‿token‿delete() for_DEFER_REPLAY_FOR deletion. These have their own garbage collection internally, please do not try to work around this.
|
inline |
Allocate a new token instance and initialize it.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿token‿alloc‿_Inner(), and ELLIPSIS_CONTRACT.
|
inline |
Allocate a new token instance and initialize it.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
|
inline |
Allocate a new token instance and initialize it.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ELLIPSIS_CONTRACT.
|
inline |
Move a ellipsis‿token const
pointed to by the second parameter to the one pointed to by the first.
If target
is not null before, the old pointed-to object is deleted.
|
inline |
Allocation and copy of the token structure *t
, replicating contents
and space
.
If t
is a null pointer, a default initialized structure is allocated and returned.
Returns a null pointer if no storage can be allocated.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿token‿cpy‿_Inner(), and ELLIPSIS_CONTRACT.
|
inline |
Allocation and copy of the token structure *t
, replicating contents
and space
.
If t
is a null pointer, a default initialized structure is allocated and returned.
Returns a null pointer if no storage can be allocated.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
|
inline |
Allocation and copy of the token structure *t
, replicating contents
and space
.
If t
is a null pointer, a default initialized structure is allocated and returned.
Returns a null pointer if no storage can be allocated.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ELLIPSIS_CONTRACT.
|
inline |
Allocation and deep copy of the token structure.
This recursively deep copies the whole list of tokens that start with t
and also deep copies the payload or data or assigns the callback if there is one.
Returns a null pointer if no storage can be allocated.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿token‿deepcpy‿_Inner(), and ELLIPSIS_CONTRACT.
|
inline |
Allocation and deep copy of the token structure.
This recursively deep copies the whole list of tokens that start with t
and also deep copies the payload or data or assigns the callback if there is one.
Returns a null pointer if no storage can be allocated.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
|
inline |
Allocation and deep copy of the token structure.
This recursively deep copies the whole list of tokens that start with t
and also deep copies the payload or data or assigns the callback if there is one.
Returns a null pointer if no storage can be allocated.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ELLIPSIS_CONTRACT.
|
inline |
Destroy the token structure *t
and deallocate it.
Does not iterate on t->next
.
References ellipsis‿token‿delete‿_Inner().
|
inline |
Destroy the token structure *t
and deallocate it.
Does not iterate on t->next
.
|
inline |
Destroy the token structure *t
and deallocate it.
Does not iterate on t->next
.
|
inline |
Delete the whole token list starting with *t
.
References ellipsis‿token‿delete_all‿_Inner().
|
inline |
Delete the whole token list starting with *t
.
|
inline |
Delete the whole token list starting with *t
.
|
inline |
Destroy the token structure *t
, freeing all linked contents
, space
and payload
or data
, and reinitialize.
Does not iterate on t->next
.
References ellipsis‿token‿destroy‿_Inner().
|
inline |
Destroy the token structure *t
, freeing all linked contents
, space
and payload
or data
, and reinitialize.
Does not iterate on t->next
.
|
inline |
Destroy the token structure *t
, freeing all linked contents
, space
and payload
or data
, and reinitialize.
Does not iterate on t->next
.
|
inline |
drop the top element from the list
|
inline |
Check if two token lists are token equivalent.
References ellipsis‿token‿equiv‿_Inner().
|
inline |
Check if two token lists are token equivalent.
|
inline |
Check if two token lists are token equivalent.
|
inline |
References ellipsis‿str32::array, contents, ellipsis‿str32::length, and TOKEN_IS_INNER_CASE.
|
inline |
Move a ellipsis‿token
pointed to by the second parameter to the one pointed to by the first.
If target
is not null before, the old pointed-to object is deleted.
|
inline |
Create a new nominal token with the contents of id
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿token‿nominal‿_Inner(), and ELLIPSIS_CONTRACT.
|
inline |
Create a new nominal token with the contents of id
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
|
inline |
Create a new nominal token with the contents of id
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ELLIPSIS_CONTRACT.
|
inline |
Create a new numeral token that contains the value numb
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿token‿number‿_Inner(), and ELLIPSIS_CONTRACT.
|
inline |
Create a new numeral token that contains the value numb
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
|
inline |
Create a new numeral token that contains the value numb
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ELLIPSIS_CONTRACT.
|
inline |
Take head
as pointing to the head of a token list and pop the first element from it.
head
is supposed to be non-null, but *head
may be null.
References next.
|
inline |
References next.
|
inline |
Return a list consisting of n
repetitions of *p
.
References ELLIPSIS_DIAGNOSTIC, and next.
|
inline |
Create a new string token with the contents of str
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿token‿string‿_Inner(), and ELLIPSIS_CONTRACT.
|
inline |
Create a new string token with the contents of str
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
|
inline |
Create a new string token with the contents of str
.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ELLIPSIS_CONTRACT.
|
related |
Allocate a new ellipsis‿token as a shallow copy of the argument.
References ELLIPSIS_CONTRACT.
|
related |
Check if the contents of the token T
is the string S
T
has to convert to ellipsis‿token const*
. S
has to be a string literal, either narrow of the form "word"
or UTF-32 of the form U"wörd"
.
|
related |
Allocate a new token instance and initialize it.
The parameter list is interpreted as initialization list and may be empty.
union { ... } |
a pointer member that depends on is_what
bool back_in |
if the result of a pragma is pushed back into the input stream
Referenced by ellipsis‿directive‿pragma(), and ellipsis‿pragma‿insert().
macro_cb* callback |
a macro with a callback
Referenced by callback_insert(), ellipsis‿directive‿pragma(), ellipsis‿expression‿resolve_defined(), ellipsis‿pragma‿insert(), and ellipsis‿token‿local_cpy().
Referenced by ellipsis‿directive‿define_process(), ellipsis‿directive‿embed_common(), ellipsis‿directive‿environment(), ellipsis‿directive‿gather(), ellipsis‿directive‿include_common(), ellipsis‿directive‿line_common(), ellipsis‿directive‿move(), ellipsis‿expression‿prefix(), ellipsis‿expression‿recurse(), ellipsis‿expression‿resolve_defined(), ellipsis‿expression‿ternary(), ellipsis‿filter‿local(), ellipsis‿lex‿category‿_Inner(), ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿macros‿activate(), ellipsis‿macros‿cb‿addition(), ellipsis‿macros‿cb‿defined(), ellipsis‿macros‿cb‿evaluate_bin(), ellipsis‿macros‿cb‿evaluate_dec(), ellipsis‿macros‿cb‿evaluate_hex(), ellipsis‿macros‿cb‿evaluate_oct(), ellipsis‿macros‿cb‿freeze(), ellipsis‿macros‿cb‿has_extension(), ellipsis‿macros‿cb‿has_feature(), ellipsis‿macros‿cb‿has_file(), ellipsis‿macros‿cb‿is_identifier(), ellipsis‿macros‿deactivate(), ellipsis‿macros‿mangle(), ellipsis‿pragma‿insert(), ellipsis‿special‿directive‿lex(), ellipsis‿token‿cpy‿_Inner(), ellipsis‿token‿dictionary‿catch(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿find(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿insert(), ellipsis‿token‿dictionary‿resize(), ellipsis‿token‿equiv‿_Inner(), ellipsis‿tokenize(), expand_functional(), and expand_macro().
ellipsis‿str32 const* contents |
the name or contents
Referenced by ellipsis‿directive‿define_process(), ellipsis‿directive‿embed_common(), ellipsis‿directive‿environment(), ellipsis‿directive‿expand(), ellipsis‿directive‿gather(), ellipsis‿directive‿include_common(), ellipsis‿directive‿line_common(), ellipsis‿directive‿move(), ellipsis‿directive‿pragma(), ellipsis‿directive‿undef(), ellipsis‿expression‿prefix(), ellipsis‿expression‿recurse(), ellipsis‿expression‿resolve_defined(), ellipsis‿filter(), ellipsis‿macros‿cb‿addition(), ellipsis‿macros‿cb‿any(), ellipsis‿macros‿cb‿defined(), ellipsis‿macros‿cb‿evaluate_bin(), ellipsis‿macros‿cb‿evaluate_dec(), ellipsis‿macros‿cb‿evaluate_hex(), ellipsis‿macros‿cb‿evaluate_oct(), ellipsis‿macros‿cb‿has_extension(), ellipsis‿macros‿cb‿has_feature(), ellipsis‿macros‿cb‿has_file(), ellipsis‿macros‿cb‿is_identifier(), ellipsis‿macros‿cb‿tolower(), ellipsis‿macros‿cb‿toupper(), ellipsis‿macros‿insert(), ellipsis‿macros‿mangle(), ellipsis‿output‿vrbs(), ellipsis‿pragma‿find(), ellipsis‿special‿directive‿lex(), ellipsis‿token‿cpy‿_Inner(), ellipsis‿token‿destroy‿_Inner(), ellipsis‿token‿dictionary‿find_pos(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿insert(), ellipsis‿token‿equiv‿_Inner(), ellipsis‿token‿is_inner(), ellipsis‿tokenize‿string(), ellipsis‿tokenize(), expand_functional(), expand_macro(), and has_c_attribute_callback().
ellipsis‿str8* data |
a token with additional byte data
Referenced by ellipsis‿directive‿embed_common(), ellipsis‿infra‿data(), ellipsis‿infra‿find(), ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿output‿vrbs(), ellipsis‿token‿destroy‿_Inner(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿token‿local_cpy(), and ellipsis‿tokenize().
size_t file |
physical source file associated with this token
Referenced by ellipsis‿output‿vrbs(), and ellipsis‿token‿cpy‿_Inner().
bool is_functional |
bool is_undefinable |
ellipsis‿token‿what is_what |
type of the payload or data
Referenced by callback_insert(), ellipsis‿directive‿embed_common(), ellipsis‿directive‿pragma(), ellipsis‿infra‿data(), ellipsis‿infra‿find(), ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿macros‿insert(), ellipsis‿output‿vrbs(), ellipsis‿pragma‿insert(), ellipsis‿token‿destroy‿_Inner(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿token‿local_cpy(), and expand_macro().
size_t line |
physical line number associated with this token
Referenced by ellipsis‿output‿vrbs(), and ellipsis‿token‿cpy‿_Inner().
ellipsis‿token* next |
next in the current list
Referenced by ellipsis‿directive‿embed_common(), ellipsis‿directive‿line_common(), ellipsis‿directive‿pragma(), ellipsis‿expression‿evaluate(), ellipsis‿macros‿cb‿freeze(), ellipsis‿output‿thrd(), ellipsis‿special‿directive‿lex(), ellipsis‿token‿deepcpy‿_Inner(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿token‿list::ellipsis‿token‿list‿append(), ellipsis‿token‿list::ellipsis‿token‿list‿flush(), ellipsis‿token‿list::ellipsis‿token‿list‿pop(), ellipsis‿token‿list::ellipsis‿token‿list‿push(), ellipsis‿token‿pop(), ellipsis‿token‿push(), ellipsis‿token‿repeat(), expand_functional(), and mark_parameters().
ellipsis‿token‿list* payload |
a token that represents a list of tokens
Referenced by callback_insert(), ellipsis‿c_punctuators‿fputs(), ellipsis‿directive‿define(), ellipsis‿directive‿define_process(), ellipsis‿directive‿embed(), ellipsis‿directive‿embed_common(), ellipsis‿directive‿embed_resource(), ellipsis‿directive‿environment(), ellipsis‿directive‿error(), ellipsis‿directive‿expand(), ellipsis‿directive‿gather(), ellipsis‿directive‿include(), ellipsis‿directive‿include_common(), ellipsis‿directive‿include_next(), ellipsis‿directive‿line(), ellipsis‿directive‿linenumber(), ellipsis‿directive‿macro_get(), ellipsis‿directive‿move(), ellipsis‿directive‿pragma(), ellipsis‿directive‿scatter(), ellipsis‿directive‿undef(), ellipsis‿directive‿warning(), ellipsis‿filter(), ellipsis‿macros‿_Once‿init‿user(), ellipsis‿macros‿cb‿addition(), ellipsis‿macros‿cb‿any(), ellipsis‿macros‿cb‿bind(), ellipsis‿macros‿cb‿error(), ellipsis‿macros‿cb‿warning(), ellipsis‿macros‿insert(), ellipsis‿output‿thrd(), ellipsis‿output‿vrbs(), ellipsis‿pragma‿once(), ellipsis‿special‿directive‿lex(), ellipsis‿token‿destroy‿_Inner(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿token‿equiv‿_Inner(), ellipsis‿token‿local_cpy(), expand_functional(), expand_macro(), has_c_attribute_callback(), macro_signed(), macro_string(), and mark_parameters().
ellipsis‿str32 const* space |
possible following space
Referenced by ellipsis‿directive‿define_process(), ellipsis‿macros‿insert(), ellipsis‿output‿vrbs(), ellipsis‿special‿directive‿lex(), ellipsis‿token‿cpy‿_Inner(), ellipsis‿token‿destroy‿_Inner(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿tokenize‿string(), ellipsis‿tokenize(), and expand_macro().
bool toeol |
if this is a construct that was terminated by an EOL
Referenced by ellipsis‿lex‿nonspace‿_Inner().
vtype value |
value if this token appears in a expression
Referenced by callback_insert(), ellipsis‿directive‿gather(), ellipsis‿directive‿line_common(), ellipsis‿directive‿macro_get(), ellipsis‿expression‿prefix(), ellipsis‿expression‿recurse(), ellipsis‿expression‿ternary(), ellipsis‿infra‿find(), ellipsis‿macros‿cb‿addition(), ellipsis‿macros‿cb‿defined(), ellipsis‿macros‿cb‿evaluate_bin(), ellipsis‿macros‿cb‿evaluate_dec(), ellipsis‿macros‿cb‿evaluate_hex(), ellipsis‿macros‿cb‿evaluate_oct(), ellipsis‿macros‿cb‿has_extension(), ellipsis‿macros‿cb‿has_feature(), ellipsis‿macros‿cb‿has_file(), ellipsis‿macros‿cb‿is_identifier(), ellipsis‿token‿cpy‿_Inner(), ellipsis‿token‿dictionary::ellipsis‿token‿dictionary‿fputs(), ellipsis‿token‿equiv‿_Inner(), evaluate_expression(), and expand_functional().