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 Type
    Method
    Description
    getTokenType(String tokenString)
    Asks the subparser to provide a TokenType for the given token.
    boolean
    matches(String music)
    Indicates whether the subparser should be responsible for parsing the given music string.
    int
    Parses the given music string.
  • Method Details

    • matches

      boolean matches(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(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(String music, StaccatoParserContext context)
      Parses the given music string.
      Parameters:
      music - The Staccato music string to parse
      context -
      packet -
      Returns:
      index Updated parsing index into the Staccato music string.