雜項

翻譯原文

date:20170726

在Storage中狀態(tài)變量的層級

靜態(tài)大小的變量(除了mapping和動態(tài)大小的數(shù)組類型)從位置0開始連續(xù)的排列的。如果可以,不足32位的數(shù)據(jù)將會按照下面的規(guī)則打包在一個數(shù)據(jù)槽中:

  • Storage數(shù)據(jù)槽中的第一項按照低端對齊方式存儲。(?The first item in a storage slot is stored lower-order aligned.)
  • 基礎(chǔ)數(shù)據(jù)類型只使用它們所需的內(nèi)存大小來保存數(shù)據(jù)。
  • 如果基礎(chǔ)數(shù)據(jù)類型的大小超過了數(shù)據(jù)槽中的剩余大小,會把數(shù)據(jù)保存在下個數(shù)據(jù)槽中。
  • 結(jié)構(gòu)體和數(shù)組數(shù)據(jù)總是以新的數(shù)據(jù)槽開始,并且占用整個數(shù)據(jù)槽(但是在結(jié)構(gòu)體的項或者數(shù)組將會根據(jù)各自的規(guī)則緊緊的打包在一起)

**
警告:當使用小魚32位大小的元素時,合約可能會消耗更多的gas。這是因為EVM每次操作都是32位的。因此,如果數(shù)據(jù)小于32位,EBM必須進行更多的操作來從32位數(shù)據(jù)中取出所需的數(shù)據(jù)。
使用小于32位數(shù)據(jù)的唯一好處是:由于編譯器把多個數(shù)據(jù)打包到一個數(shù)據(jù)槽中,你如果要處理數(shù)據(jù)就可以在一個操作中讀寫。當處理函數(shù)參數(shù)或者內(nèi)存值的時候,就沒有這些好處了,因為編譯器不會打包這些數(shù)據(jù)的。
最后,為了允許EVM優(yōu)化存儲,要保證你對storage變量和struct成員已經(jīng)排過序了,以方便打包。例如,storage變量的聲明順序uint128,uit128,uint256會優(yōu)于uint128,uint256,uint128,因為前一個聲明順序只會消耗2個storage數(shù)據(jù)槽,但是后面的聲明順序會消耗3個。
**

結(jié)構(gòu)體和數(shù)組的元素都是按照順序存儲的,就好像是他們都是被給定的一樣。

由于他們有不可預(yù)估的大小,mapping和動態(tài)大小數(shù)組累心使用Keccak-256 哈希計算來找到他們的起始位置或者數(shù)組數(shù)據(jù)。這些起始位置總是占用整個數(shù)據(jù)槽。

根據(jù)上面的規(guī)則(或者遞歸這個規(guī)則,mapping里的mapping或array里的array),mapping或者動態(tài)數(shù)組本身在storage的某個位置p占據(jù)了一個(不完整的)數(shù)據(jù)槽。對于動態(tài)數(shù)組。這個數(shù)據(jù)槽存儲了數(shù)組的長度(bytes數(shù)組和string是例外,參看下文)。對于mapping,這個數(shù)據(jù)槽沒有使用(但是這是需要的,這樣兩個相鄰且相同的mapping就會有不同的hash分布了)。數(shù)組數(shù)據(jù)位于keccak256(p),鍵k對應(yīng)的數(shù)據(jù)位于keccak256(k. p),其中的.是連接符。如果值是非基礎(chǔ)類型數(shù)據(jù),數(shù)據(jù)的位置會加上一個偏移量keccak(k . p)。

bytesstring的數(shù)據(jù)都保存在同一個數(shù)據(jù)槽中,如果數(shù)據(jù)較短,也會保存他們的長度。特殊的:如果數(shù)據(jù)是31字節(jié)長,它會按照大端順序存儲(左對齊)且最低位保存length * 2。如果數(shù)據(jù)更長,主數(shù)據(jù)槽會保存length*2 + 1,數(shù)據(jù)跟平常一樣保存在keccak256(slot)

所以如下的合約代碼:

pragma solidity ^0.4.0;

contract C {
  struct s { uint a; uint b; }
  uint x;
  mapping(uint => mapping(uint => s)) data;
}

數(shù)據(jù)data[4][9].b的位置是keccak(uint256(9) . keccak256(uint256(4) . uint256(1))) + 1。

內(nèi)存中的層級

solidity中保留了3種256位的數(shù)據(jù)槽:

  • 0 - 64:哈希方法使用的零空間(?scratch space for hashing methods)
  • 64 - 96:當前的分配內(nèi)存的大?。ū娝苤?,空白內(nèi)存的指針)

零空間可以用于表達式之間(例如,在內(nèi)聯(lián)匯編)。

solidity總是把新的對象放置在空白內(nèi)存指針指向的內(nèi)存并且內(nèi)存不會釋放(這會在以后的版本中改變)

警告:solidity中的一些操作會需要大于64字節(jié)的臨時內(nèi)存,因此會和零空間不匹配。他們會使用空白指針指向的內(nèi)存空間,但是他們的生命周期很短,指針不會更新。內(nèi)存可能或者不會重置。由于這個原因,我們不應(yīng)該假設(shè)空白內(nèi)存是被置零了的。

調(diào)用數(shù)據(jù)的層級

當Solidity合約發(fā)布了,并且當它從另一個合約被調(diào)用,輸入數(shù)據(jù)會被假定以abi的形式傳入。ABI形式需要參數(shù)填充為32字節(jié)的整數(shù)倍。內(nèi)部函數(shù)調(diào)用使用不同的約定。

內(nèi)部 - 清除變量(Internals - Cleaning Up Variables)

當值的長度小于256位時,由于某些原因,剩余位必須要清除。solidity編譯器被設(shè)計為:在對這些保留位進行操作之前,會清除這些保留位,因為操作可能會生成潛在的垃圾。例如,在把值寫進內(nèi)存之前,保留位需要被清除,因為內(nèi)存的內(nèi)容可以被用來存儲哈希值或者給消息調(diào)用傳遞數(shù)據(jù)。類似的,在把值存進storage之前,保留位必須要清除,否則會觀察到錯誤的值。

另一方面,如果對下一個操作沒有產(chǎn)生影響,我們也不需要清理這些位。例如,由于非零的值都會被JUMPI指令看成是true,這些布爾量在JUMPI指令的條件執(zhí)行之前,也沒有必要清除。

為了實現(xiàn)上述的原則,Solidity編譯器會對從堆棧中載入的輸入數(shù)據(jù)進行清理。

不同的類型有不同的清理規(guī)則:

類型 有效值 非法值處理方法
枚舉數(shù)為n的枚舉類型 0到 n-1 拋出異常
布爾類型 0或1 1
有符號整形 符號擴展字 目前只是精磨包裹,以后會拋出異常
無符號整形 高位置零 目前只是精磨包裹,以后會拋出異常

內(nèi)部 - 優(yōu)化器(Internals - The Optimizer)

