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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Token.TokenType
getTokenType(java.lang.String tokenString)
Asks the subparser to provide a TokenType for the given token.boolean
matches(java.lang.String music)
Indicates whether the subparser should be responsible for parsing the given music string.int
parse(java.lang.String music, StaccatoParserContext context)
Parses the given music string.
-
-
-
Method Detail
-
matches
boolean matches(java.lang.String music)
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
Token.TokenType getTokenType(java.lang.String tokenString)
Asks the subparser to provide a TokenType for the given token.- Parameters:
tokenString
- The Staccato token to map to a type
-
parse
int parse(java.lang.String music, StaccatoParserContext context)
Parses the given music string.- Parameters:
music
- The Staccato music string to parsepacket
-context
-- Returns:
- index Updated parsing index into the Staccato music string.
-
-