Appearance
| 1 | namespace IR.Values is | |
| 2 | use Semantic.Types.Type; | |
| 3 | ||
| 4 | class DEREF: Value is | |
| 5 | type: Type; | |
| 6 | value: Value; | |
| 7 | ||
| 8 | is_deref: bool => true; | |
| 9 | has_address: bool => true; | |
| 10 | ||
| 11 | init( | |
| 12 | value: Value, | |
| 13 | type: Type | |
| 14 | ) is | |
| 15 | super.init(); | |
| 16 | ||
| 17 | self.value = value; | |
| 18 | self.type = type; | |
| 19 | si | |
| 20 | ||
| 21 | init( | |
| 22 | value: Value | |
| 23 | ) is | |
| 24 | init(value, value.type!); | |
| 25 | si | |
| 26 | ||
| 27 | gen(context: IR.CONTEXT) is | |
| 28 | value.gen(context); | |
| 29 | context.write_line("ldobj {type.get_il_type()}"); | |
| 30 | si | |
| 31 | ||
| 32 | gen_address(context: IR.CONTEXT) is | |
| 33 | value.gen(context); | |
| 34 | si | |
| 35 | ||
| 36 | to_string() -> string => | |
| 37 | "deref:[{type}]({value})"; | |
| 38 | si | |
| 39 | si |