Solidiy優(yōu)化器在匯編層面操作,所以可以當做并且也被用于另一種語言。它會把指令序列按照JUMPs和JUMPDESTs分割成代碼塊。在這些代碼塊中,指令會被分析并且對棧,對內(nèi)存或者對storage的每次改動都被記錄為表達式,表達式由一系列的指令和參數(shù)組成。這些參數(shù)本質(zhì)上又指向其他表達式。主要的理念是找到總是跟輸入相同的表達式,并把他們組合成一個表達式集合。優(yōu)化器首先會嘗試在一個已知的表達式列表中找到和新的表達式匹配的表達式。如果列表中不存在,表達式會按照constant + constant = sum_of_constants或者X * 1 = X的規(guī)則來簡化。當對這些遞歸操作之后,雖然第二個參數(shù)是一個更加復(fù)雜的表達式,但是我們知道它總是為1,我們就可以使用第二個規(guī)則。對內(nèi)存和storage位置的修改會清除內(nèi)存和storage的值,因為我們不知道他們的地址是否是不同的:如果我們先對地址x寫,然后對地址y寫,并且都是輸入變量,第二個變量可能會覆蓋第一個,所以在我們對y寫操作之后,就不知道x的值。另外,如果一個簡單的表達式x-y得到一個非零的靜態(tài)常量,我們可以推出x的值。

在這個操作之后,我們知道哪個表達式必須是在堆棧最后,并且對內(nèi)存和storage有一系列的修改。這些信息會被一起記錄在基礎(chǔ)代碼塊中并且會把它們連接起來。另外,堆棧信息,storage和內(nèi)存配置,保存在下一個代碼塊中。如果我們知道所有JUMP和JUMPI指令的跳轉(zhuǎn)目的,我們可以為程序建立完整的控制流圖譜。如果只有對一個跳轉(zhuǎn)不知道目的地址(根據(jù)規(guī)則,這是可能的,跳轉(zhuǎn)地址可以通過輸入計算出來),我們必須擦除輸入狀態(tài)塊的所有狀態(tài)信息,因為他可能是不確定跳轉(zhuǎn)的目的地址。如果JUMPI的條件是常亮,就會變成非條件跳轉(zhuǎn)。

最后一步,每個代碼塊的代碼都會被重新生成。在代碼塊最后會從這些堆棧表達式中生成一個依賴圖表。任何不是該圖表的一部分的表達式都會被丟棄。現(xiàn)在生成了新的代碼,按照他們在原代碼中的順序?qū)Χ褩:蛢?nèi)存進行修改(會刪除無效的更改),最后在堆棧正確的地方生成所需的所有的值。

這些步驟會應(yīng)用到對每個基礎(chǔ)塊,并且新生成的代碼如果更小,會替換原來的代碼塊。如果基礎(chǔ)塊按照JUMPI分割,且在分析過程中,如果條件是常量,JUMPI會被替換為依賴常量,因此如下代碼:

var x = 7;
data[7] = 9;
if (data[x] != x + 2)
  return 2;
else
  return 1;

會被簡化,并且編譯簡化代碼:

data[7] = 9;
return 1;

盡管剛開始的時候會包含跳轉(zhuǎn)指令,但是優(yōu)化后之后就沒有了。

源碼映射

作為AST輸出的一部分,編譯器會提供每個AST節(jié)點的源碼。這可以有多種用途,靜態(tài)分析工具基于AST報告錯誤,調(diào)試工具用來高亮局部變量和他們的使用。

另外,編譯器會生成字節(jié)碼到通過指令生成的源碼的映射。這也對靜態(tài)分析工具在字節(jié)碼層面操作很重要,并且調(diào)試器可以顯示源碼的當前位置或者處理斷點。

兩種源碼映射都使用整形標識符來引用源碼。這些規(guī)整的數(shù)組是對被稱為sourceList的源碼文件的索引。這些源碼文件時combined-json文件和json/npm編譯器輸出的一部分。

在AST中使用如下標記來對源碼進行映射:

s:l:f

其中s是源碼起始位置的偏移,l是源碼長度,以字節(jié)為單位,f是源碼索引。
源碼映射的字節(jié)碼編碼會更加復(fù)雜:是用;分割的一系列的s:l:f:j。每個元素對應(yīng)于一個指令。例如你不能使用字節(jié)偏移但是可以使用指令偏移(指令長度不長于一個字節(jié))。字段s,lf位于上部分,j,可以是i,o或者-用來指示是否是跳轉(zhuǎn)指令跳轉(zhuǎn)到函數(shù),從函數(shù)中返回還是只是循環(huán)中的一個常規(guī)的跳轉(zhuǎn)。

為了壓縮這些代碼映射的字節(jié)碼,會使用下面的規(guī)則:

  • 如果字段為空,會使用前一個元素的值
  • 如果:丟失了,下面的字段都會被忽略

這意味著下面的源碼映射都表達了相同的信息:

1:2:1;1:9:1;2:1:2;2:1:2;2:1:2
1:2:1;:9;2::2;;

合約元數(shù)據(jù)

Solidity編譯器會自動生成JSON文件,合約元數(shù)據(jù),它包含當前合約的信息。它可以用來查詢當前源碼使用的編譯器版本,ABI和NatSpec文檔,來更安全的跟合約互動和驗證它的源碼,

編譯器依賴元數(shù)據(jù)文件的Swarm哈希來結(jié)束每個合約的字節(jié)碼(詳情請看下面章節(jié)),所以你可以通過文件來授權(quán)取回文件,而不需要一個中心化的數(shù)據(jù)提供方。

當然,你必須把文件發(fā)布到Swarm(或者其他服務(wù)器),那么其他人就可以訪問到了。該文件可以通過命令solc --metadata來生成,文件名稱為ContractName_meta.json。它會包含源文件的Swarm引用。所以,你必須把所有源文件和元數(shù)據(jù)文件都上傳上去。

元數(shù)據(jù)文件有下面的格式。例子以可讀的形式呈現(xiàn)。格式化的元數(shù)據(jù)必須正確使用引號,減少空格來壓縮數(shù)據(jù),所有對象的名字都要排序,以達到唯一的形式。當然注釋也是不允許的,這里只是為了說明。

{
  // 必須字段:元數(shù)據(jù)格式的版本
  version: "1",
  // 必須字段:源碼的語言,通常選擇一個子版本
  language: "Solidity",
  // 必須字段:編譯器詳情信息,內(nèi)容是語言的詳細信息
  compiler: {
    // Solidity需要這個信息:編譯器版本
    version: "0.4.6+commit.2dabbdf0.Emscripten.clang",
    // 可選:編譯器二進制的Hash值
    keccak256: "0x123..."
  },
  // 必須字段:編譯源碼文件/源單元,文件名稱為鍵
  sources:
  {
    "myFile.sol": {
      // 必須字段:源文件的keccak256的Hash值
      "keccak256": "0x123...",
      // 必須字段(除非”content”字段被使用,參看下文):文件的短URL(s),協(xié)議任意,但是推薦使用Swram url。
      "urls": [ "bzzr://56ab..." ]
    },
    "mortal": {
      // 必須字段:源碼的keccak256 hash值。
      "keccak256": "0x234...",
      // 必須字段(除非“url“被使用):源文件的字面內(nèi)容
      "content": "contract mortal is owned { function kill() { if (msg.sender == owner) selfdestruct(owner); } }"
    }
  },
  // 必須字段:編譯器設(shè)置
  settings:
  {
    // 必須字段,solidity需要:排過序的remapping
    remappings: [ ":g/dir" ],
    // 可選字段:優(yōu)化設(shè)置(默認enable字段為false)
    Optional: Optimizer settings (enabled defaults to false)
    optimizer: {
      enabled: true,
      runs: 500
    },
    // 必須字段,solidity需要:這個元數(shù)據(jù)文件所對應(yīng)的合約文件和名稱或者庫
    compilationTarget: {
      "myFile.sol": "MyContract"
    },
    // 必須字段,solidity需要:所需庫的地址
    libraries: {
      "MyLib": "0x123123..."
    }
  },
  // 必須字段:合約的生成信息。
  output:
  {
    // 必須字段:合約的ABI定義
    abi: [ ... ],
    // 必須字段:該合約的NatSpec 使用文檔
    userdoc: [ ... ],
    // 必須字段:合約的NatSpec開發(fā)文檔
    devdoc: [ ... ],
  }
}

