mutable
A Database System for Research and Fast Prototyping
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
Macros
WasmMacro.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BLOCK_OPEN(BLK)   if (m::wasm::BlockUser ThisBlockUser((BLK)); (void)(ThisBlockUser), false) { } else
 
#define M_WASM_BLOCK_NAMED_(NAME)    if (m::wasm::Block NAME(#NAME, true); (void)(NAME), false) { } else BLOCK_OPEN(NAME)
 
#define M_WASM_BLOCK_ANON_()    if (m::wasm::Block ThisBlock(true); (void)(ThisBlock), false) { } else BLOCK_OPEN(ThisBlock)
 
#define M_GET_WASM_BLOCK_(XXX, _1, NAME, ...)   NAME
 
#define BLOCK(...)   M_GET_WASM_BLOCK_(XXX, ##__VA_ARGS__, M_WASM_BLOCK_NAMED_, M_WASM_BLOCK_ANON_)(__VA_ARGS__)
 
#define FUNCTION(NAME, TYPE)
 
#define PARAMETER(IDX)   ThisFunction.template parameter<IDX>()
 
#define RETURN(RES)   ThisFunction.emit_return(RES)
 
#define IF(COND)   if (m::wasm::If ThisIf((COND)); false) { } else ThisIf.Then = [&]
 
#define ELSE   , ThisIf.Else = [&]
 
#define M_WASM_LOOP_NAMED_(NAME)    if (m::wasm::Loop ThisLoop((NAME)); (void)(ThisLoop), false) { } else BLOCK_OPEN(ThisLoop.body())
 
#define M_WASM_LOOP_ANON_()   M_WASM_LOOP_NAMED_("loop")
 
#define M_GET_WASM_LOOP_(XXX, _1, NAME, ...)   NAME
 
#define LOOP(...)   M_GET_WASM_LOOP_(XXX, ##__VA_ARGS__, M_WASM_LOOP_NAMED_, M_WASM_LOOP_ANON_)(__VA_ARGS__)
 
#define M_WASM_DO_WHILE_NAMED_(NAME, COND)
 
#define M_WASM_DO_WHILE_ANON_(COND)   M_WASM_DO_WHILE_NAMED_("do-while", COND)
 
#define M_GET_WASM_DO_WHILE_(XXX, _1, _2, NAME, ...)   NAME
 
#define DO_WHILE(...)   M_GET_WASM_DO_WHILE_(XXX, ##__VA_ARGS__, M_WASM_DO_WHILE_NAMED_, M_WASM_DO_WHILE_ANON_)(__VA_ARGS__)
 
#define M_WASM_WHILE_NAMED_(NAME, COND)    if (m::wasm::While ThisWhile((NAME), (COND)); (void)(ThisWhile), false) { } else BLOCK_OPEN(ThisWhile.body())
 
#define M_WASM_WHILE_ANON_(COND)   M_WASM_WHILE_NAMED_("while", COND)
 
#define M_GET_WASM_WHILE_(XXX, _1, _2, NAME, ...)   NAME
 
#define WHILE(...)   M_GET_WASM_WHILE_(XXX, ##__VA_ARGS__, M_WASM_WHILE_NAMED_, M_WASM_WHILE_ANON_)(__VA_ARGS__)
 
#define M_WASM_THROW2_(TYPE, MSG)   m::wasm::Module::Get().emit_throw(TYPE, __FILE__, __LINE__, MSG)
 
#define M_WASM_THROW1_(TYPE)   M_WASM_THROW2_(TYPE, nullptr)
 
#define M_GET_WASM_THROW_(XXX, _1, _2, NAME, ...)   NAME
 
#define Throw(...)   M_GET_WASM_THROW_(XXX, ##__VA_ARGS__, M_WASM_THROW2_, M_WASM_THROW1_)(__VA_ARGS__)
 

Macro Definition Documentation

◆ BLOCK

#define BLOCK (   ...)    M_GET_WASM_BLOCK_(XXX, ##__VA_ARGS__, M_WASM_BLOCK_NAMED_, M_WASM_BLOCK_ANON_)(__VA_ARGS__)

Definition at line 15 of file WasmMacro.hpp.

◆ BLOCK_OPEN

#define BLOCK_OPEN (   BLK)    if (m::wasm::BlockUser ThisBlockUser((BLK)); (void)(ThisBlockUser), false) { } else

Definition at line 8 of file WasmMacro.hpp.

◆ DO_WHILE

#define DO_WHILE (   ...)    M_GET_WASM_DO_WHILE_(XXX, ##__VA_ARGS__, M_WASM_DO_WHILE_NAMED_, M_WASM_DO_WHILE_ANON_)(__VA_ARGS__)

Definition at line 37 of file WasmMacro.hpp.

◆ ELSE

#define ELSE   , ThisIf.Else = [&]

Definition at line 24 of file WasmMacro.hpp.

◆ FUNCTION

#define FUNCTION (   NAME,
  TYPE 
)
Value:
if (auto ThisFunction = NAME.make_function(); (void)(ThisFunction), false) { } else BLOCK_OPEN(ThisFunction.body())
#define BLOCK_OPEN(BLK)
Definition: WasmMacro.hpp:8
A handle to create a Function and to create invocations of that function.
Definition: WasmDSL.hpp:1367

Definition at line 17 of file WasmMacro.hpp.

