Metalang99 1.13.3
Full-blown preprocessor metaprogramming
|
Support for C language constructions. More...
Go to the source code of this file.
Macros | |
#define | ML99_semicoloned(...) ML99_call(ML99_semicoloned, __VA_ARGS__) |
Puts a semicolon after provided arguments. More... | |
#define | ML99_braced(...) ML99_call(ML99_braced, __VA_ARGS__) |
Puts provided arguments into braces. More... | |
#define | ML99_assign(lhs, ...) ML99_call(ML99_assign, lhs, __VA_ARGS__) |
Generates an assignment of provided variadic arguments to lhs . More... | |
#define | ML99_assignInitializerList(lhs, ...) ML99_call(ML99_assignInitializerList, lhs, __VA_ARGS__) |
A shortcut for ML99_assign(lhs, ML99_braced(...)) . | |
#define | ML99_assignStmt(lhs, ...) ML99_call(ML99_assignStmt, lhs, __VA_ARGS__) |
A shortcut for ML99_semicoloned(ML99_assign(lhs, ...)) . | |
#define | ML99_assignInitializerListStmt(lhs, ...) ML99_call(ML99_assignInitializerListStmt, lhs, __VA_ARGS__) |
A shortcut for ML99_assignStmt(lhs, ML99_braced(...)) . | |
#define | ML99_invoke(f, ...) ML99_call(ML99_invoke, f, __VA_ARGS__) |
Generates a function/macro invocation. More... | |
#define | ML99_invokeStmt(f, ...) ML99_call(ML99_invokeStmt, f, __VA_ARGS__) |
A shortcut for ML99_semicoloned(ML99_invoke(f, ...)) . | |
#define | ML99_prefixedBlock(prefix, ...) ML99_call(ML99_prefixedBlock, prefix, __VA_ARGS__) |
Generates prefix { code } . More... | |
#define | ML99_typedef(ident, ...) ML99_call(ML99_typedef, ident, __VA_ARGS__) |
Generates a type definition. More... | |
#define | ML99_struct(ident, ...) ML99_call(ML99_struct, ident, __VA_ARGS__) |
Generates a C structure. More... | |
#define | ML99_anonStruct(...) ML99_call(ML99_anonStruct, __VA_ARGS__) |
Generates an anonymous C structure. More... | |
#define | ML99_union(ident, ...) ML99_call(ML99_union, ident, __VA_ARGS__) |
The same as ML99_struct but generates a union. | |
#define | ML99_anonUnion(...) ML99_call(ML99_anonUnion, __VA_ARGS__) |
The same as ML99_anonStruct but generates a union. | |
#define | ML99_enum(ident, ...) ML99_call(ML99_enum, ident, __VA_ARGS__) |
The same as ML99_struct but generates an enumeration. | |
#define | ML99_anonEnum(...) ML99_call(ML99_anonEnum, __VA_ARGS__) |
The same as ML99_anonStruct but generates an enumeration. | |
#define | ML99_fnPtr(ret_ty, name, ...) ML99_call(ML99_fnPtr, ret_ty, name, __VA_ARGS__) |
Generates a function pointer. More... | |
#define | ML99_fnPtrStmt(ret_ty, name, ...) ML99_call(ML99_fnPtrStmt, ret_ty, name, __VA_ARGS__) |
A shortcut for ML99_semicoloned(ML99_fnPtr(ret_ty, name, ...)) . | |
#define | ML99_times(n, ...) ML99_call(ML99_times, n, __VA_ARGS__) |
Pastes provided arguments n times. More... | |
#define | ML99_repeat(n, f) ML99_call(ML99_repeat, n, f) |
Invokes f n times, providing an iteration index each time. More... | |
#define | ML99_indexedParams(type_list) ML99_call(ML99_indexedParams, type_list) |
Generates \((T_0 \ \_0, ..., T_n \ \_n)\). More... | |
#define | ML99_indexedFields(type_list) ML99_call(ML99_indexedFields, type_list) |
Generates \(T_0 \ \_0; ...; T_n \ \_n\). More... | |
#define | ML99_indexedInitializerList(n) ML99_call(ML99_indexedInitializerList, n) |
Generates \(\{ \_0, ..., \_{n - 1} \}\). More... | |
#define | ML99_indexedArgs(n) ML99_call(ML99_indexedArgs, n) |
Generates \(\_0, ..., \_{n - 1}\). More... | |
Support for C language constructions.
Some decent usage examples can be found in datatype99/examples/derive.
#define ML99_anonStruct | ( | ... | ) | ML99_call(ML99_anonStruct, __VA_ARGS__) |
Generates an anonymous C structure.
#define ML99_assign | ( | lhs, | |
... | |||
) | ML99_call(ML99_assign, lhs, __VA_ARGS__) |
Generates an assignment of provided variadic arguments to lhs
.
#define ML99_braced | ( | ... | ) | ML99_call(ML99_braced, __VA_ARGS__) |
#define ML99_fnPtr | ( | ret_ty, | |
name, | |||
... | |||
) | ML99_call(ML99_fnPtr, ret_ty, name, __VA_ARGS__) |
Generates a function pointer.
#define ML99_indexedArgs | ( | n | ) | ML99_call(ML99_indexedArgs, n) |
Generates \(\_0, ..., \_{n - 1}\).
If n
is 0, this macro results in emptiness.
#define ML99_indexedFields | ( | type_list | ) | ML99_call(ML99_indexedFields, type_list) |
Generates \(T_0 \ \_0; ...; T_n \ \_n\).
If type_list
is empty, this macro results in emptiness.
#define ML99_indexedInitializerList | ( | n | ) | ML99_call(ML99_indexedInitializerList, n) |
Generates \(\{ \_0, ..., \_{n - 1} \}\).
If n
is 0, this macro results in { 0 }
.
#define ML99_indexedParams | ( | type_list | ) | ML99_call(ML99_indexedParams, type_list) |
Generates \((T_0 \ \_0, ..., T_n \ \_n)\).
If type_list
is empty, this macro results in (void)
.
#define ML99_invoke | ( | f, | |
... | |||
) | ML99_call(ML99_invoke, f, __VA_ARGS__) |
#define ML99_prefixedBlock | ( | prefix, | |
... | |||
) | ML99_call(ML99_prefixedBlock, prefix, __VA_ARGS__) |
Generates prefix { code }
.
#define ML99_repeat | ( | n, | |
f | |||
) | ML99_call(ML99_repeat, n, f) |
Invokes f
n
times, providing an iteration index each time.
#define ML99_semicoloned | ( | ... | ) | ML99_call(ML99_semicoloned, __VA_ARGS__) |
Puts a semicolon after provided arguments.
#define ML99_struct | ( | ident, | |
... | |||
) | ML99_call(ML99_struct, ident, __VA_ARGS__) |
Generates a C structure.
#define ML99_times | ( | n, | |
... | |||
) | ML99_call(ML99_times, n, __VA_ARGS__) |
#define ML99_typedef | ( | ident, | |
... | |||
) | ML99_call(ML99_typedef, ident, __VA_ARGS__) |
Generates a type definition.