Class: Ibex::IR::LexerRule
- Inherits:
-
Object
- Object
- Ibex::IR::LexerRule
- Defined in:
- lib/ibex/ir/lexer_ir.rb
Overview
One normalized, state-scoped lexer rule.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
: String?.
-
#id ⇒ Object
readonly
: Integer.
-
#kind ⇒ Object
readonly
: Symbol.
-
#location ⇒ Object
readonly
: location.
-
#options ⇒ Object
readonly
: String.
-
#pattern ⇒ Object
readonly
: String.
-
#pattern_kind ⇒ Object
readonly
: Symbol.
-
#state ⇒ Object
readonly
: String.
-
#token ⇒ Object
readonly
: String?.
Instance Method Summary collapse
-
#initialize(id:, state:, kind:, token:, pattern:, pattern_kind:, options:, action:, location:) ⇒ LexerRule
constructor
A new instance of LexerRule.
- #to_h ⇒ Object
Constructor Details
#initialize(id:, state:, kind:, token:, pattern:, pattern_kind:, options:, action:, location:) ⇒ LexerRule
Returns a new instance of LexerRule.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ibex/ir/lexer_ir.rb', line 22 def initialize(id:, state:, kind:, token:, pattern:, pattern_kind:, options:, action:, location:) @id = id @state = state.freeze @kind = kind @token = token&.freeze @pattern = pattern.freeze @pattern_kind = pattern_kind @options = .freeze @action = action&.freeze @location = IR.deep_freeze(location) freeze end |
Instance Attribute Details
#action ⇒ Object (readonly)
: String?
17 18 19 |
# File 'lib/ibex/ir/lexer_ir.rb', line 17 def action @action end |
#id ⇒ Object (readonly)
: Integer
10 11 12 |
# File 'lib/ibex/ir/lexer_ir.rb', line 10 def id @id end |
#kind ⇒ Object (readonly)
: Symbol
12 13 14 |
# File 'lib/ibex/ir/lexer_ir.rb', line 12 def kind @kind end |
#location ⇒ Object (readonly)
: location
18 19 20 |
# File 'lib/ibex/ir/lexer_ir.rb', line 18 def location @location end |
#options ⇒ Object (readonly)
: String
16 17 18 |
# File 'lib/ibex/ir/lexer_ir.rb', line 16 def @options end |
#pattern ⇒ Object (readonly)
: String
14 15 16 |
# File 'lib/ibex/ir/lexer_ir.rb', line 14 def pattern @pattern end |
#pattern_kind ⇒ Object (readonly)
: Symbol
15 16 17 |
# File 'lib/ibex/ir/lexer_ir.rb', line 15 def pattern_kind @pattern_kind end |
#state ⇒ Object (readonly)
: String
11 12 13 |
# File 'lib/ibex/ir/lexer_ir.rb', line 11 def state @state end |
#token ⇒ Object (readonly)
: String?
13 14 15 |
# File 'lib/ibex/ir/lexer_ir.rb', line 13 def token @token end |
Instance Method Details
#to_h ⇒ Object
36 37 38 39 40 41 |
# File 'lib/ibex/ir/lexer_ir.rb', line 36 def to_h { id: @id, state: @state, kind: @kind, token: @token, pattern: @pattern, pattern_kind: @pattern_kind, options: @options, action: @action, loc: @location } end |