Class: BOAST::FuncCall
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#func_name ⇒ Object
readonly
Returns the value of attribute func_name.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
Class Method Summary collapse
Instance Method Summary collapse
- #*(x) ⇒ Object
- #+(x) ⇒ Object
- #-(x) ⇒ Object
- #-@ ⇒ Object
- #/(x) ⇒ Object
- #==(x) ⇒ Object
- #[](*args) ⇒ Object
-
#initialize(func_name, *args) ⇒ FuncCall
constructor
A new instance of FuncCall.
- #print(final = true) ⇒ Object
- #to_s ⇒ Object
- #to_str ⇒ Object
- #to_str_c ⇒ Object
- #to_str_fortran ⇒ Object
- #to_var ⇒ Object
Constructor Details
#initialize(func_name, *args) ⇒ FuncCall
Returns a new instance of FuncCall.
1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 |
# File 'lib/BOAST/Algorithm.rb', line 1273 def initialize(func_name, *args) @func_name = func_name if args.last.kind_of?(Hash) then @options = args.last @args = args[0..-2] else @args = args end @return_type = @options[:returns] if @options end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
1270 1271 1272 |
# File 'lib/BOAST/Algorithm.rb', line 1270 def args @args end |
#func_name ⇒ Object (readonly)
Returns the value of attribute func_name.
1269 1270 1271 |
# File 'lib/BOAST/Algorithm.rb', line 1269 def func_name @func_name end |
#prefix ⇒ Object
Returns the value of attribute prefix.
1271 1272 1273 |
# File 'lib/BOAST/Algorithm.rb', line 1271 def prefix @prefix end |
Class Method Details
.parens(*args, &block) ⇒ Object
1265 1266 1267 |
# File 'lib/BOAST/Algorithm.rb', line 1265 def self.parens(*args,&block) return self::new(*args,&block) end |
Instance Method Details
#*(x) ⇒ Object
1307 1308 1309 |
# File 'lib/BOAST/Algorithm.rb', line 1307 def *(x) return Expression::new("*",self,x) end |
#+(x) ⇒ Object
1303 1304 1305 |
# File 'lib/BOAST/Algorithm.rb', line 1303 def +(x) return Expression::new("+",self,x) end |
#-(x) ⇒ Object
1315 1316 1317 |
# File 'lib/BOAST/Algorithm.rb', line 1315 def -(x) return Expression::new("-",self,x) end |
#-@ ⇒ Object
1319 1320 1321 |
# File 'lib/BOAST/Algorithm.rb', line 1319 def -@ return Expression::new("-",nil,self) end |
#/(x) ⇒ Object
1311 1312 1313 |
# File 'lib/BOAST/Algorithm.rb', line 1311 def /(x) return Expression::new("/",self,x) end |
#==(x) ⇒ Object
1299 1300 1301 |
# File 'lib/BOAST/Algorithm.rb', line 1299 def ==(x) return Expression::new("==",self,x) end |
#[](*args) ⇒ Object
1323 1324 1325 |
# File 'lib/BOAST/Algorithm.rb', line 1323 def [](*args) return Index::new(self,args) end |
#print(final = true) ⇒ Object
1342 1343 1344 1345 1346 1347 1348 1349 |
# File 'lib/BOAST/Algorithm.rb', line 1342 def print(final=true) s="" s += " "*BOAST::get_indent_level if final s += self.to_str s += ";" if final and [C, CL, CUDA].include?( BOAST::get_lang ) BOAST::get_output.puts s if final return s end |
#to_s ⇒ Object
1295 1296 1297 |
# File 'lib/BOAST/Algorithm.rb', line 1295 def to_s self.to_str end |
#to_str ⇒ Object
1328 1329 1330 1331 |
# File 'lib/BOAST/Algorithm.rb', line 1328 def to_str return self.to_str_fortran if BOAST::get_lang == FORTRAN return self.to_str_c if [C, CL, CUDA].include?( BOAST::get_lang ) end |
#to_str_c ⇒ Object
1337 1338 1339 1340 1341 |
# File 'lib/BOAST/Algorithm.rb', line 1337 def to_str_c s = "" s += @prefix if @prefix s += "#{func_name}(#{@args.join(", ")})" end |
#to_str_fortran ⇒ Object
1332 1333 1334 1335 1336 |
# File 'lib/BOAST/Algorithm.rb', line 1332 def to_str_fortran s = "" s += @prefix if @prefix s += "#{func_name}(#{@args.join(", ")})" end |