Class: Xcode::Project::Config::IOScanner

Inherits:
Object
  • Object
show all
Defined in:
lib/xcode/project/config/io_scanner.rb

Constant Summary collapse

TOKENS =
[ ?}, ?=, ?;, ?{, ?( ].freeze
DELIMS =
[ ?), ?, ].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ IOScanner

Returns a new instance of IOScanner.



10
11
12
# File 'lib/xcode/project/config/io_scanner.rb', line 10

def initialize(io)
  @io = io
end

Instance Attribute Details

#termObject (readonly)

Returns the value of attribute term.



8
9
10
# File 'lib/xcode/project/config/io_scanner.rb', line 8

def term
  @term
end

Instance Method Details

#delimitObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/xcode/project/config/io_scanner.rb', line 25

def delimit
  @term = ''

  while c = @io.getc
    return c if DELIMS.include? c
    term << c
  end

  return nil
end

#tokenizeObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/xcode/project/config/io_scanner.rb', line 14

def tokenize
  @term = ''

  while c = @io.getc
    return c if TOKENS.include? c
    term << c
  end

  return nil
end