◆ IF

#define IF (   COND)    if (m::wasm::If ThisIf((COND)); false) { } else ThisIf.Then = [&]

Definition at line 23 of file WasmMacro.hpp.

◆ LOOP

#define LOOP (   ...)    M_GET_WASM_LOOP_(XXX, ##__VA_ARGS__, M_WASM_LOOP_NAMED_, M_WASM_LOOP_ANON_)(__VA_ARGS__)

Definition at line 30 of file WasmMacro.hpp.

◆ M_GET_WASM_BLOCK_

#define M_GET_WASM_BLOCK_ (   XXX,
  _1,
  NAME,
  ... 
)    NAME

Definition at line 14 of file WasmMacro.hpp.

◆ M_GET_WASM_DO_WHILE_

#define M_GET_WASM_DO_WHILE_ (   XXX,
  _1,
  _2,
  NAME,
  ... 
)    NAME

Definition at line 36 of file WasmMacro.hpp.

◆ M_GET_WASM_LOOP_

#define M_GET_WASM_LOOP_ (   XXX,
  _1,
  NAME,
  ... 
)    NAME

Definition at line 29 of file WasmMacro.hpp.

◆ M_GET_WASM_THROW_

#define M_GET_WASM_THROW_ (   XXX,
  _1,
  _2,
  NAME,
  ... 
)    NAME

Definition at line 47 of file WasmMacro.hpp.

◆ M_GET_WASM_WHILE_

#define M_GET_WASM_WHILE_ (   XXX,
  _1,
  _2,
  NAME,
  ... 
)    NAME

Definition at line 42 of file WasmMacro.hpp.

◆ M_WASM_BLOCK_ANON_

#define M_WASM_BLOCK_ANON_ ( )     if (m::wasm::Block ThisBlock(true); (void)(ThisBlock), false) { } else BLOCK_OPEN(ThisBlock)

Definition at line 12 of file WasmMacro.hpp.

◆ M_WASM_BLOCK_NAMED_

#define M_WASM_BLOCK_NAMED_ (   NAME)     if (m::wasm::Block NAME(#NAME, true); (void)(NAME), false) { } else BLOCK_OPEN(NAME)

Definition at line 10 of file WasmMacro.hpp.

◆ M_WASM_DO_WHILE_ANON_

#define M_WASM_DO_WHILE_ANON_ (   COND)    M_WASM_DO_WHILE_NAMED_("do-while", COND)

Definition at line 35 of file WasmMacro.hpp.

◆ M_WASM_DO_WHILE_NAMED_

#define M_WASM_DO_WHILE_NAMED_ (   NAME,
  COND 
)
Value:
if (m::wasm::DoWhile ThisDoWhile((NAME), (COND)); (void)(ThisDoWhile), false) { } else \
BLOCK_OPEN(ThisDoWhile.body())

Definition at line 32 of file WasmMacro.hpp.

◆ M_WASM_LOOP_ANON_

#define M_WASM_LOOP_ANON_ ( )    M_WASM_LOOP_NAMED_("loop")

Definition at line 28 of file WasmMacro.hpp.

◆ M_WASM_LOOP_NAMED_

#define M_WASM_LOOP_NAMED_ (   NAME)     if (m::wasm::Loop ThisLoop((NAME)); (void)(ThisLoop), false) { } else BLOCK_OPEN(ThisLoop.body())

Definition at line 26 of file WasmMacro.hpp.

◆ M_WASM_THROW1_

#define M_WASM_THROW1_ (   TYPE)    M_WASM_THROW2_(TYPE, nullptr)

Definition at line 46 of file WasmMacro.hpp.

◆ M_WASM_THROW2_

#define M_WASM_THROW2_ (   TYPE,
  MSG 
)    m::wasm::Module::Get().emit_throw(TYPE, __FILE__, __LINE__, MSG)

Definition at line 45 of file WasmMacro.hpp.

◆ M_WASM_WHILE_ANON_

#define M_WASM_WHILE_ANON_ (   COND)    M_WASM_WHILE_NAMED_("while", COND)

Definition at line 41 of file WasmMacro.hpp.

◆ M_WASM_WHILE_NAMED_

#define M_WASM_WHILE_NAMED_ (   NAME,
  COND 
)     if (m::wasm::While ThisWhile((NAME), (COND)); (void)(ThisWhile), false) { } else BLOCK_OPEN(ThisWhile.body())

Definition at line 39 of file WasmMacro.hpp.

◆ PARAMETER

#define PARAMETER (   IDX)    ThisFunction.template parameter<IDX>()

Definition at line 20 of file WasmMacro.hpp.

◆ RETURN

#define RETURN (   RES)    ThisFunction.emit_return(RES)

Definition at line 21 of file WasmMacro.hpp.

◆ Throw

#define Throw (   ...)    M_GET_WASM_THROW_(XXX, ##__VA_ARGS__, M_WASM_THROW2_, M_WASM_THROW1_)(__VA_ARGS__)

Definition at line 48 of file WasmMacro.hpp.

◆ WHILE

#define WHILE (   ...)    M_GET_WASM_WHILE_(XXX, ##__VA_ARGS__, M_WASM_WHILE_NAMED_, M_WASM_WHILE_ANON_)(__VA_ARGS__)

Definition at line 43 of file WasmMacro.hpp.