Class: BaseVal
- Inherits:
-
Node
show all
- Defined in:
- lib/tecsgen/core/value.rb
Overview
BaseVal 整数、浮動小数などの値を扱うクラスの基底クラス
TECS の CDL で扱う値は、以下に分類される ・整数 ・浮動小数 ・文字列 ・ブール値 集成型(構造体、配列)と C_EXP はここでは扱わない
このクラスで定義済みの演算子は、エラーとなる 型により演算可能な場合、演算子をオーバーライドする
Instance Method Summary
collapse
Methods inherited from Node
#cdl_error, #cdl_error2, #cdl_error3, #cdl_info, #cdl_info2, #cdl_warning, #cdl_warning2, #get_locale, #initialize, #locale_str, #set_locale
Constructor Details
This class inherits a constructor from Node
Instance Method Details
76
77
78
|
# File 'lib/tecsgen/core/value.rb', line 76
def %(val)
unsupport "%"
end
|
120
121
122
|
# File 'lib/tecsgen/core/value.rb', line 120
def &(val)
unsupport "&"
end
|
68
69
70
|
# File 'lib/tecsgen/core/value.rb', line 68
def *(val)
unsupport "*"
end
|
80
81
82
|
# File 'lib/tecsgen/core/value.rb', line 80
def +(val)
unsupport "+"
end
|
60
61
62
|
# File 'lib/tecsgen/core/value.rb', line 60
def +@
unsupport "unary +"
end
|
84
85
86
|
# File 'lib/tecsgen/core/value.rb', line 84
def -(val)
unsupport "-"
end
|
56
57
58
|
# File 'lib/tecsgen/core/value.rb', line 56
def -@
unsupport "unary -"
end
|
72
73
74
|
# File 'lib/tecsgen/core/value.rb', line 72
def /(val)
unsupport "/"
end
|
100
101
102
|
# File 'lib/tecsgen/core/value.rb', line 100
def <(val)
unsupport "<"
end
|
88
89
90
|
# File 'lib/tecsgen/core/value.rb', line 88
def <<(val)
unsupport "<<"
end
|
108
109
110
|
# File 'lib/tecsgen/core/value.rb', line 108
def <=(val)
unsupport "<="
end
|
96
97
98
|
# File 'lib/tecsgen/core/value.rb', line 96
def >(val)
unsupport ">"
end
|
104
105
106
|
# File 'lib/tecsgen/core/value.rb', line 104
def >=(val)
unsupport ">="
end
|
92
93
94
|
# File 'lib/tecsgen/core/value.rb', line 92
def >>(val)
unsupport ">>"
end
|
124
125
126
|
# File 'lib/tecsgen/core/value.rb', line 124
def ^(val)
unsupport "^"
end
|
#cast(type) ⇒ Object
140
141
142
|
# File 'lib/tecsgen/core/value.rb', line 140
def cast(type)
unsupport "CAST"
end
|
112
113
114
|
# File 'lib/tecsgen/core/value.rb', line 112
def eq(val) unsupport "=="
end
|
#lAND(val) ⇒ Object
132
133
134
|
# File 'lib/tecsgen/core/value.rb', line 132
def lAND(val) unsupport "&&"
end
|
136
137
138
|
# File 'lib/tecsgen/core/value.rb', line 136
def lOR(val) unsupport "||"
end
|
116
117
118
|
# File 'lib/tecsgen/core/value.rb', line 116
def neq(val) unsupport "!="
end
|
64
65
66
|
# File 'lib/tecsgen/core/value.rb', line 64
def not unsupport "!"
end
|
152
153
154
155
|
# File 'lib/tecsgen/core/value.rb', line 152
def to_b
cdl_error("V1002 $1: cannot cast to bool (implicitly)", self.class)
false
end
|
162
163
164
165
|
# File 'lib/tecsgen/core/value.rb', line 162
def to_f
cdl_error("V1004 $1: cannot cast to float (implicitly)", self.class)
1.0
end
|
157
158
159
160
|
# File 'lib/tecsgen/core/value.rb', line 157
def to_i
cdl_error("V1003 $1: cannot cast to integer (implicitly)", self.class)
1
end
|
148
149
150
|
# File 'lib/tecsgen/core/value.rb', line 148
def to_s
raise "to_s not overridden"
end
|
#unsupport(op) ⇒ Object
144
145
146
|
# File 'lib/tecsgen/core/value.rb', line 144
def unsupport(op)
cdl_error("V1001 $1: unable for $2", op, self.class)
end
|
128
129
130
|
# File 'lib/tecsgen/core/value.rb', line 128
def |(val)
unsupport "|"
end
|
52
53
54
|
# File 'lib/tecsgen/core/value.rb', line 52
def ~@
unsupport "~"
end
|