class GeoRuby::SimpleFeatures::TokenizerStructure
Public Class Methods
new(ewkt)
click to toggle source
# File lib/geo_ruby/ewk/ewkt_parser.rb, line 281 def initialize(ewkt) @ewkt = ewkt @scanner = StringScanner.new(ewkt) @regex = /\s*([\w.-]+)s*/ end
Public Instance Methods
check_next_token()
click to toggle source
# File lib/geo_ruby/ewk/ewkt_parser.rb, line 303 def check_next_token check = @scanner.check(@regex) if check.nil? if @scanner.eos? nil else pos = @scanner.pos while @ewkt[pos].chr == ' ' pos += 1 end @ewkt[pos].chr end else check end end
get_next_token()
click to toggle source
# File lib/geo_ruby/ewk/ewkt_parser.rb, line 287 def get_next_token if @scanner.scan(@regex).nil? if @scanner.eos? nil else ch = @scanner.getch while ch == ' ' ch = @scanner.getch end ch end else @scanner[1] end end