Class: Lrama::Grammar::Type
- Inherits:
-
Object
- Object
- Lrama::Grammar::Type
- Defined in:
- lib/lrama/grammar/type.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
TODO: rbs-inline 0.11.0 doesn't support instance variables.
-
#tag ⇒ Object
readonly
: Lexer::Token::Tag.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id:, tag:) ⇒ Type
constructor
A new instance of Type.
Constructor Details
#initialize(id:, tag:) ⇒ Type
Returns a new instance of Type.
19 20 21 22 |
# File 'lib/lrama/grammar/type.rb', line 19 def initialize(id:, tag:) @id = id @tag = tag end |
Instance Attribute Details
#id ⇒ Object (readonly)
TODO: rbs-inline 0.11.0 doesn't support instance variables. Move these type declarations above instance variable definitions, once it's supported. see: https://github.com/soutaro/rbs-inline/pull/149
@rbs! @id: Lexer::Token::Base @tag: Lexer::Token::Tag
15 16 17 |
# File 'lib/lrama/grammar/type.rb', line 15 def id @id end |
#tag ⇒ Object (readonly)
: Lexer::Token::Tag
16 17 18 |
# File 'lib/lrama/grammar/type.rb', line 16 def tag @tag end |
Instance Method Details
#==(other) ⇒ Object
25 26 27 28 29 |
# File 'lib/lrama/grammar/type.rb', line 25 def ==(other) self.class == other.class && self.id == other.id && self.tag == other.tag end |