6.2. Yul Expressions#
Syntax#
YulExpression = (* variant: *) YulFunctionCallExpression
| (* variant: *) YulLiteral
| (* variant: *) YulBuiltInFunction
| (* variant: *) YulPath;
(* Postfix unary operator *)
YulFunctionCallExpression = (* operand: *) YulExpression
(* open_paren: *) OPEN_PAREN
(* arguments: *) YulArguments
(* close_paren: *) CLOSE_PAREN;
YulArguments = ((* item: *) YulExpression ((* separator: *) COMMA (* item: *) YulExpression)*)?;
YulPaths = (* item: *) YulPath ((* separator: *) COMMA (* item: *) YulPath)*;
YulPath = (* item: *) YulPathComponent ((* separator: *) PERIOD (* item: *) YulPathComponent)*;
YulPathComponent = (* variant: *) YUL_IDENTIFIER
| (* variant: *) YUL_ADDRESS_KEYWORD; (* Introduced in 0.8.10 *)
(* Introduced in 0.5.8 and deprecated in 0.7.0. *)
YUL_IDENTIFIER = «IDENTIFIER_START» («IDENTIFIER_PART» | ".")*;
YUL_IDENTIFIER = «IDENTIFIER_START» «IDENTIFIER_PART»*;
YulBuiltInFunction = (* variant: *) YUL_ADD_KEYWORD
| (* variant: *) YUL_ADD_MOD_KEYWORD
| (* variant: *) YUL_ADDRESS_KEYWORD
| (* variant: *) YUL_AND_KEYWORD
| (* variant: *) YUL_BALANCE_KEYWORD
| (* variant: *) YUL_BLOCK_HASH_KEYWORD
| (* variant: *) YUL_BYTE_KEYWORD
| (* variant: *) YUL_CALL_CODE_KEYWORD
| (* variant: *) YUL_CALL_DATA_COPY_KEYWORD
| (* variant: *) YUL_CALL_DATA_LOAD_KEYWORD
| (* variant: *) YUL_CALL_DATA_SIZE_KEYWORD
| (* variant: *) YUL_CALLER_KEYWORD
| (* variant: *) YUL_CALL_KEYWORD
| (* variant: *) YUL_CALL_VALUE_KEYWORD
| (* variant: *) YUL_COIN_BASE_KEYWORD
| (* variant: *) YUL_CREATE_KEYWORD
| (* variant: *) YUL_DELEGATE_CALL_KEYWORD
| (* variant: *) YUL_DIV_KEYWORD
| (* variant: *) YUL_EQ_KEYWORD
| (* variant: *) YUL_EXP_KEYWORD
| (* variant: *) YUL_EXT_CODE_COPY_KEYWORD
| (* variant: *) YUL_EXT_CODE_SIZE_KEYWORD
| (* variant: *) YUL_GAS_KEYWORD
| (* variant: *) YUL_GAS_LIMIT_KEYWORD
| (* variant: *) YUL_GAS_PRICE_KEYWORD
| (* variant: *) YUL_GT_KEYWORD
| (* variant: *) YUL_INVALID_KEYWORD
| (* variant: *) YUL_IS_ZERO_KEYWORD
| (* variant: *) YUL_LOG_0_KEYWORD
| (* variant: *) YUL_LOG_1_KEYWORD
| (* variant: *) YUL_LOG_2_KEYWORD
| (* variant: *) YUL_LOG_3_KEYWORD
| (* variant: *) YUL_LOG_4_KEYWORD
| (* variant: *) YUL_LT_KEYWORD
| (* variant: *) YUL_M_LOAD_KEYWORD
| (* variant: *) YUL_MOD_KEYWORD
| (* variant: *) YUL_M_SIZE_KEYWORD
| (* variant: *) YUL_M_STORE_8_KEYWORD
| (* variant: *) YUL_M_STORE_KEYWORD
| (* variant: *) YUL_MUL_KEYWORD
| (* variant: *) YUL_MUL_MOD_KEYWORD
| (* variant: *) YUL_NOT_KEYWORD
| (* variant: *) YUL_NUMBER_KEYWORD
| (* variant: *) YUL_ORIGIN_KEYWORD
| (* variant: *) YUL_OR_KEYWORD
| (* variant: *) YUL_POP_KEYWORD
| (* variant: *) YUL_RETURN_KEYWORD
| (* variant: *) YUL_REVERT_KEYWORD
| (* variant: *) YUL_S_DIV_KEYWORD
| (* variant: *) YUL_SELF_DESTRUCT_KEYWORD
| (* variant: *) YUL_SGT_KEYWORD
| (* variant: *) YUL_SIGN_EXTEND_KEYWORD
| (* variant: *) YUL_S_LOAD_KEYWORD
| (* variant: *) YUL_SLT_KEYWORD
| (* variant: *) YUL_S_MOD_KEYWORD
| (* variant: *) YUL_S_STORE_KEYWORD
| (* variant: *) YUL_STOP_KEYWORD
| (* variant: *) YUL_SUB_KEYWORD
| (* variant: *) YUL_TIMESTAMP_KEYWORD
| (* variant: *) YUL_XOR_KEYWORD
| (* variant: *) YUL_KECCAK_256_KEYWORD (* Introduced in 0.4.12 *)
| (* variant: *) YUL_SHA_3_KEYWORD (* Deprecated in 0.5.0 *)
| (* variant: *) YUL_SUICIDE_KEYWORD (* Deprecated in 0.5.0 *)
| (* variant: *) YUL_RETURN_DATA_COPY_KEYWORD (* Introduced in 0.4.12 *)
| (* variant: *) YUL_RETURN_DATA_SIZE_KEYWORD (* Introduced in 0.4.12 *)
| (* variant: *) YUL_STATIC_CALL_KEYWORD (* Introduced in 0.4.12 *)
| (* variant: *) YUL_CREATE_2_KEYWORD (* Introduced in 0.4.12 *)
| (* variant: *) YUL_EXT_CODE_HASH_KEYWORD (* Introduced in 0.5.0 *)
| (* variant: *) YUL_SAR_KEYWORD
| (* variant: *) YUL_SHL_KEYWORD
| (* variant: *) YUL_SHR_KEYWORD
| (* variant: *) YUL_CHAIN_ID_KEYWORD
| (* variant: *) YUL_SELF_BALANCE_KEYWORD
| (* variant: *) YUL_BASE_FEE_KEYWORD (* Introduced in 0.8.7 *)
| (* variant: *) YUL_DIFFICULTY_KEYWORD (* Deprecated in 0.8.18 *)
| (* variant: *) YUL_PREV_RANDAO_KEYWORD (* Introduced in 0.8.18 *)
| (* variant: *) YUL_BLOB_BASE_FEE_KEYWORD (* Introduced in 0.8.24 *)
| (* variant: *) YUL_BLOB_HASH_KEYWORD (* Introduced in 0.8.24 *)
| (* variant: *) YUL_T_LOAD_KEYWORD (* Introduced in 0.8.24 *)
| (* variant: *) YUL_T_STORE_KEYWORD (* Introduced in 0.8.24 *)
| (* variant: *) YUL_M_COPY_KEYWORD; (* Introduced in 0.8.24 *)
YulLiteral = (* variant: *) YUL_TRUE_KEYWORD
| (* variant: *) YUL_FALSE_KEYWORD
| (* variant: *) YUL_DECIMAL_LITERAL
| (* variant: *) YUL_HEX_LITERAL
| (* variant: *) HexStringLiteral
| (* variant: *) StringLiteral;
YUL_DECIMAL_LITERAL = "0" | (("1"…"9") ("0"…"9")*);
YUL_HEX_LITERAL = "0x" «HEX_CHARACTER»+;
Documentation#
Note
This section is under construction. You are more than welcome to contribute suggestions to our GitHub repository.