Class: Whitespace::Parser

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

Constant Summary collapse

SPACE =
" "
TAB =
"\t"
LF =
"\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vm, console) ⇒ Parser

Returns a new instance of Parser.



5
6
7
8
# File 'lib/whitespace/parser.rb', line 5

def initialize(vm, console)
  @vm = vm
  @console = console
end

Instance Attribute Details

#consoleObject (readonly)

Returns the value of attribute console.



3
4
5
# File 'lib/whitespace/parser.rb', line 3

def console
  @console
end

#vmObject (readonly)

Returns the value of attribute vm.



3
4
5
# File 'lib/whitespace/parser.rb', line 3

def vm
  @vm
end

Instance Method Details

#parse(src) ⇒ Object



10
11
12
13
# File 'lib/whitespace/parser.rb', line 10

def parse(src)
  parse_init(src)
  parse_start
end