Class: Mkxms::Mssql::AccessObjectDefinition::Scanner
- Inherits:
-
Object
- Object
- Mkxms::Mssql::AccessObjectDefinition::Scanner
- Defined in:
- lib/mkxms/mssql/access_object_definition.rb
Instance Attribute Summary collapse
-
#last_match ⇒ Object
readonly
Returns the value of attribute last_match.
Instance Method Summary collapse
-
#initialize(dfn) ⇒ Scanner
constructor
A new instance of Scanner.
- #next_is(re) ⇒ Object
- #remaining? ⇒ Boolean
Constructor Details
#initialize(dfn) ⇒ Scanner
Returns a new instance of Scanner.
8 9 10 11 |
# File 'lib/mkxms/mssql/access_object_definition.rb', line 8 def initialize(dfn) @dfn = dfn @start = 0 end |
Instance Attribute Details
#last_match ⇒ Object (readonly)
Returns the value of attribute last_match.
13 14 15 |
# File 'lib/mkxms/mssql/access_object_definition.rb', line 13 def last_match @last_match end |
Instance Method Details
#next_is(re) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/mkxms/mssql/access_object_definition.rb', line 15 def next_is(re) if (m = re.match(@dfn, @start)) && (m.begin(0) <= @start) @start = m.end(0) return @last_match = m end end |
#remaining? ⇒ Boolean
22 23 24 |
# File 'lib/mkxms/mssql/access_object_definition.rb', line 22 def remaining? @start < @dfn.length end |