Appearance
| 1 | namespace IR.Values is | |
| 2 | use TypeTyped = Semantic.Types.Typed; | |
| 3 | use Semantic.Types.Type; | |
| 4 | ||
| 5 | class NOT: Value is | |
| 6 | value: Value; | |
| 7 | ||
| 8 | type: Type? => value.type; | |
| 9 | is_value_type: bool => value.is_value_type; | |
| 10 | ||
| 11 | init(value: Value) is | |
| 12 | super.init(); | |
| 13 | ||
| 14 | self.value = value; | |
| 15 | si | |
| 16 | ||
| 17 | gen(context: IR.CONTEXT) is | |
| 18 | Value.gen(value, context); | |
| 19 | ||
| 20 | context.write_line("ldc.i4 0"); | |
| 21 | context.write_line("ceq"); | |
| 22 | si | |
| 23 | ||
| 24 | to_string() -> string => | |
| 25 | "not:[{type}]({value})"; | |
| 26 | si | |
| 27 | si |