Class: PHPRB::Compiler::Scanner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src, xml_mode = nil) ⇒ Scanner

Returns a new instance of Scanner.



49
50
51
52
53
# File 'lib/web/phprb.rb', line 49

def initialize(src, xml_mode=nil)
  @src = src
  @stag = nil
  @xml_mode = xml_mode
end

Instance Attribute Details

#stagObject

Returns the value of attribute stag.



54
55
56
# File 'lib/web/phprb.rb', line 54

def stag
  @stag
end

Instance Method Details

#etag_expObject



66
67
68
# File 'lib/web/phprb.rb', line 66

def etag_exp
  '(\?\?>)|(--->)|(\?>)'
end

#stag_expObject



57
58
59
60
61
62
63
64
# File 'lib/web/phprb.rb', line 57

def stag_exp
  open_pattern = if @xml_mode
                   '\?ruby'
                 else
                   '\?(ruby)?'
                 end
  '(<\?\?)|(<' + open_pattern + '=)|(<!---)|(<' + open_pattern + ')'
end