Class: Strling::Core::IRQuant
Overview
Represents a quantifier (repetition operator) in the IR.
Specifies how many times a pattern element should match.
Instance Attribute Summary collapse
-
#child ⇒ IROp
The child node being quantified.
-
#max ⇒ Integer, String
The maximum number of matches (“Inf” for unbounded).
-
#min ⇒ Integer
The minimum number of matches.
-
#mode ⇒ String
The quantifier mode: “Greedy”, “Lazy”, or “Possessive”.
Instance Method Summary collapse
-
#initialize(child, min, max, mode) ⇒ IRQuant
constructor
A new instance of IRQuant.
- #to_dict ⇒ Object
Constructor Details
#initialize(child, min, max, mode) ⇒ IRQuant
Returns a new instance of IRQuant.
233 234 235 236 237 238 |
# File 'lib/strling/core/ir.rb', line 233 def initialize(child, min, max, mode) @child = child @min = min @max = max @mode = mode end |
Instance Attribute Details
#child ⇒ IROp
Returns The child node being quantified.
218 219 220 |
# File 'lib/strling/core/ir.rb', line 218 def child @child end |
#max ⇒ Integer, String
Returns The maximum number of matches (“Inf” for unbounded).
224 225 226 |
# File 'lib/strling/core/ir.rb', line 224 def max @max end |
#min ⇒ Integer
Returns The minimum number of matches.
221 222 223 |
# File 'lib/strling/core/ir.rb', line 221 def min @min end |
#mode ⇒ String
Returns The quantifier mode: “Greedy”, “Lazy”, or “Possessive”.
227 228 229 |
# File 'lib/strling/core/ir.rb', line 227 def mode @mode end |
Instance Method Details
#to_dict ⇒ Object
240 241 242 243 244 245 246 247 248 |
# File 'lib/strling/core/ir.rb', line 240 def to_dict { 'ir' => 'Quant', 'child' => child.to_dict, 'min' => min, 'max' => max, 'mode' => mode } end |