Module: BOAST::Arithmetic

Included in:
Expression, FuncCall, Ternary, Variable
Defined in:
lib/BOAST/Arithmetic.rb

Instance Method Summary collapse

Instance Method Details

#!Object



8
9
10
# File 'lib/BOAST/Arithmetic.rb', line 8

def !
  return Expression::new(Not,nil,self)
end

#!=(x) ⇒ Object



16
17
18
# File 'lib/BOAST/Arithmetic.rb', line 16

def !=(x)
  return Expression::new(Different,self,x)
end

#*(x) ⇒ Object



44
45
46
# File 'lib/BOAST/Arithmetic.rb', line 44

def *(x)
  return Expression::new(Multiplication,self,x)
end

#+(x) ⇒ Object



36
37
38
# File 'lib/BOAST/Arithmetic.rb', line 36

def +(x)
  return Expression::new(Addition,self,x)
end

#-(x) ⇒ Object



40
41
42
# File 'lib/BOAST/Arithmetic.rb', line 40

def -(x)
  return Expression::new(Substraction,self,x)
end

#-@Object



52
53
54
# File 'lib/BOAST/Arithmetic.rb', line 52

def -@
  return Expression::new(Minus,nil,self)
end

#/(x) ⇒ Object



48
49
50
# File 'lib/BOAST/Arithmetic.rb', line 48

def /(x)
  return Expression::new(Division,self,x)
end

#<(x) ⇒ Object



24
25
26
# File 'lib/BOAST/Arithmetic.rb', line 24

def <(x)
  return Expression::new("<",self,x)
end

#<=(x) ⇒ Object



32
33
34
# File 'lib/BOAST/Arithmetic.rb', line 32

def <=(x)
  return Expression::new("<=",self,x)
end

#==(x) ⇒ Object



12
13
14
# File 'lib/BOAST/Arithmetic.rb', line 12

def ==(x)
  return Expression::new("==",self,x)
end

#===(x) ⇒ Object



4
5
6
# File 'lib/BOAST/Arithmetic.rb', line 4

def ===(x)
  return Expression::new(Affectation,self,x)
end

#>(x) ⇒ Object



20
21
22
# File 'lib/BOAST/Arithmetic.rb', line 20

def >(x)
  return Expression::new(">",self,x)
end

#>=(x) ⇒ Object



28
29
30
# File 'lib/BOAST/Arithmetic.rb', line 28

def >=(x)
  return Expression::new(">=",self,x)
end

#addressObject



56
57
58
# File 'lib/BOAST/Arithmetic.rb', line 56

def address
  return Expression::new("&",nil,self)
end

#and(x) ⇒ Object



64
65
66
# File 'lib/BOAST/Arithmetic.rb', line 64

def and(x)
  return Expression::new("&&", self, x)
end

#components(range) ⇒ Object



72
73
74
75
76
77
78
79
# File 'lib/BOAST/Arithmetic.rb', line 72

def components( range )
  if self.type.vector_length == 1
    return self
  else
    existing_set = [*('0'..'9'),*('a'..'z')].first(self.type.vector_length)
    eval "self.s#{existing_set[range].join("")}"
  end
end

#dereferenceObject



60
61
62
# File 'lib/BOAST/Arithmetic.rb', line 60

def dereference
  return Expression::new("*",nil,self)
end

#or(x) ⇒ Object



68
69
70
# File 'lib/BOAST/Arithmetic.rb', line 68

def or(x)
  return Expression::new("||", self, x)
end