Class: Rossoc::Frontend

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

Overview

Frontend rubocop:disable Metrics/ClassLength

Defined Under Namespace

Classes: FrontendError

Constant Summary collapse

RESERVED_PINS =
%w[
  din0 din1 din2 din3 din4 din5 din6 din7 din8 din9 din10
  din11 din12 din13 din14 din15 din16 din17 din18 din19 din20
  ain0 ain1 ain2 ain3 ain4 ain5 ain6 ain7 ain8 ain9 ain10
  ain11 ain12 ain13 ain14 ain15 ain16 ain17 ain18 ain19 ain20
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Frontend



19
20
21
22
23
24
25
26
27
28
# File 'lib/rossoc/frontend.rb', line 19

def initialize(input)
  @input = input
  @out_pins = Set.new
  @in_pins = Set.new
  @table = nil
  @where = nil
  @ast = nil
  @sleep_sec = 0
  @speed = 9600
end

Instance Method Details

#irObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rossoc/frontend.rb', line 30

def ir
  parser(@input)
  check_columns
  check_tables
  check_condition
  check_rsleep
  check_rspeed

  Rossoc::Ir.new(@in_pins, @out_pins, @table, @where, @ast,
                 @sleep_sec, @speed).result
end