Class: Klam::Reader
Constant Summary
Primitives::Lists::EMPTY_LIST
Instance Method Summary
collapse
#arrayToList, #listToArray
#cons, #cons?, #hd, #tl
Constructor Details
#initialize(stream) ⇒ Reader
5
6
7
|
# File 'lib/klam/reader.rb', line 5
def initialize(stream)
@lexer = Klam::Lexer.new(stream)
end
|
Instance Method Details
#next ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/klam/reader.rb', line 9
def next
token = @lexer.next
unless token.nil?
if token.kind_of? Klam::Lexer::OpenParen
read_list
else
token
end
end
end
|