注意:注意ABI定義么有固定的順序。它因編譯器版本不同而不同

注意:由于目標合約的字節(jié)碼有元數(shù)據(jù)的hash,對元數(shù)據(jù)文件的任何修改將會導致字節(jié)碼的改變。另外,元數(shù)據(jù)文件中也有源文件的hash,任意源文件的任何改變都會導致不同的元數(shù)據(jù)文件和不同的字節(jié)碼。

字節(jié)碼形式的元數(shù)據(jù)hash編碼(Encoding of the Metadata Hash in the Bytecode)

因為我們可能在未來提供取回元數(shù)據(jù)文件的方法,映射{"bzzr0":<Swarm hash>}被存儲為CBOR-編碼(DBOR)。由于編碼的起始位置不容易找到,它的長度添加為2個字節(jié),大端存儲編碼。當前版本的Solidity編譯器會在字節(jié)碼末尾添加下面的內(nèi)容。

0xa1 0x65 'b' 'z' 'z' 'r' '0' 0x58 0x20 <32 bytes swarm hash> 0x00 0x29

所以為了取回數(shù)據(jù),已發(fā)布字節(jié)碼的末尾可以用來檢驗是否符合那個模式和使用Swarm hash值來取回文件。

使用自動接口生成和NatSpec

元數(shù)據(jù)通過以下方式使用:一個組件想要跟合約互動(例如,mist)獲取合約的代碼,用所取回文件的Swarm hash值。那個文件時JSON編碼的結(jié)構(gòu)化數(shù)據(jù),如上所述。

然后組件可以使用ABI來自動生成合約的基本用戶界面。

另外,當用戶操作合約的時候,Mist可以用userdoc來顯示確認信息。

使用源碼驗證

為了驗證兼容性,源碼可以通過元數(shù)據(jù)文件的hash,從Swarm中取回。正確的編譯器版本(將會檢驗是否是官方編譯器的版本)會被調(diào)用,并輸入指定的設(shè)置。最后的字節(jié)碼會和創(chuàng)建交易的數(shù)據(jù)或者CREATE操作碼數(shù)據(jù)相比較。這會自動驗證元數(shù)據(jù),因為hash是字節(jié)碼的一部分。構(gòu)造函數(shù)的輸入對應(yīng)的其他數(shù)據(jù),應(yīng)該根據(jù)接口被解碼并呈現(xiàn)給用戶。

提示和技巧

  • 對數(shù)組使用delete會刪除它的所有數(shù)據(jù)
  • 對結(jié)構(gòu)體元素使用更短的類型并排序,這樣有利于壓縮短的數(shù)據(jù)。這可以減小gas消耗,因為多個SSTORE操作可能合成一個操作(SSTORE消耗5000或者20000gas,所以這是你期望優(yōu)化的)。使用價格預(yù)估函數(shù)(且使用優(yōu)化器)來檢測。
  • 使狀態(tài)變量聲明為共有-編譯器會自動為其生成getters
  • 如果你在函數(shù)開頭寫了大量的代碼,用來檢驗輸入或者狀態(tài),嘗試使用函數(shù)修改器
  • 如果你的合約有send函數(shù),但是你想使用內(nèi)建的send函數(shù),使用address(contractVariable).send(amount)來調(diào)用。
  • 在一個賦值表達式中,對storage結(jié)構(gòu)體初始化:x = MyStruct({a: 1, b: 2})

表格

操作碼優(yōu)先級

以下是操作碼的優(yōu)先級,根據(jù)執(zhí)行順序羅列出來。

