Class: Flowckerc::SymTable

Inherits:
Object
  • Object
show all
Defined in:
lib/flowckerc.rb

Instance Method Summary collapse

Constructor Details

#initializeSymTable

Returns a new instance of SymTable.



30
31
32
# File 'lib/flowckerc.rb', line 30

def initialize
  @table = {}
end

Instance Method Details

#add(sym, value) ⇒ Object



34
35
36
# File 'lib/flowckerc.rb', line 34

def add sym, value
  @table[sym] = value
end

#getId(sym) ⇒ Object



38
39
40
# File 'lib/flowckerc.rb', line 38

def getId sym
  @table[sym].id
end

#isAtom(sym) ⇒ Object



46
47
48
# File 'lib/flowckerc.rb', line 46

def isAtom sym
  @table[sym].is_a? Atom
end

#isSolutionObject



50
51
52
# File 'lib/flowckerc.rb', line 50

def isSolution
  @table[sym].is_a? FormulaSolution
end

#value(sym) ⇒ Object



42
43
44
# File 'lib/flowckerc.rb', line 42

def value sym
  @table[sym]
end