4 fun to_i
: Int is abstract
7 redef class ALabelValue
9 if not n_id
.labels_to_address
.has_key
(n_id
.text
) then
10 manager
.fatal_error
( self, "Label {n_id.text} used but not defined.")
13 return n_id
.labels_to_address
[n_id
.text
]
18 var labels_to_address
: HashMap[String,Int] = (once
new HashMap[String,Int])
19 #redef fun to_i: Int do return label_to_address[text]
22 redef class ANumberValue
23 redef fun to_i
do return n_number
.text
.to_i
26 redef class ACharValue
27 redef fun to_i
do return n_char
.content
.first
.code_point
30 redef class AStringValue
31 # legal but no not recommended
32 redef fun to_i
do return n_string
.content
.first
.code_point
37 redef fun to_i
do return n_hex
.text
.to_hex
40 redef class TString # TkBlock
43 return text
.substring
(1, text
.length-2
)
46 redef class TChar # TkAscii
49 return text
.substring
(1, text
.length-2
)