Class GeoRuby::SimpleFeatures::TokenizerStructure
In: lib/geo_ruby/simple_features/ewkt_parser.rb
Parent: Object

Methods

Public Class methods

[Source]

     # File lib/geo_ruby/simple_features/ewkt_parser.rb, line 293
293:       def initialize(ewkt)
294:         @ewkt = ewkt
295:         @scanner = StringScanner.new(ewkt)
296:         @regex = /\s*([\w.-]+)s*/
297:       end

Public Instance methods

[Source]

     # File lib/geo_ruby/simple_features/ewkt_parser.rb, line 316
316:       def check_next_token
317:         check = @scanner.check(@regex)
318:         if check.nil?
319:           if @scanner.eos?
320:             nil
321:           else
322:             pos = @scanner.pos
323:             while @ewkt[pos].chr == ' '
324:               pos+=1
325:             end
326:             @ewkt[pos].chr
327:           end
328:         else
329:           check
330:         end
331:       end

[Source]

     # File lib/geo_ruby/simple_features/ewkt_parser.rb, line 299
299:       def get_next_token
300:         if @scanner.scan(@regex).nil?
301:           if @scanner.eos?
302:             nil
303:           else
304:             ch = @scanner.getch
305:             while ch == ' '
306:               ch = @scanner.getch
307:             end
308:             ch
309:           end
310:         else
311:           @scanner[1]
312:         end
313:       end

[Validate]