Class: Flott::Parser::Mode

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

Overview

The base parsing mode.

Direct Known Subclasses

RubyMode, TextMode

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ Mode

Creates a parsing mode for parser.



790
791
792
# File 'lib/flott.rb', line 790

def initialize(parser)
  @parser = parser
end

Instance Attribute Details

#parserObject (readonly)

The parser this mode belongs to.



795
796
797
# File 'lib/flott.rb', line 795

def parser
  @parser
end

Instance Method Details

#scannerObject

The parsing mode uses this StringScanner instance for it’s job, its the StringScanner of the current parser.



799
800
801
# File 'lib/flott.rb', line 799

def scanner
  @parser.scanner
end

#stateObject

A shortcut to reach the shared state of all the parsers involved in parsing the current template.



805
806
807
# File 'lib/flott.rb', line 805

def state
  @parser.state
end