#include <stddef.h>
#include "ellipsis-category.h"
#include "utils/ellipsis-str32.h"
#include "utils/ellipsis-str8.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | ellipsis‿special |
Typedefs | |
typedef struct ellipsis‿contracts‿is_ice | ellipsis‿contracts‿is_ice |
typedef void | ellipsis‿special‿append(size_t len, ellipsis‿special *p) |
typedef ellipsis‿special const * | ellipsis‿special‿find(size_t len, char const buf[len]) |
Functions | |
void | ellipsis‿special‿cpy (size_t len, ellipsis‿special target[static restrict len], ellipsis‿special const source[static restrict len]) |
void | ellipsis‿special‿delete (size_t len, ellipsis‿special const target[static restrict len]) |
ellipsis‿str32 * | ellipsis‿special‿scan‿str32‿_Ctra (ellipsis‿special const sp[static 1], size_t len[static 1], char const *restrict buf[static 1], bool terminated[static 1], bool without, bool unescaped) |
ellipsis‿str32 * | ellipsis‿special‿scan‿str32 (ellipsis‿special const sp[static 1], size_t len[static 1], char const *restrict buf[static 1], bool terminated[static 1], bool without, bool unescaped) |
ellipsis‿str8 * | ellipsis‿special‿scan‿str8‿_Ctra (ellipsis‿special const sp[static 1], size_t len[static 1], char const *restrict buf[static 1], bool terminated[static 1], bool without, bool unescaped) |
ellipsis‿str8 * | ellipsis‿special‿scan‿str8 (ellipsis‿special const sp[static 1], size_t len[static 1], char const *restrict buf[static 1], bool terminated[static 1], bool without, bool unescaped) |
Variables | |
thread_local bool volatile | ellipsis‿contracts‿ignore‿dynamic |
thread_local bool volatile | ellipsis‿contracts‿proceed‿dynamic |
thread_local bool volatile | ellipsis‿contracts‿verbose‿dynamic |
#define ELLIPSIS_CONTRACT | ( | COUNT, | |
COND, | |||
ACTION, | |||
VERB, | |||
CSTR, | |||
CTYPE, | |||
... | |||
) |
#define ELLIPSIS_CONTRACT_CHECK_STATIC | ( | CTYPE, | |
COND, | |||
CSTR, | |||
... | |||
) |
#define ELLIPSIS_CONTRACT_ICE_OR_TRUE | ( | ... | ) |
#define ELLIPSIS_CONTRACT_IMPL | ( | COUNT, | |
COND, | |||
ACTION, | |||
VERB, | |||
CSTR, | |||
CTYPE, | |||
... | |||
) |
#define ELLIPSIS_CONTRACT_VIOLATION | ( | COUNT, | |
VERB, | |||
CTYPE, | |||
CSTR, | |||
... | |||
) |
#define ELLIPSIS_STR32_LITERAL ELLIPSIS_STR32_LITERAL_GLOBAL |
#define ELLIPSIS_STR8_LITERAL ELLIPSIS_STR8_LITERAL_GLOBAL |
characterize a special lexical element
Such a special is characterized by a starter
and optional closer
and replacement.
For punctuators or similar there is no closer
and the starter
string is just as it would appear in the source. A possible repl
string is then how it is preferred for internal unification. E.g a !=
digraph is replaced internally by !=
.
For strings, comments and similar the construct would contain all characters between starter
and closer
.
#define ELLIPSIS_TEST_ICE | ( | ... | ) | (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr) |
#define ELLIPSIS_TO_VOIDS | ( | ... | ) | ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__)))) |
#define KEYWORD_ADD | ( | STARTER, | |
... | |||
) | KEYWORD_ADD_I ## __VA_OPT__(I) (STARTER __VA_OPT__(,) __VA_ARGS__) |
add a keyword
Arguments are starter
, and optionally repl
. The two strings have to be provided as string literals.
#define KEYWORD_ADD_I | ( | STARTER | ) | KEYWORD_ADD_II(STARTER, STARTER) |
#define KEYWORD_ADD_ID | ( | X, | |
... | |||
) | KEYWORD_ADD(#X __VA_OPT__(, #__VA_ARGS__)), |
#define KEYWORD_ADD_II | ( | STARTER, | |
REPL | |||
) | SPECIAL_ADD(STARTER, "", keyword, REPL) |
#define KEYWORD_HEADING | ( | ... | ) |
#define KEYWORD_TEXT | ( | ... | ) |
#define NOMINAL_ADD | ( | ... | ) | NOMINAL_ADD_2(__VA_ARGS__) |
add a nominal to the grammar
Arguments are string
, and optionally repl
. The two strings have to be provided as string literals. This permits to parse characters as nominal that have another Unicode classification. Such a new nominal can then for example be used to define a macro.
#define NOMINAL_ADD_1 | ( | X, | |
... | |||
) | NOMINAL_ADD_I ## __VA_OPT__(I)(X __VA_OPT__(,) __VA_ARGS__) |
#define NOMINAL_ADD_2 | ( | X, | |
R, | |||
... | |||
) | NOMINAL_ADD_1(X, R) |
#define NOMINAL_ADD_I | ( | X | ) | SPECIAL_ADD(X, "", nominal, ""), |
#define NOMINAL_ADD_II | ( | X, | |
R | |||
) | SPECIAL_ADD(X, "", nominal, R), |
#define PUNCTUATOR_ADD | ( | STARTER, | |
... | |||
) | PUNCTUATOR_ADD_I ## __VA_OPT__(I) (STARTER __VA_OPT__(,) __VA_ARGS__) |
add a punctuator
Arguments are starter
, and optionally repl
. The two strings have to be provided as string literals.
#define PUNCTUATOR_ADD_I | ( | STARTER | ) | PUNCTUATOR_ADD_II(STARTER, STARTER) |
#define PUNCTUATOR_ADD_II | ( | STARTER, | |
REPL | |||
) | SPECIAL_ADD(STARTER, "", punctuator, REPL) |
#define PUNCTUATOR_ADDON | ( | STARTER, | |
... | |||
) | PUNCTUATOR_ADDON_I ## __VA_OPT__(I) (STARTER __VA_OPT__(,) __VA_ARGS__) |
#define PUNCTUATOR_ADDON_I | ( | STARTER | ) | PUNCTUATOR_ADD(STARTER), |
#define PUNCTUATOR_ADDON_II | ( | STARTER, | |
REPL, | |||
... | |||
) | PUNCTUATOR_ADD(STARTER, REPL), |
#define PUNCTUATOR_TEXT0 | ( | ... | ) |
#define PUNCTUATOR_TEXT1 | ( | ... | ) |
#define PUNCTUATOR_TEXT2 | ( | ... | ) |
#define PUNCTUATOR_TEXT3 | ( | ... | ) |
#define SPECIAL_ADD | ( | STARTER, | |
... | |||
) | SPECIAL_ADD_I ## __VA_OPT__(Iplus) (STARTER __VA_OPT__(,) __VA_ARGS__) |
add a special
Arguments are starter
, and optionally closer
, cat
and then repl
. The three strings have to be provided as string literals.
#define SPECIAL_ADD_I | ( | STARTER | ) | SPECIAL_ADD_III(STARTER, "", punctuator) |
#define SPECIAL_ADD_II | ( | STARTER, | |
CLOSER | |||
) | SPECIAL_ADD_III(STARTER, CLOSER, special) |
#define SPECIAL_ADD_III | ( | STARTER, | |
CLOSER, | |||
CAT | |||
) | SPECIAL_ADD_IIII(STARTER, CLOSER, CAT, "") |
#define SPECIAL_ADD_IIII | ( | STARTER, | |
CLOSER, | |||
CAT, | |||
REPL | |||
) |
#define SPECIAL_ADD_IIIplus | ( | STARTER, | |
CLOSER, | |||
CAT, | |||
... | |||
) | SPECIAL_ADD_III ## __VA_OPT__(I) (STARTER, CLOSER, CAT __VA_OPT__(,) __VA_ARGS__) |
#define SPECIAL_ADD_IIplus | ( | STARTER, | |
CLOSER, | |||
... | |||
) | SPECIAL_ADD_II ## __VA_OPT__(Iplus) (STARTER, CLOSER __VA_OPT__(,) __VA_ARGS__) |
#define SPECIAL_ADDON | ( | STARTER, | |
CLOSER, | |||
CAT, | |||
... | |||
) | SPECIAL_ADDON_III ## __VA_OPT__(I) (STARTER, CLOSER, CAT __VA_OPT__(,) __VA_ARGS__) |
#define SPECIAL_ADDON_III | ( | STARTER, | |
CLOSER, | |||
CAT | |||
) | SPECIAL_ADD(STARTER, CLOSER, CAT), |
#define SPECIAL_ADDON_IIII | ( | STARTER, | |
CLOSER, | |||
CAT, | |||
REPL, | |||
... | |||
) | SPECIAL_ADD(STARTER, CLOSER, CAT, REPL), |
#define SPECIAL_TEXT0 | ( | ... | ) |
#define SPECIAL_TEXT1 | ( | ... | ) |
#define SPECIAL_TEXT2 | ( | ... | ) |
#define SPECIAL_TEXT3 | ( | ... | ) |
#define STRINGIFY | ( | ... | ) | STRINGIFY_(__VA_ARGS__) |
#define STRINGIFY_ | ( | ... | ) | #__VA_ARGS__ |
typedef struct ellipsis‿contracts‿is_ice ellipsis‿contracts‿is_ice |
typedef void ellipsis‿special‿append(size_t len, ellipsis‿special *p) |
typedef ellipsis‿special const * ellipsis‿special‿find(size_t len, char const buf[len]) |
void ellipsis‿special‿cpy | ( | size_t | len, |
ellipsis‿special | target[static restrict len], | ||
ellipsis‿special const | source[static restrict len] | ||
) |
Referenced by ellipsis‿special‿c‿append(), ellipsis‿special‿c‿magic‿_Once‿init‿user(), ellipsis‿special‿c_comment‿append(), ellipsis‿special‿c_comment‿magic‿_Once‿init‿user(), ellipsis‿special‿c_directive‿append(), ellipsis‿special‿c_directive‿magic‿_Once‿init‿user(), ellipsis‿special‿c_directive1‿append(), ellipsis‿special‿c_directive1‿magic‿_Once‿init‿user(), ellipsis‿special‿c_include‿append(), ellipsis‿special‿c_include‿magic‿_Once‿init‿user(), ellipsis‿special‿c_pragma‿append(), ellipsis‿special‿c_pragma‿magic‿_Once‿init‿user(), ellipsis‿special‿decoration‿append(), ellipsis‿special‿decoration‿magic‿_Once‿init‿user(), ellipsis‿special‿directive‿append(), ellipsis‿special‿directive‿magic‿_Once‿init‿user(), ellipsis‿special‿directive_define‿append(), ellipsis‿special‿directive_define‿magic‿_Once‿init‿user(), ellipsis‿special‿directive_if‿append(), ellipsis‿special‿directive_if‿magic‿_Once‿init‿user(), ellipsis‿special‿directive_include‿append(), ellipsis‿special‿directive_include‿magic‿_Once‿init‿user(), ellipsis‿special‿empty‿append(), ellipsis‿special‿empty‿magic‿_Once‿init‿user(), ellipsis‿special‿html‿append(), ellipsis‿special‿html‿magic‿_Once‿init‿user(), ellipsis‿special‿html_comment‿append(), ellipsis‿special‿html_comment‿magic‿_Once‿init‿user(), ellipsis‿special‿html_directive‿append(), ellipsis‿special‿html_directive‿magic‿_Once‿init‿user(), ellipsis‿special‿lex‿append(), ellipsis‿special‿lex‿magic‿_Once‿init‿user(), ellipsis‿special‿lex_comment‿append(), ellipsis‿special‿lex_comment‿magic‿_Once‿init‿user(), ellipsis‿special‿lex_directive‿append(), ellipsis‿special‿lex_directive‿magic‿_Once‿init‿user(), ellipsis‿special‿markdown‿append(), ellipsis‿special‿markdown‿magic‿_Once‿init‿user(), ellipsis‿special‿markdown_decoration‿append(), and ellipsis‿special‿markdown_decoration‿magic‿_Once‿init‿user().
void ellipsis‿special‿delete | ( | size_t | len, |
ellipsis‿special const | target[static restrict len] | ||
) |
References ellipsis‿str32‿delete(), and ellipsis‿str8‿delete().
Referenced by ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿special‿c‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿c_comment‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿c_directive‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿c_directive1‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿c_include‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿c_pragma‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿decoration‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿directive‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿directive_define‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿directive_if‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿directive_include‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿empty‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿html‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿html_comment‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿html_directive‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿lex‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿lex_comment‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿lex_directive‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿markdown‿magic‿_Once‿atexit‿callback(), ellipsis‿special‿markdown_decoration‿magic‿_Once‿atexit‿callback(), and ellipsis‿tokenize().
|
inline |
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‿special‿scan‿str32‿_Ctra(), ellipsis‿special‿scan‿str32‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿special‿scan‿str32‿_Ctra(), and ellipsis‿special‿scan‿str32‿_Insta().
|
inline |
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‿special‿scan‿str32‿_Insta(), ellipsis‿special‿scan‿str32(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿special‿scan‿str32(), and ellipsis‿tokenize().
|
inline |
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‿special‿scan‿str8‿_Ctra(), ellipsis‿special‿scan‿str8‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿special‿scan‿str8‿_Ctra(), and ellipsis‿special‿scan‿str8‿_Insta().
|
inline |
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‿special‿scan‿str8‿_Insta(), ellipsis‿special‿scan‿str8(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿special‿scan‿str8(), and ellipsis‿tokenize().
|
extern |
|
extern |
|
extern |