semantics_specification
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
semantics_specification [2012/02/26 06:14] – [General considerations] marong | semantics_specification [2012/03/25 13:57] (current) – [Operator types] mhwang | ||
---|---|---|---|
Line 2: | Line 2: | ||
* continue和break必须在循环里(for或者while) | * continue和break必须在循环里(for或者while) | ||
* '' | * '' | ||
+ | * 不需要检查函数所有control flow末端是否都有return语句 | ||
+ | |||
====== 类型匹配 ====== | ====== 类型匹配 ====== | ||
* return的表达式类型与函数返回类型一致 | * return的表达式类型与函数返回类型一致 | ||
- | * 不需要检查函数所有control flow末端是否都有return语句 | ||
* if/ | * if/ | ||
* '' | * '' | ||
Line 19: | Line 20: | ||
^ '' | ^ '' | ||
^ '' | ^ '' | ||
- | ^ '' | + | ^ '' |
^ ::: | ::: | 字符串比较的是值而不是地址 | | ^ ::: | ::: | 字符串比较的是值而不是地址 | | ||
- | ^ ''<'', | + | ^ ''<'', |
^ ::: | ::: | 字符串按字典序比较 | | ^ ::: | ::: | 字符串按字典序比较 | | ||
^ '' | ^ '' | ||
Line 29: | Line 30: | ||
^ 加法类型表 ^^ Right-hand side |||| | ^ 加法类型表 ^^ Right-hand side |||| | ||
- | ^::: ^^ int ^ char ^ string ^ record | | + | ^::: ^^ int ^ char ^ string ^ record/ |
^ Left-hand side ^ int | int | int | string | (error) | | ^ Left-hand side ^ int | int | int | string | (error) | | ||
^ ::: ^ char | int | int | string | (error) | | ^ ::: ^ char | int | int | string | (error) | | ||
^ ::: ^ string | string | string | string | (error) | | ^ ::: ^ string | string | string | string | (error) | | ||
- | ^ ::: ^ record | (error) | (error) | (error) | (error) | | + | ^ ::: ^ record/ |
====== Native function semantics ====== | ====== Native function semantics ====== | ||
^ '' | ^ '' | ||
^ '' | ^ '' |
semantics_specification.1330236898.txt.gz · Last modified: 2012/02/26 06:14 by marong