P99
|
These macros allow the handling of small texts and tokens. More...
Macros | |
#define | P99_BOOL_LEN(SEQ) P99_IF_ELSE(P99_IS_BOOL_TOK(SEQ))(P00_BOOL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind BOOL. More... | |
#define | P99_BOOL_QUAL_LEN(SEQ) P99_IF_ELSE(P99_IS_BOOL_QUAL_TOK(SEQ))(P00_BOOL_QUAL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind BOOL_QUAL. More... | |
#define | P99_BUILTIN_MAX(...) P99_PASTE2(P00_, P99_PASTE(BUILTIN_MAX_, __VA_ARGS__)) |
#define | P99_BUILTIN_MIN(...) P99_PASTE2(P00_, P99_PASTE(BUILTIN_MIN_, __VA_ARGS__)) |
#define | P99_BUILTIN_TYPE(...) P99_PASTE2(P00_, P99_PASTE(BUILTIN_TYPE_, __VA_ARGS__)) |
Find a builtin type according to a code such as ‘ull’ or ‘ld’. More... | |
#define | P99_CAT2(_1, _2) _1 ## _2 |
Paste two token sequences at their junction. More... | |
#define | P99_CONST_LEN(SEQ) P99_IF_ELSE(P99_IS_CONST_TOK(SEQ))(P00_CONST1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind CONST. More... | |
#define | P99_FLOAT_LEN(SEQ) P99_IF_ELSE(P99_IS_FLOAT_TOK(SEQ))(P00_FLOAT1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind FLOAT. More... | |
#define | P99_FLOAT_QUAL_LEN(SEQ) P99_IF_ELSE(P99_IS_FLOAT_QUAL_TOK(SEQ))(P00_FLOAT_QUAL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind FLOAT_QUAL. More... | |
#define | P99_INTEGER_LEN(SEQ) P99_IF_ELSE(P99_IS_INTEGER_TOK(SEQ))(P00_INTEGER1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind INTEGER. More... | |
#define | P99_INTEGER_QUAL_LEN(SEQ) P99_IF_ELSE(P99_IS_INTEGER_QUAL_TOK(SEQ))(P00_INTEGER_QUAL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind INTEGER_QUAL. More... | |
#define | P99_INTEGER_RANK(...) P99_PASTE2(P00_, P99_PASTE(INTEGER_RANK_, __VA_ARGS__)) |
#define | P99_INTEGER_SIGN(...) P99_PASTE2(P00_, P99_PASTE(INTEGER_SIGN_, __VA_ARGS__)) |
#define | P99_INTEGER_SIGNED(...) P99_PASTE2(P00_, P99_PASTE(INTEGER_SIGNED_, __VA_ARGS__)) |
#define | P99_INTEGER_UNSIGNED(...) P99_PASTE2(P00_, P99_PASTE(INTEGER_UNSIGNED_, __VA_ARGS__)) |
#define | P99_IS_BOOL_QUAL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_BOOL_QUAL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind BOOL_QUAL. More... | |
#define | P99_IS_BOOL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_BOOL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind BOOL. More... | |
#define | P99_IS_CONST_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_CONST_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind CONST. More... | |
#define | P99_IS_FLOAT_QUAL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_FLOAT_QUAL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind FLOAT_QUAL. More... | |
#define | P99_IS_FLOAT_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_FLOAT_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind FLOAT. More... | |
#define | P99_IS_INTEGER_QUAL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_INTEGER_QUAL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind INTEGER_QUAL. More... | |
#define | P99_IS_INTEGER_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_INTEGER_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind INTEGER. More... | |
#define | P99_IS_KEYWORD_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_KEYWORD_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind KEYWORD. More... | |
#define | P99_IS_REAL_QUAL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_REAL_QUAL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind REAL_QUAL. More... | |
#define | P99_IS_REAL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_REAL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind REAL. More... | |
#define | P99_IS_RESERVED_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_RESERVED_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind RESERVED. More... | |
#define | P99_IS_RESTRICT_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_RESTRICT_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind RESTRICT. More... | |
#define | P99_IS_TYPE_QUAL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_TYPE_QUAL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind TYPE_QUAL. More... | |
#define | P99_IS_TYPE_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_TYPE_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind TYPE. More... | |
#define | P99_IS_VOID_QUAL_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_VOID_QUAL_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind VOID_QUAL. More... | |
#define | P99_IS_VOID_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_VOID_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind VOID. More... | |
#define | P99_IS_VOLATILE_TOK(SEQ) P99_HAS_COMMA(P99_PASTE2(P00_VOLATILE_, SEQ)) |
Test if the token sequence SEQ starts with a token of kind VOLATILE. More... | |
#define | P99_KEYWORD_LEN(SEQ) P99_IF_ELSE(P99_IS_KEYWORD_TOK(SEQ))(P00_KEYWORD1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind KEYWORD. More... | |
#define | P99_PASTE(...) P00_PASTE(P00_NARG(__VA_ARGS__), __VA_ARGS__) |
A left-to-right associative paste operator. More... | |
#define | P99_PASTE0() |
#define | P99_PASTE1(_1) _1 |
#define | P99_PASTE2(_1, _2) P99_CAT2(_1, _2) |
Paste two token sequences at their junction. More... | |
#define | P99_PASTE3(_1, _2, _3) P99_PASTE2(P99_PASTE2(_1, _2), _3) |
#define | P99_PASTE4(_1, _2, _3, _4) P99_PASTE2(P99_PASTE3(_1, _2, _3), _4) |
#define | P99_PASTE5(_1, _2, _3, _4, _5) P99_PASTE2(P99_PASTE4(_1, _2, _3, _4), _5) |
#define | P99_PASTE6(_1, _2, _3, _4, _5, _6) P99_PASTE2(P99_PASTE5(_1, _2, _3, _4, _5), _6) |
#define | P99_PASTID(...) P99_PASTE2(P99_PASTID, P99_NARG(__VA_ARGS__))(__VA_ARGS__) |
#define | P99_PASTID0() |
#define | P99_PASTID1(ID) ID |
#define | P99_PASTID2(ID0, ID1) P99_IF_EMPTY(ID1)(P00_PASTID2(ID0, p007))(P00_PASTID2(ID0, ID1)) |
#define | P99_REAL_LEN(SEQ) P99_IF_ELSE(P99_IS_REAL_TOK(SEQ))(P00_REAL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind REAL. More... | |
#define | P99_REAL_QUAL_LEN(SEQ) P99_IF_ELSE(P99_IS_REAL_QUAL_TOK(SEQ))(P00_REAL_QUAL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind REAL_QUAL. More... | |
#define | P99_RESERVED_LEN(SEQ) P99_IF_ELSE(P99_IS_RESERVED_TOK(SEQ))(P00_RESERVED1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind RESERVED. More... | |
#define | P99_RESTRICT_LEN(SEQ) P99_IF_ELSE(P99_IS_RESTRICT_TOK(SEQ))(P00_RESTRICT1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind RESTRICT. More... | |
#define | P99_TOK_EQ(TOK, ...) P00_TOK_EQ_(P99_PASTE3(P00_IS_, TOK, _EQ_), __VA_ARGS__) |
Detect if two tokens are equal. More... | |
#define | P99_TYPE_LEN(SEQ) P99_IF_ELSE(P99_IS_TYPE_TOK(SEQ))(P00_TYPE1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind TYPE. More... | |
#define | P99_TYPE_QUAL_LEN(SEQ) P99_IF_ELSE(P99_IS_TYPE_QUAL_TOK(SEQ))(P00_TYPE_QUAL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind TYPE_QUAL. More... | |
#define | P99_VOID_LEN(SEQ) P99_IF_ELSE(P99_IS_VOID_TOK(SEQ))(P00_VOID1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind VOID. More... | |
#define | P99_VOID_QUAL_LEN(SEQ) P99_IF_ELSE(P99_IS_VOID_QUAL_TOK(SEQ))(P00_VOID_QUAL1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind VOID_QUAL. More... | |
#define | P99_VOLATILE_LEN(SEQ) P99_IF_ELSE(P99_IS_VOLATILE_TOK(SEQ))(P00_VOLATILE1(P00_EAT_FIRST(SEQ)))(0) |
Count the number of tokens in sequence SEQ that all are of kind VOLATILE. More... | |
These macros allow the handling of small texts and tokens.
For the following tokens, the macro P99_TOK_EQ will work.
_Bool
_Complex
_Imaginary
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
inline
int
long
register
restrict
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while
clock_t
div_t
double_t
fenv_t
fexcept_t
float_t
fpos_t
imaxdiv_t
int16_t
int32_t
int64_t
int8_t
intfast16_t
intfast32_t
intfast64_t
intfast8_t
intleast16_t
intleast32_t
intleast64_t
intleast8_t
intmax_t
intptr_t
ldiv_t
lldiv_t
mbstate_t
off_t
ptrdiff_t
sig_atomic_t
size_t
ssize_t
time_t
uint16_t
uint32_t
uint64_t
uint8_t
uintfast16_t
uintfast32_t
uintfast64_t
uintfast8_t
uintleast16_t
uintleast32_t
uintleast64_t
uintleast8_t
uintmax_t
uintptr_t
wchar_t
wctrans_t
wctype_t
wint_t
_Exit
abort
abs
acos
asctime
asin
assert
atan
atan2
atexit
atof
atoi
atol
bsearch
btowc
cabs
cacos
cacosh
calloc
carg
casin
casinh
catan
catanh
ccos
ccosh
ceil
cexp
cimag
clearerr
clock
clog
conj
cos
cosh
cpow
cproj
creal
csin
csinh
csqrt
ctan
ctanh
ctime
difftime
div
exit
exp
fabs
fclose
fdopen
feof
ferror
fflush
fgetc
fgetpos
fgets
fgetwc
fgetws
floor
fopen
fprintf
fputc
fputchar
fputs
fputwc
fputws
fread
free
freopen
frexp
fscanf
fseek
fsetpos
ftell
fwide
fwprintf
fwrite
fwscanf
getaddrinfo
getc
getchar
getenv
getnameinfo
gets
getwc
getwchar
gmtime
imaxabs
imaxdiv
isalnum
isalpha
isblank
iscntrl
isdigit
isgraph
islower
isprint
ispunct
isspace
isupper
iswalnum
iswalpha
iswcntrl
iswctype
iswdigit
iswgraph
iswlower
iswprint
iswpunct
iswspace
iswupper
iswxdigit
isxdigit
labs
ldexp
ldiv
localeconv
localtime
log
log10
longjmp
malloc
mbrlen
mbrtowc
mbsinit
mbsrtowcs
memchr
memcmp
memcpy
memmove
memset
mktime
modf
offsetof
perror
pow
printf
putc
putchar
puts
putwc
putwchar
qsort
raise
rand
realloc
remove
rename
rewind
scanf
setbuf
setjmp
setlocale
setvbuf
sin
sinh
snprintf
sprintf
sqrt
srand
sscanf
strcat
strchr
strcmp
strcoll
strcpy
strcspn
strerror
strftime
strlen
strncat
strncmp
strncpy
strpbrk
strrchr
strspn
strstr
strtod
strtoimax
strtok
strtol
strtoul
strtoumax
strxfrm
swprintf
swscanf
system
tan
tanh
time
tmpfile
tmpnam
tolower
toupper
towctrans
towlower
towupper
ungetc
ungetwc
va_arg
va_copy
va_end
va_start
vfprintf
vfscanf
vfwprintf
vprintf
vscanf
vsprintf
vsscanf
vswprintf
vwprintf
wcrtomb
wcscat
wcschr
wcscmp
wcscoll
wcscpy
wcscspn
wcsftime
wcslen
wcsncat
wcsncmp
wcsncpy
wcspbrk
wcsrchr
wcsrtombs
wcsspn
wcsstr
wcstod
wcstoimax
wcstok
wcstol
wcstoul
wcstoumax
wcsxfrm
wctob
wctrans
wctype
wmemchr
wmemcmp
wmemcpy
wmemmove
wmemset
wprintf
wscanf
NULL
and
and_eq
bitand
bitor
bool
compl
false
not
not_eq
offsetof
or
or_eq
true
xor
xor_eq