Package org.staccato
Interface Subparser
- All Known Implementing Classes:
AtomSubparser
,BarLineSubparser
,BeatTimeSubparser
,FunctionSubparser
,IVLSubparser
,LyricMarkerSubparser
,NoteSubparser
,SignatureSubparser
,TempoSubparser
,WhitespaceConsumer
public interface Subparser
This makes it easy to extend the parser.
- Author:
- David Koelle
-
Method Summary
Modifier and TypeMethodDescriptiongetTokenType
(String tokenString) Asks the subparser to provide a TokenType for the given token.boolean
Indicates whether the subparser should be responsible for parsing the given music string.int
parse
(String music, StaccatoParserContext context) Parses the given music string.
-
Method Details
-
matches
Indicates whether the subparser should be responsible for parsing the given music string.- Parameters:
music
- The Staccato music string to consider- Returns:
- true if this subparser will accept the music string, false otherwise
-
getTokenType
Asks the subparser to provide a TokenType for the given token.- Parameters:
tokenString
- The Staccato token to map to a type
-
parse
Parses the given music string.- Parameters:
music
- The Staccato music string to parsecontext
-packet
-- Returns:
- index Updated parsing index into the Staccato music string.
-