優(yōu)先級 描述 操作碼
1 后置自加或者自減 ++,--
1 New表達式 new <typename>
1 數(shù)組下標 <array>[<index>]
1 訪問成員 <object>.<member>
1 函數(shù)形式調(diào)用 <func>(<args...>)
1 圓括號 (<statement>)
2 前置自加和自減 ++,--
2 一元加和減法 +,-
2 一元操作碼 delete
2 邏輯非 !
2 按位反 ~
3 指數(shù) **
4 乘法,除法和取摸 *,/,%
5 加法和減法 +,-
6 位移操作 <<,>>
7 按位與 &
8 按位異或 ^
9 按位或 ` `
10 非等操作符 <,>,<=,>=
11 等號操作符 ==,!=
12 邏輯與 &&
13 邏輯或 ` `
14 三元操作符 <conditional> ? <if-true> : <if-false>
15 賦值操作符 =,` =,^=,&=,<<=,>>=,+=,-=,*=,/=,%=`
16 點操作符 .
全局變量
  • block.blockhash(uint blockNumber) returns (bytes32):獲取給定區(qū)塊號的hash值-只對最近的256塊有效。
  • block.coinbase(address)`:當前區(qū)塊的礦工地址
  • block.difficulty(uint)`:當前區(qū)塊的難度
  • block.gaslimit(uint)`:當前區(qū)塊的gas限制
  • block.number(uint)`:當前區(qū)塊的區(qū)塊號
  • block.timestamp(uint)`:當前區(qū)塊的時間戳
  • msg.data(bytes)`:完整的調(diào)用數(shù)據(jù)calldata
  • msg.gas(uint)`:剩余gas
  • msg.sendet(address)`:消息的發(fā)送方(當前調(diào)用)
  • msg.value(uint):消息發(fā)送的wei數(shù)量
  • now(uint):當前區(qū)塊的時間戳(block.timestamp的別名)
  • tx.gasprice(uint)`:交易的gas價格
  • tx.origin(uint)`:交易的發(fā)送方(整個調(diào)用鏈)
  • assert(bool condition):如果條件為false,中斷執(zhí)行并撤銷修改(用于內(nèi)部錯誤)
  • require(bool condition):如果條件為false,中斷執(zhí)行并撤銷修改(用于不合預(yù)期的輸入和外部組件的錯誤)
  • revert():中斷執(zhí)行并撤銷修改
  • keccak256(...) returns (bytes32):計算(打包好的)參數(shù)的Ethereum-SHA-3(Keccak-256)哈希
  • sha3(...) returns (bytes32):keccak256()的別名
  • sha256(...) returns (bytes):計算(打包好的)參數(shù)的SHA-256 哈希值
  • ripemd160(...) returns (bytes20):計算(打包好的)參數(shù)的RIPEMD-160 哈希值
  • ecrecover(bytes32 hash, uint8 v, bytes32 r,bytes32 s) returns (address):返回地址和公鑰相關(guān)的橢圓曲線簽名,如果出錯返回0
  • addmod(uint x, uint y, uint k) returns (uint):計算(x + y) % k,其中加法的精度可以是任意的,不會再2 ** 256之內(nèi)截斷
  • mulmod(uint x, uint y, uint k) returns (uint):計算(x * y) % k,其中乘法的精度可以是任意的,不會再2 ** 256之內(nèi)截斷
  • this(當前合約的類型):當前合約,可以顯式轉(zhuǎn)換為address
  • super:合約的繼承性的上一級
  • selfdestruct(address recipient):銷毀當前合約,發(fā)送剩余錢幣到指定地址
  • <address>.balance(uint256)`:地址的余額,單位為wei
  • <address>.send(uint256 amount) returns (bool):發(fā)送指定金額(單位為wei)到指定地址,如果失敗返回false
  • <address>.transfer(uint256 amount):發(fā)送指定金額(單位為wei)到指定地址,如果失敗拋出異常
函數(shù)可見性指定
function myFunction() <visibility specifier> returns (bool) {
    return true;
}
  • public:內(nèi)部可見和外部可見(會為狀態(tài)變量生成getter函數(shù))
  • private:只在當前合約可見
  • external:只外部可見(只對函數(shù)而言)-例如,只能使用消息調(diào)用(通過this.func
  • internal:只在內(nèi)部可見
修改器
  • constant針對狀態(tài)變量:除了初始化之外,不能多次賦值,不會占用內(nèi)存槽
  • constant針對函數(shù):不允許再修改-這不是強制的
  • anoymous針對事件:不會存儲事件簽名作為主題
  • indexed針對事件參數(shù):保存主題的參數(shù)
  • payable針對函數(shù):允許他們接收以太幣
保留關(guān)鍵字

這些關(guān)鍵字是Solidity的保留字。他們可能在以后的版本中用到。

abstract, after, case, catch, default, final, in, inline, interface, let, match, null, of, pure, relocatable, static, switch, try, type, typeof, view

語言語法
SourceUnit = (PragmaDirective | ImportDirective | ContractDefinition)*

// Pragma actually parses anything up to the trailing ';' to be fully forward-compatible.
PragmaDirective = 'pragma' Identifier ([^;]+) ';'

ImportDirective = 'import' StringLiteral ('as' Identifier)? ';'
        | 'import' ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral ';'
        | 'import' '{' Identifier ('as' Identifier)? ( ',' Identifier ('as' Identifier)? )* '}' 'from' StringLiteral ';'

ContractDefinition = ( 'contract' | 'library' | 'interface' ) Identifier
                     ( 'is' InheritanceSpecifier (',' InheritanceSpecifier )* )?
                     '{' ContractPart* '}'

ContractPart = StateVariableDeclaration | UsingForDeclaration
             | StructDefinition | ModifierDefinition | FunctionDefinition | EventDefinition | EnumDefinition

InheritanceSpecifier = UserDefinedTypeName ( '(' Expression ( ',' Expression )* ')' )?

StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' )? Identifier ('=' Expression)? ';'
UsingForDeclaration = 'using' Identifier 'for' ('*' | TypeName) ';'
StructDefinition = 'struct' Identifier '{'
                     ( VariableDeclaration ';' (VariableDeclaration ';')* )? '}'

ModifierDefinition = 'modifier' Identifier ParameterList? Block
ModifierInvocation = Identifier ( '(' ExpressionList? ')' )?

FunctionDefinition = 'function' Identifier? ParameterList
                     ( ModifierInvocation | 'constant' | 'payable' | 'external' | 'public' | 'internal' | 'private' )*
                     ( 'returns' ParameterList )? ( ';' | Block )
EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';'

EnumValue = Identifier
EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'

IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')'
ParameterList =        '(' ( TypeName            Identifier? (',' TypeName            Identifier?)* )? ')'
TypeNameList =         '(' ( TypeName (',' TypeName )* )? ')'

// semantic restriction: mappings and structs (recursively) containing mappings
// are not allowed in argument lists
VariableDeclaration = TypeName StorageLocation? Identifier

TypeName = ElementaryTypeName
         | UserDefinedTypeName
         | Mapping
         | ArrayTypeName
         | FunctionTypeName

UserDefinedTypeName = Identifier ( '.' Identifier )*

Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
ArrayTypeName = TypeName '[' Expression? ']'
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | 'constant' | 'payable' )*
                   ( 'returns' TypeNameList )?
StorageLocation = 'memory' | 'storage'

Block = '{' Statement* '}'
Statement = IfStatement | WhileStatement | ForStatement | Block | InlineAssemblyStatement |
            ( DoWhileStatement | PlaceholderStatement | Continue | Break | Return |
              Throw | SimpleStatement ) ';'

ExpressionStatement = Expression
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
WhileStatement = 'while' '(' Expression ')' Statement
PlaceholderStatement = '_'
SimpleStatement = VariableDefinition | ExpressionStatement
ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
InlineAssemblyStatement = 'assembly' StringLiteral? InlineAssemblyBlock
DoWhileStatement = 'do' Statement 'while' '(' Expression ')'
Continue = 'continue'
Break = 'break'
Return = 'return' Expression?
Throw = 'throw'
VariableDefinition = ('var' IdentifierList | VariableDeclaration) ( '=' Expression )?
IdentifierList = '(' ( Identifier? ',' )* Identifier? ')'

// Precedence by order (see github.com/ethereum/solidity/pull/732)
Expression
  = Expression ('++' | '--')
  | NewExpression
  | IndexAccess
  | MemberAccess
  | FunctionCall
  | '(' Expression ')'
  | ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
  | Expression '**' Expression
  | Expression ('*' | '/' | '%') Expression
  | Expression ('+' | '-') Expression
  | Expression ('<<' | '>>') Expression
  | Expression '&' Expression
  | Expression '^' Expression
  | Expression '|' Expression
  | Expression ('<' | '>' | '<=' | '>=') Expression
  | Expression ('==' | '!=') Expression
  | Expression '&&' Expression
  | Expression '||' Expression
  | Expression '?' Expression ':' Expression
  | Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
  | PrimaryExpression

PrimaryExpression = BooleanLiteral
                  | NumberLiteral
                  | HexLiteral
                  | StringLiteral
                  | TupleExpression
                  | Identifier
                  | ElementaryTypeNameExpression

ExpressionList = Expression ( ',' Expression )*
NameValueList = Identifier ':' Expression ( ',' Identifier ':' Expression )*

FunctionCall = Expression '(' FunctionCallArguments ')'
FunctionCallArguments = '{' NameValueList? '}'
                      | ExpressionList?

NewExpression = 'new' TypeName
MemberAccess = Expression '.' Identifier
IndexAccess = Expression '[' Expression? ']'

BooleanLiteral = 'true' | 'false'
NumberLiteral = ( HexNumber | DecimalNumber ) (' ' NumberUnit)?
NumberUnit = 'wei' | 'szabo' | 'finney' | 'ether'
           | 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years'
HexLiteral = 'hex' ('"' ([0-9a-fA-F]{2})* '"' | '\'' ([0-9a-fA-F]{2})* '\'')
StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"'
Identifier = [a-zA-Z_$] [a-zA-Z_$0-9]*

HexNumber = '0x' [0-9a-fA-F]+
DecimalNumber = [0-9]+

TupleExpression = '(' ( Expression ( ',' Expression )*  )? ')'
                | '[' ( Expression ( ',' Expression )*  )? ']'

ElementaryTypeNameExpression = ElementaryTypeName

ElementaryTypeName = 'address' | 'bool' | 'string' | 'var'
                   | Int | Uint | Byte | Fixed | Ufixed

Int = 'int' | 'int8' | 'int16' | 'int24' | 'int32' | 'int40' | 'int48' | 'int56' | 'int64' | 'int72' | 'int80' | 'int88' | 'int96' | 'int104' | 'int112' | 'int120' | 'int128' | 'int136' | 'int144' | 'int152' | 'int160' | 'int168' | 'int176' | 'int184' | 'int192' | 'int200' | 'int208' | 'int216' | 'int224' | 'int232' | 'int240' | 'int248' | 'int256'

Uint = 'uint' | 'uint8' | 'uint16' | 'uint24' | 'uint32' | 'uint40' | 'uint48' | 'uint56' | 'uint64' | 'uint72' | 'uint80' | 'uint88' | 'uint96' | 'uint104' | 'uint112' | 'uint120' | 'uint128' | 'uint136' | 'uint144' | 'uint152' | 'uint160' | 'uint168' | 'uint176' | 'uint184' | 'uint192' | 'uint200' | 'uint208' | 'uint216' | 'uint224' | 'uint232' | 'uint240' | 'uint248' | 'uint256'

Byte = 'byte' | 'bytes' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | 'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' | 'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32'

Fixed = 'fixed' | 'fixed0x8' | 'fixed0x16' | 'fixed0x24' | 'fixed0x32' | 'fixed0x40' | 'fixed0x48' | 'fixed0x56' | 'fixed0x64' | 'fixed0x72' | 'fixed0x80' | 'fixed0x88' | 'fixed0x96' | 'fixed0x104' | 'fixed0x112' | 'fixed0x120' | 'fixed0x128' | 'fixed0x136' | 'fixed0x144' | 'fixed0x152' | 'fixed0x160' | 'fixed0x168' | 'fixed0x176' | 'fixed0x184' | 'fixed0x192' | 'fixed0x200' | 'fixed0x208' | 'fixed0x216' | 'fixed0x224' | 'fixed0x232' | 'fixed0x240' | 'fixed0x248' | 'fixed0x256' | 'fixed8x8' | 'fixed8x16' | 'fixed8x24' | 'fixed8x32' | 'fixed8x40' | 'fixed8x48' | 'fixed8x56' | 'fixed8x64' | 'fixed8x72' | 'fixed8x80' | 'fixed8x88' | 'fixed8x96' | 'fixed8x104' | 'fixed8x112' | 'fixed8x120' | 'fixed8x128' | 'fixed8x136' | 'fixed8x144' | 'fixed8x152' | 'fixed8x160' | 'fixed8x168' | 'fixed8x176' | 'fixed8x184' | 'fixed8x192' | 'fixed8x200' | 'fixed8x208' | 'fixed8x216' | 'fixed8x224' | 'fixed8x232' | 'fixed8x240' | 'fixed8x248' | 'fixed16x8' | 'fixed16x16' | 'fixed16x24' | 'fixed16x32' | 'fixed16x40' | 'fixed16x48' | 'fixed16x56' | 'fixed16x64' | 'fixed16x72' | 'fixed16x80' | 'fixed16x88' | 'fixed16x96' | 'fixed16x104' | 'fixed16x112' | 'fixed16x120' | 'fixed16x128' | 'fixed16x136' | 'fixed16x144' | 'fixed16x152' | 'fixed16x160' | 'fixed16x168' | 'fixed16x176' | 'fixed16x184' | 'fixed16x192' | 'fixed16x200' | 'fixed16x208' | 'fixed16x216' | 'fixed16x224' | 'fixed16x232' | 'fixed16x240' | 'fixed24x8' | 'fixed24x16' | 'fixed24x24' | 'fixed24x32' | 'fixed24x40' | 'fixed24x48' | 'fixed24x56' | 'fixed24x64' | 'fixed24x72' | 'fixed24x80' | 'fixed24x88' | 'fixed24x96' | 'fixed24x104' | 'fixed24x112' | 'fixed24x120' | 'fixed24x128' | 'fixed24x136' | 'fixed24x144' | 'fixed24x152' | 'fixed24x160' | 'fixed24x168' | 'fixed24x176' | 'fixed24x184' | 'fixed24x192' | 'fixed24x200' | 'fixed24x208' | 'fixed24x216' | 'fixed24x224' | 'fixed24x232' | 'fixed32x8' | 'fixed32x16' | 'fixed32x24' | 'fixed32x32' | 'fixed32x40' | 'fixed32x48' | 'fixed32x56' | 'fixed32x64' | 'fixed32x72' | 'fixed32x80' | 'fixed32x88' | 'fixed32x96' | 'fixed32x104' | 'fixed32x112' | 'fixed32x120' | 'fixed32x128' | 'fixed32x136' | 'fixed32x144' | 'fixed32x152' | 'fixed32x160' | 'fixed32x168' | 'fixed32x176' | 'fixed32x184' | 'fixed32x192' | 'fixed32x200' | 'fixed32x208' | 'fixed32x216' | 'fixed32x224' | 'fixed40x8' | 'fixed40x16' | 'fixed40x24' | 'fixed40x32' | 'fixed40x40' | 'fixed40x48' | 'fixed40x56' | 'fixed40x64' | 'fixed40x72' | 'fixed40x80' | 'fixed40x88' | 'fixed40x96' | 'fixed40x104' | 'fixed40x112' | 'fixed40x120' | 'fixed40x128' | 'fixed40x136' | 'fixed40x144' | 'fixed40x152' | 'fixed40x160' | 'fixed40x168' | 'fixed40x176' | 'fixed40x184' | 'fixed40x192' | 'fixed40x200' | 'fixed40x208' | 'fixed40x216' | 'fixed48x8' | 'fixed48x16' | 'fixed48x24' | 'fixed48x32' | 'fixed48x40' | 'fixed48x48' | 'fixed48x56' | 'fixed48x64' | 'fixed48x72' | 'fixed48x80' | 'fixed48x88' | 'fixed48x96' | 'fixed48x104' | 'fixed48x112' | 'fixed48x120' | 'fixed48x128' | 'fixed48x136' | 'fixed48x144' | 'fixed48x152' | 'fixed48x160' | 'fixed48x168' | 'fixed48x176' | 'fixed48x184' | 'fixed48x192' | 'fixed48x200' | 'fixed48x208' | 'fixed56x8' | 'fixed56x16' | 'fixed56x24' | 'fixed56x32' | 'fixed56x40' | 'fixed56x48' | 'fixed56x56' | 'fixed56x64' | 'fixed56x72' | 'fixed56x80' | 'fixed56x88' | 'fixed56x96' | 'fixed56x104' | 'fixed56x112' | 'fixed56x120' | 'fixed56x128' | 'fixed56x136' | 'fixed56x144' | 'fixed56x152' | 'fixed56x160' | 'fixed56x168' | 'fixed56x176' | 'fixed56x184' | 'fixed56x192' | 'fixed56x200' | 'fixed64x8' | 'fixed64x16' | 'fixed64x24' | 'fixed64x32' | 'fixed64x40' | 'fixed64x48' | 'fixed64x56' | 'fixed64x64' | 'fixed64x72' | 'fixed64x80' | 'fixed64x88' | 'fixed64x96' | 'fixed64x104' | 'fixed64x112' | 'fixed64x120' | 'fixed64x128' | 'fixed64x136' | 'fixed64x144' | 'fixed64x152' | 'fixed64x160' | 'fixed64x168' | 'fixed64x176' | 'fixed64x184' | 'fixed64x192' | 'fixed72x8' | 'fixed72x16' | 'fixed72x24' | 'fixed72x32' | 'fixed72x40' | 'fixed72x48' | 'fixed72x56' | 'fixed72x64' | 'fixed72x72' | 'fixed72x80' | 'fixed72x88' | 'fixed72x96' | 'fixed72x104' | 'fixed72x112' | 'fixed72x120' | 'fixed72x128' | 'fixed72x136' | 'fixed72x144' | 'fixed72x152' | 'fixed72x160' | 'fixed72x168' | 'fixed72x176' | 'fixed72x184' | 'fixed80x8' | 'fixed80x16' | 'fixed80x24' | 'fixed80x32' | 'fixed80x40' | 'fixed80x48' | 'fixed80x56' | 'fixed80x64' | 'fixed80x72' | 'fixed80x80' | 'fixed80x88' | 'fixed80x96' | 'fixed80x104' | 'fixed80x112' | 'fixed80x120' | 'fixed80x128' | 'fixed80x136' | 'fixed80x144' | 'fixed80x152' | 'fixed80x160' | 'fixed80x168' | 'fixed80x176' | 'fixed88x8' | 'fixed88x16' | 'fixed88x24' | 'fixed88x32' | 'fixed88x40' | 'fixed88x48' | 'fixed88x56' | 'fixed88x64' | 'fixed88x72' | 'fixed88x80' | 'fixed88x88' | 'fixed88x96' | 'fixed88x104' | 'fixed88x112' | 'fixed88x120' | 'fixed88x128' | 'fixed88x136' | 'fixed88x144' | 'fixed88x152' | 'fixed88x160' | 'fixed88x168' | 'fixed96x8' | 'fixed96x16' | 'fixed96x24' | 'fixed96x32' | 'fixed96x40' | 'fixed96x48' | 'fixed96x56' | 'fixed96x64' | 'fixed96x72' | 'fixed96x80' | 'fixed96x88' | 'fixed96x96' | 'fixed96x104' | 'fixed96x112' | 'fixed96x120' | 'fixed96x128' | 'fixed96x136' | 'fixed96x144' | 'fixed96x152' | 'fixed96x160' | 'fixed104x8' | 'fixed104x16' | 'fixed104x24' | 'fixed104x32' | 'fixed104x40' | 'fixed104x48' | 'fixed104x56' | 'fixed104x64' | 'fixed104x72' | 'fixed104x80' | 'fixed104x88' | 'fixed104x96' | 'fixed104x104' | 'fixed104x112' | 'fixed104x120' | 'fixed104x128' | 'fixed104x136' | 'fixed104x144' | 'fixed104x152' | 'fixed112x8' | 'fixed112x16' | 'fixed112x24' | 'fixed112x32' | 'fixed112x40' | 'fixed112x48' | 'fixed112x56' | 'fixed112x64' | 'fixed112x72' | 'fixed112x80' | 'fixed112x88' | 'fixed112x96' | 'fixed112x104' | 'fixed112x112' | 'fixed112x120' | 'fixed112x128' | 'fixed112x136' | 'fixed112x144' | 'fixed120x8' | 'fixed120x16' | 'fixed120x24' | 'fixed120x32' | 'fixed120x40' | 'fixed120x48' | 'fixed120x56' | 'fixed120x64' | 'fixed120x72' | 'fixed120x80' | 'fixed120x88' | 'fixed120x96' | 'fixed120x104' | 'fixed120x112' | 'fixed120x120' | 'fixed120x128' | 'fixed120x136' | 'fixed128x8' | 'fixed128x16' | 'fixed128x24' | 'fixed128x32' | 'fixed128x40' | 'fixed128x48' | 'fixed128x56' | 'fixed128x64' | 'fixed128x72' | 'fixed128x80' | 'fixed128x88' | 'fixed128x96' | 'fixed128x104' | 'fixed128x112' | 'fixed128x120' | 'fixed128x128' | 'fixed136x8' | 'fixed136x16' | 'fixed136x24' | 'fixed136x32' | 'fixed136x40' | 'fixed136x48' | 'fixed136x56' | 'fixed136x64' | 'fixed136x72' | 'fixed136x80' | 'fixed136x88' | 'fixed136x96' | 'fixed136x104' | 'fixed136x112' | 'fixed136x120' | 'fixed144x8' | 'fixed144x16' | 'fixed144x24' | 'fixed144x32' | 'fixed144x40' | 'fixed144x48' | 'fixed144x56' | 'fixed144x64' | 'fixed144x72' | 'fixed144x80' | 'fixed144x88' | 'fixed144x96' | 'fixed144x104' | 'fixed144x112' | 'fixed152x8' | 'fixed152x16' | 'fixed152x24' | 'fixed152x32' | 'fixed152x40' | 'fixed152x48' | 'fixed152x56' | 'fixed152x64' | 'fixed152x72' | 'fixed152x80' | 'fixed152x88' | 'fixed152x96' | 'fixed152x104' | 'fixed160x8' | 'fixed160x16' | 'fixed160x24' | 'fixed160x32' | 'fixed160x40' | 'fixed160x48' | 'fixed160x56' | 'fixed160x64' | 'fixed160x72' | 'fixed160x80' | 'fixed160x88' | 'fixed160x96' | 'fixed168x8' | 'fixed168x16' | 'fixed168x24' | 'fixed168x32' | 'fixed168x40' | 'fixed168x48' | 'fixed168x56' | 'fixed168x64' | 'fixed168x72' | 'fixed168x80' | 'fixed168x88' | 'fixed176x8' | 'fixed176x16' | 'fixed176x24' | 'fixed176x32' | 'fixed176x40' | 'fixed176x48' | 'fixed176x56' | 'fixed176x64' | 'fixed176x72' | 'fixed176x80' | 'fixed184x8' | 'fixed184x16' | 'fixed184x24' | 'fixed184x32' | 'fixed184x40' | 'fixed184x48' | 'fixed184x56' | 'fixed184x64' | 'fixed184x72' | 'fixed192x8' | 'fixed192x16' | 'fixed192x24' | 'fixed192x32' | 'fixed192x40' | 'fixed192x48' | 'fixed192x56' | 'fixed192x64' | 'fixed200x8' | 'fixed200x16' | 'fixed200x24' | 'fixed200x32' | 'fixed200x40' | 'fixed200x48' | 'fixed200x56' | 'fixed208x8' | 'fixed208x16' | 'fixed208x24' | 'fixed208x32' | 'fixed208x40' | 'fixed208x48' | 'fixed216x8' | 'fixed216x16' | 'fixed216x24' | 'fixed216x32' | 'fixed216x40' | 'fixed224x8' | 'fixed224x16' | 'fixed224x24' | 'fixed224x32' | 'fixed232x8' | 'fixed232x16' | 'fixed232x24' | 'fixed240x8' | 'fixed240x16' | 'fixed248x8'

Ufixed = 'ufixed' | 'ufixed0x8' | 'ufixed0x16' | 'ufixed0x24' | 'ufixed0x32' | 'ufixed0x40' | 'ufixed0x48' | 'ufixed0x56' | 'ufixed0x64' | 'ufixed0x72' | 'ufixed0x80' | 'ufixed0x88' | 'ufixed0x96' | 'ufixed0x104' | 'ufixed0x112' | 'ufixed0x120' | 'ufixed0x128' | 'ufixed0x136' | 'ufixed0x144' | 'ufixed0x152' | 'ufixed0x160' | 'ufixed0x168' | 'ufixed0x176' | 'ufixed0x184' | 'ufixed0x192' | 'ufixed0x200' | 'ufixed0x208' | 'ufixed0x216' | 'ufixed0x224' | 'ufixed0x232' | 'ufixed0x240' | 'ufixed0x248' | 'ufixed0x256' | 'ufixed8x8' | 'ufixed8x16' | 'ufixed8x24' | 'ufixed8x32' | 'ufixed8x40' | 'ufixed8x48' | 'ufixed8x56' | 'ufixed8x64' | 'ufixed8x72' | 'ufixed8x80' | 'ufixed8x88' | 'ufixed8x96' | 'ufixed8x104' | 'ufixed8x112' | 'ufixed8x120' | 'ufixed8x128' | 'ufixed8x136' | 'ufixed8x144' | 'ufixed8x152' | 'ufixed8x160' | 'ufixed8x168' | 'ufixed8x176' | 'ufixed8x184' | 'ufixed8x192' | 'ufixed8x200' | 'ufixed8x208' | 'ufixed8x216' | 'ufixed8x224' | 'ufixed8x232' | 'ufixed8x240' | 'ufixed8x248' | 'ufixed16x8' | 'ufixed16x16' | 'ufixed16x24' | 'ufixed16x32' | 'ufixed16x40' | 'ufixed16x48' | 'ufixed16x56' | 'ufixed16x64' | 'ufixed16x72' | 'ufixed16x80' | 'ufixed16x88' | 'ufixed16x96' | 'ufixed16x104' | 'ufixed16x112' | 'ufixed16x120' | 'ufixed16x128' | 'ufixed16x136' | 'ufixed16x144' | 'ufixed16x152' | 'ufixed16x160' | 'ufixed16x168' | 'ufixed16x176' | 'ufixed16x184' | 'ufixed16x192' | 'ufixed16x200' | 'ufixed16x208' | 'ufixed16x216' | 'ufixed16x224' | 'ufixed16x232' | 'ufixed16x240' | 'ufixed24x8' | 'ufixed24x16' | 'ufixed24x24' | 'ufixed24x32' | 'ufixed24x40' | 'ufixed24x48' | 'ufixed24x56' | 'ufixed24x64' | 'ufixed24x72' | 'ufixed24x80' | 'ufixed24x88' | 'ufixed24x96' | 'ufixed24x104' | 'ufixed24x112' | 'ufixed24x120' | 'ufixed24x128' | 'ufixed24x136' | 'ufixed24x144' | 'ufixed24x152' | 'ufixed24x160' | 'ufixed24x168' | 'ufixed24x176' | 'ufixed24x184' | 'ufixed24x192' | 'ufixed24x200' | 'ufixed24x208' | 'ufixed24x216' | 'ufixed24x224' | 'ufixed24x232' | 'ufixed32x8' | 'ufixed32x16' | 'ufixed32x24' | 'ufixed32x32' | 'ufixed32x40' | 'ufixed32x48' | 'ufixed32x56' | 'ufixed32x64' | 'ufixed32x72' | 'ufixed32x80' | 'ufixed32x88' | 'ufixed32x96' | 'ufixed32x104' | 'ufixed32x112' | 'ufixed32x120' | 'ufixed32x128' | 'ufixed32x136' | 'ufixed32x144' | 'ufixed32x152' | 'ufixed32x160' | 'ufixed32x168' | 'ufixed32x176' | 'ufixed32x184' | 'ufixed32x192' | 'ufixed32x200' | 'ufixed32x208' | 'ufixed32x216' | 'ufixed32x224' | 'ufixed40x8' | 'ufixed40x16' | 'ufixed40x24' | 'ufixed40x32' | 'ufixed40x40' | 'ufixed40x48' | 'ufixed40x56' | 'ufixed40x64' | 'ufixed40x72' | 'ufixed40x80' | 'ufixed40x88' | 'ufixed40x96' | 'ufixed40x104' | 'ufixed40x112' | 'ufixed40x120' | 'ufixed40x128' | 'ufixed40x136' | 'ufixed40x144' | 'ufixed40x152' | 'ufixed40x160' | 'ufixed40x168' | 'ufixed40x176' | 'ufixed40x184' | 'ufixed40x192' | 'ufixed40x200' | 'ufixed40x208' | 'ufixed40x216' | 'ufixed48x8' | 'ufixed48x16' | 'ufixed48x24' | 'ufixed48x32' | 'ufixed48x40' | 'ufixed48x48' | 'ufixed48x56' | 'ufixed48x64' | 'ufixed48x72' | 'ufixed48x80' | 'ufixed48x88' | 'ufixed48x96' | 'ufixed48x104' | 'ufixed48x112' | 'ufixed48x120' | 'ufixed48x128' | 'ufixed48x136' | 'ufixed48x144' | 'ufixed48x152' | 'ufixed48x160' | 'ufixed48x168' | 'ufixed48x176' | 'ufixed48x184' | 'ufixed48x192' | 'ufixed48x200' | 'ufixed48x208' | 'ufixed56x8' | 'ufixed56x16' | 'ufixed56x24' | 'ufixed56x32' | 'ufixed56x40' | 'ufixed56x48' | 'ufixed56x56' | 'ufixed56x64' | 'ufixed56x72' | 'ufixed56x80' | 'ufixed56x88' | 'ufixed56x96' | 'ufixed56x104' | 'ufixed56x112' | 'ufixed56x120' | 'ufixed56x128' | 'ufixed56x136' | 'ufixed56x144' | 'ufixed56x152' | 'ufixed56x160' | 'ufixed56x168' | 'ufixed56x176' | 'ufixed56x184' | 'ufixed56x192' | 'ufixed56x200' | 'ufixed64x8' | 'ufixed64x16' | 'ufixed64x24' | 'ufixed64x32' | 'ufixed64x40' | 'ufixed64x48' | 'ufixed64x56' | 'ufixed64x64' | 'ufixed64x72' | 'ufixed64x80' | 'ufixed64x88' | 'ufixed64x96' | 'ufixed64x104' | 'ufixed64x112' | 'ufixed64x120' | 'ufixed64x128' | 'ufixed64x136' | 'ufixed64x144' | 'ufixed64x152' | 'ufixed64x160' | 'ufixed64x168' | 'ufixed64x176' | 'ufixed64x184' | 'ufixed64x192' | 'ufixed72x8' | 'ufixed72x16' | 'ufixed72x24' | 'ufixed72x32' | 'ufixed72x40' | 'ufixed72x48' | 'ufixed72x56' | 'ufixed72x64' | 'ufixed72x72' | 'ufixed72x80' | 'ufixed72x88' | 'ufixed72x96' | 'ufixed72x104' | 'ufixed72x112' | 'ufixed72x120' | 'ufixed72x128' | 'ufixed72x136' | 'ufixed72x144' | 'ufixed72x152' | 'ufixed72x160' | 'ufixed72x168' | 'ufixed72x176' | 'ufixed72x184' | 'ufixed80x8' | 'ufixed80x16' | 'ufixed80x24' | 'ufixed80x32' | 'ufixed80x40' | 'ufixed80x48' | 'ufixed80x56' | 'ufixed80x64' | 'ufixed80x72' | 'ufixed80x80' | 'ufixed80x88' | 'ufixed80x96' | 'ufixed80x104' | 'ufixed80x112' | 'ufixed80x120' | 'ufixed80x128' | 'ufixed80x136' | 'ufixed80x144' | 'ufixed80x152' | 'ufixed80x160' | 'ufixed80x168' | 'ufixed80x176' | 'ufixed88x8' | 'ufixed88x16' | 'ufixed88x24' | 'ufixed88x32' | 'ufixed88x40' | 'ufixed88x48' | 'ufixed88x56' | 'ufixed88x64' | 'ufixed88x72' | 'ufixed88x80' | 'ufixed88x88' | 'ufixed88x96' | 'ufixed88x104' | 'ufixed88x112' | 'ufixed88x120' | 'ufixed88x128' | 'ufixed88x136' | 'ufixed88x144' | 'ufixed88x152' | 'ufixed88x160' | 'ufixed88x168' | 'ufixed96x8' | 'ufixed96x16' | 'ufixed96x24' | 'ufixed96x32' | 'ufixed96x40' | 'ufixed96x48' | 'ufixed96x56' | 'ufixed96x64' | 'ufixed96x72' | 'ufixed96x80' | 'ufixed96x88' | 'ufixed96x96' | 'ufixed96x104' | 'ufixed96x112' | 'ufixed96x120' | 'ufixed96x128' | 'ufixed96x136' | 'ufixed96x144' | 'ufixed96x152' | 'ufixed96x160' | 'ufixed104x8' | 'ufixed104x16' | 'ufixed104x24' | 'ufixed104x32' | 'ufixed104x40' | 'ufixed104x48' | 'ufixed104x56' | 'ufixed104x64' | 'ufixed104x72' | 'ufixed104x80' | 'ufixed104x88' | 'ufixed104x96' | 'ufixed104x104' | 'ufixed104x112' | 'ufixed104x120' | 'ufixed104x128' | 'ufixed104x136' | 'ufixed104x144' | 'ufixed104x152' | 'ufixed112x8' | 'ufixed112x16' | 'ufixed112x24' | 'ufixed112x32' | 'ufixed112x40' | 'ufixed112x48' | 'ufixed112x56' | 'ufixed112x64' | 'ufixed112x72' | 'ufixed112x80' | 'ufixed112x88' | 'ufixed112x96' | 'ufixed112x104' | 'ufixed112x112' | 'ufixed112x120' | 'ufixed112x128' | 'ufixed112x136' | 'ufixed112x144' | 'ufixed120x8' | 'ufixed120x16' | 'ufixed120x24' | 'ufixed120x32' | 'ufixed120x40' | 'ufixed120x48' | 'ufixed120x56' | 'ufixed120x64' | 'ufixed120x72' | 'ufixed120x80' | 'ufixed120x88' | 'ufixed120x96' | 'ufixed120x104' | 'ufixed120x112' | 'ufixed120x120' | 'ufixed120x128' | 'ufixed120x136' | 'ufixed128x8' | 'ufixed128x16' | 'ufixed128x24' | 'ufixed128x32' | 'ufixed128x40' | 'ufixed128x48' | 'ufixed128x56' | 'ufixed128x64' | 'ufixed128x72' | 'ufixed128x80' | 'ufixed128x88' | 'ufixed128x96' | 'ufixed128x104' | 'ufixed128x112' | 'ufixed128x120' | 'ufixed128x128' | 'ufixed136x8' | 'ufixed136x16' | 'ufixed136x24' | 'ufixed136x32' | 'ufixed136x40' | 'ufixed136x48' | 'ufixed136x56' | 'ufixed136x64' | 'ufixed136x72' | 'ufixed136x80' | 'ufixed136x88' | 'ufixed136x96' | 'ufixed136x104' | 'ufixed136x112' | 'ufixed136x120' | 'ufixed144x8' | 'ufixed144x16' | 'ufixed144x24' | 'ufixed144x32' | 'ufixed144x40' | 'ufixed144x48' | 'ufixed144x56' | 'ufixed144x64' | 'ufixed144x72' | 'ufixed144x80' | 'ufixed144x88' | 'ufixed144x96' | 'ufixed144x104' | 'ufixed144x112' | 'ufixed152x8' | 'ufixed152x16' | 'ufixed152x24' | 'ufixed152x32' | 'ufixed152x40' | 'ufixed152x48' | 'ufixed152x56' | 'ufixed152x64' | 'ufixed152x72' | 'ufixed152x80' | 'ufixed152x88' | 'ufixed152x96' | 'ufixed152x104' | 'ufixed160x8' | 'ufixed160x16' | 'ufixed160x24' | 'ufixed160x32' | 'ufixed160x40' | 'ufixed160x48' | 'ufixed160x56' | 'ufixed160x64' | 'ufixed160x72' | 'ufixed160x80' | 'ufixed160x88' | 'ufixed160x96' | 'ufixed168x8' | 'ufixed168x16' | 'ufixed168x24' | 'ufixed168x32' | 'ufixed168x40' | 'ufixed168x48' | 'ufixed168x56' | 'ufixed168x64' | 'ufixed168x72' | 'ufixed168x80' | 'ufixed168x88' | 'ufixed176x8' | 'ufixed176x16' | 'ufixed176x24' | 'ufixed176x32' | 'ufixed176x40' | 'ufixed176x48' | 'ufixed176x56' | 'ufixed176x64' | 'ufixed176x72' | 'ufixed176x80' | 'ufixed184x8' | 'ufixed184x16' | 'ufixed184x24' | 'ufixed184x32' | 'ufixed184x40' | 'ufixed184x48' | 'ufixed184x56' | 'ufixed184x64' | 'ufixed184x72' | 'ufixed192x8' | 'ufixed192x16' | 'ufixed192x24' | 'ufixed192x32' | 'ufixed192x40' | 'ufixed192x48' | 'ufixed192x56' | 'ufixed192x64' | 'ufixed200x8' | 'ufixed200x16' | 'ufixed200x24' | 'ufixed200x32' | 'ufixed200x40' | 'ufixed200x48' | 'ufixed200x56' | 'ufixed208x8' | 'ufixed208x16' | 'ufixed208x24' | 'ufixed208x32' | 'ufixed208x40' | 'ufixed208x48' | 'ufixed216x8' | 'ufixed216x16' | 'ufixed216x24' | 'ufixed216x32' | 'ufixed216x40' | 'ufixed224x8' | 'ufixed224x16' | 'ufixed224x24' | 'ufixed224x32' | 'ufixed232x8' | 'ufixed232x16' | 'ufixed232x24' | 'ufixed240x8' | 'ufixed240x16' | 'ufixed248x8'

InlineAssemblyBlock = '{' AssemblyItem* '}'

AssemblyItem = Identifier | FunctionalAssemblyExpression | InlineAssemblyBlock | AssemblyLocalBinding | AssemblyAssignment | AssemblyLabel | NumberLiteral | StringLiteral | HexLiteral
AssemblyLocalBinding = 'let' Identifier ':=' FunctionalAssemblyExpression
AssemblyAssignment = ( Identifier ':=' FunctionalAssemblyExpression ) | ( '=:' Identifier )
AssemblyLabel = Identifier ':'
FunctionalAssemblyExpression = Identifier '(' AssemblyItem? ( ',' AssemblyItem )* ')'
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容