Class: HeadMusic::Notation::ABC::Token
- Inherits:
-
Data
- Object
- Data
- HeadMusic::Notation::ABC::Token
- Defined in:
- lib/head_music/notation/abc/token.rb
Overview
One lexed unit of a tune body.
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.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#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, notes: 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, notes: nil) ⇒ Token
Returns a new instance of Token.
12 13 14 15 16 17 18 19 |
# File 'lib/head_music/notation/abc/token.rb', line 12 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, notes: nil ) super end |
Instance Attribute Details
#accidental ⇒ Object (readonly)
Returns the value of attribute accidental
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def accidental @accidental end |
#column ⇒ Object (readonly)
Returns the value of attribute column
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def column @column end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def direction @direction end |
#length ⇒ Object (readonly)
Returns the value of attribute length
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def length @length end |
#letter ⇒ Object (readonly)
Returns the value of attribute letter
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def letter @letter end |
#lexeme ⇒ Object (readonly)
Returns the value of attribute lexeme
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def lexeme @lexeme end |
#line ⇒ Object (readonly)
Returns the value of attribute line
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def line @line end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def notes @notes end |
#octave_marks ⇒ Object (readonly)
Returns the value of attribute octave_marks
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def octave_marks @octave_marks end |
#passes ⇒ Object (readonly)
Returns the value of attribute passes
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def passes @passes end |
#style ⇒ Object (readonly)
Returns the value of attribute style
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def style @style end |
#type ⇒ Object (readonly)
Returns the value of attribute type
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def type @type end |
#voice_id ⇒ Object (readonly)
Returns the value of attribute voice_id
7 8 9 |
# File 'lib/head_music/notation/abc/token.rb', line 7 def voice_id @voice_id end |