Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sign ::= '+' | '-'
- num ::= digit
- | num [ '_' ] digit
- hexnum ::= hexdigit
- | hexnum [ '_' ] hexdigit
- nat ::= num
- | '0x' hexnum
- int ::= [ sign ] nat
- float ::= num '.' [ num ] [ ( 'e' | 'E' ) num ]
- | '0x' hexnum '.' [ hexnum ] [ ( 'p' | 'P' ) num ]
- id ::= '$' idchar { idchar }
- idchar ::= letter | digit
- | '!' | '#' | '$' | '%' | '&' | '′' | '∗' | '+' | '−' | '.' | '/' | ':'
- | '<' | '=' | '>' | '?' | '@' | '∖' | '^' | '_' | '`' | '|' | '~'
- string ::= '"' { char | '\n' | '\t' | '\\' | "\'" | '\"' | '\' hexnum hexnum | '\u{' hexnum { hexnum } '}' } '"'
- name ::= string
- value ::= int
- | float
- var ::= nat
- | name
- unop ::= 'ctz' | 'clz' | 'popcnt'
- binop ::= 'add' | 'sub' | 'mul' | 'div' | 'rem' | 'and' | 'or' | 'xor' | 'shl' | 'shr' | 'rotl' | 'rotr'
- relop ::= 'eq' | 'ne' | 'lt' | 'gt' | 'le' | 'ge'
- funop ::= 'abs' | 'neg' | 'sqrt' | 'ceil' | 'floor' | 'trunc' | 'nearest'
- fbiunop ::= 'add' | 'sub' | 'mul' | 'div' | 'min' | 'max' | 'copysign'
- itestop ::= 'eqz'
- sign ::= 's' | 'u'
- offset ::= "offset=" nat
- align ::= "align=" ( 1 | 2 | 4 | 8 | ... )
- cvtop ::= 'wrap' | 'extend' | 'trunc' | 'convert' | 'demote' | 'promote' | 'reinterpret'
- val_type ::= 'i32' | 'i64' | 'f32' | 'f64'
- elem_type ::= funcref
- block_type ::= ( 'result' val_type* )*
- func_type ::= ( type <var> )? param* result*
- global_type ::= <val_type> | ( 'mut' val_type )
- table_type ::= nat [ nat ] elem_type
- memory_type ::= nat [ nat ]
- module ::= '(' 'module' [ id ] { field } ')'
- field ::= type
- | import
- | func
- | table
- | mem
- | global
- | export
- | start
- | elem
- | data
- type ::= '(' 'type' [ id ] functype ')'
- typeuse ::= '(' 'type' typeidx ')'
- | '(' 'type' typeidx ')' (param)∗ (result)∗
- import ::= '(' 'import' name name importdesc ')'
- importdesc ::= '(' 'func' [ id ] typeuse ')'
- | '(' 'table' [ id ] tabletype ')'
- | '(' 'memory' [ id ] memtype ')'
- | '(' 'global' [ id ] globaltype ')'
- func ::= '(' 'func' [ id ] typeuse (local)∗ (instr)∗ ')'
- local ::= '(' 'local' [ id ] valtype ')'
- table ::= '(' 'table' [ id ] tabletype ')'
- mem ::= '(' 'memory' [ id ] memtype ')'
- global ::= '(' 'global' [ id ] globaltype expr ')'
- export ::= '(' 'export' name exportdesc ')'
- start ::= '(' 'start' funcidx ')'
- elem ::= '(' 'elem' tableidx '(' offset expr ')' funcidx* ')'
- data ::= '(' 'data' memidx '(' offset expr ')' datastring ')'
- expr ::= '(' op ')'
- | '(' op expr+ ')'
- | '(' 'block' [ name ] block_type instr* ')'
- | '(' 'loop' [ name ] block_type instr* ')'
- | '(' 'if' [ name ] block_type '(' 'then' instr* ) '(' 'else' instr* ')'? ')'
- | '(' 'if' [ name ] block_type expr+ '(' 'then' instr* ')' '(' 'else' instr* ')'? ')'
- instr ::= expr
- | op
- | "block" [ name ] block_type instr* "end" [ name ]
- | "loop" [ name ] block_type instr* "end" [ name ]
- | "if" [ name ] block_type instr* "else" [ name ] instr* "end" [ name ]
- | "if" [ name ] block_type instr* "end" [ name ]
- op ::= "unreachable"
- | "nop"
- | "br" var
- | "br_if" var
- | "br_table" var+
- | "return"
- | "call" var
- | "call_indirect" func_type
- | "drop"
- | "select"
- | "local.get" var
- | "local.set" var
- | "local.tee" var
- | "global.get" var
- | "global.set" var
- | <val_type> '.' load((8|16|32)_<sign>)? <offset>? <align>?
- | <val_type> '.' store(8|16|32)? <offset>? <align>?
- | "memory.size"
- | "memory.grow"
- | <val_type> '.' "const" <value>
- | <val_type> '.' <unop>
- | <val_type> '.' <binop>
- | <val_type> '.' <testop>
- | <val_type> '.' <relop>
- | <val_type> '.' <cvtop> '_' <val_type> (_<sign>)?
- func ::= ( func [ name ] <func_type> <local>* <instr>* )
- | ( func [ name ] ( export <string> ) <instr>* )
- | ( func [ name ] ( import <string> <string> ) <func_type>)
- param ::= ( param <val_type>* )
- | ( param <name> <val_type> )
- result ::= ( result <val_type>* )
- local ::= ( local <val_type>* )
- | ( local <name> <val_type> )
- global ::= ( global [ name ] <global_type> <instr>* )
- | ( global [ name ] ( export <string> ) <...> )
- | ( global [ name ] ( import <string> <string> ) <global_type> )
- table ::= ( table [ name ] <table_type> )
- | ( table [ name ] ( export <string> ) <...> )
- | ( table [ name ] ( import <string> <string> ) <table_type> )
- | ( table [ name ] ( export <string> )* <elem_type> ( elem <var>* ) )
- elem ::= ( elem <var>? (offset <instr>* ) <var>* )
- | ( elem <var>? <expr> <var>* )
- memory ::= ( memory [ name ] <memory_type> )
- | ( memory [ name ] ( export <string> ) <...> )
- | ( memory [ name ] ( import <string> <string> ) <memory_type> )
- | ( memory [ name ] ( export <string> )* ( data <string>* ) )
- data ::= ( data <var>? ( offset <instr>* ) <string>* )
- | ( data <var>? <expr> <string>* )
- start ::= ( start <var> )
- typedef ::= ( type [ name ] ( func <param>* <result>* ) )
- import ::= '(' 'import' string string imkind ')'
- imkind ::= '(' 'func' [ name ] func_type ')'
- | '(' 'global' [ name ] global_type ')'
- | '(' 'table' [ name ] table_type ')'
- | '(' 'memory' [ name ] memory_type ')'
- export ::= '(' 'export' string exkind ')'
- exkind ::= '(' 'func' var ')'
- | '(' 'global' var ')'
- | '(' 'table' var ')'
- | '(' 'memory' var ')'
- module ::= '(' 'module' [name] {typedef} {func} {import} {export} [table] [memory] {global} {elem} {data} [start] ')'
- | {typedef} {func} {import} {export} [table] [memory] {global} {elem} {data} [start]
- start ::= module
Advertisement
Add Comment
Please, Sign In to add comment