Class: HeadMusic::Notation::ABC::BodyLexer::Token
- Inherits:
-
Data
- Object
- Data
- HeadMusic::Notation::ABC::BodyLexer::Token
- Defined in:
- lib/head_music/notation/abc/body_lexer.rb
Overview
One struct type for all tokens keeps the parser’s pattern matching simple; fields that don’t apply to a token type are nil.
Instance Attribute Summary collapse
-
#accidental ⇒ Object
readonly
Returns the value of attribute accidental.
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#letter ⇒ Object
readonly
Returns the value of attribute letter.
-
#lexeme ⇒ Object
readonly
Returns the value of attribute lexeme.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#octave_marks ⇒ Object
readonly
Returns the value of attribute octave_marks.
-
#passes ⇒ Object
readonly
Returns the value of attribute passes.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#voice_id ⇒ Object
readonly
Returns the value of attribute voice_id.
Instance Method Summary collapse
-
#initialize(type:, line:, column:, letter: nil, accidental: nil, octave_marks: nil, length: nil, style: nil, passes: nil, direction: nil, voice_id: nil, lexeme: nil) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(type:, line:, column:, letter: nil, accidental: nil, octave_marks: nil, length: nil, style: nil, passes: nil, direction: nil, voice_id: nil, lexeme: nil) ⇒ Token
Returns a new instance of Token.
17 18 19 20 21 22 23 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 17 def initialize( type:, line:, column:, letter: nil, accidental: nil, octave_marks: nil, length: nil, style: nil, passes: nil, direction: nil, voice_id: nil, lexeme: nil ) super end |
Instance Attribute Details
#accidental ⇒ Object (readonly)
Returns the value of attribute accidental
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def accidental @accidental end |
#column ⇒ Object (readonly)
Returns the value of attribute column
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def column @column end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def direction @direction end |
#length ⇒ Object (readonly)
Returns the value of attribute length
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def length @length end |
#letter ⇒ Object (readonly)
Returns the value of attribute letter
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def letter @letter end |
#lexeme ⇒ Object (readonly)
Returns the value of attribute lexeme
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def lexeme @lexeme end |
#line ⇒ Object (readonly)
Returns the value of attribute line
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def line @line end |
#octave_marks ⇒ Object (readonly)
Returns the value of attribute octave_marks
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def octave_marks @octave_marks end |
#passes ⇒ Object (readonly)
Returns the value of attribute passes
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def passes @passes end |
#style ⇒ Object (readonly)
Returns the value of attribute style
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def style @style end |
#type ⇒ Object (readonly)
Returns the value of attribute type
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def type @type end |
#voice_id ⇒ Object (readonly)
Returns the value of attribute voice_id
12 13 14 |
# File 'lib/head_music/notation/abc/body_lexer.rb', line 12 def voice_id @voice_id end |