Package org.staccato

Class IVLSubparser

java.lang.Object
org.staccato.IVLSubparser
All Implemented Interfaces:
Subparser

public class IVLSubparser extends Object implements Subparser
Parses Instrument, Voice, and Layer tokens. Each has values that are parsed as bytes.
Author:
David Koelle (dkoelle@gmail.com)
  • Field Details

  • Constructor Details

    • IVLSubparser

      public IVLSubparser()
  • Method Details

    • getInstance

      public static IVLSubparser getInstance()
    • matches

      public boolean matches(String music)
      Description copied from interface: Subparser
      Indicates whether the subparser should be responsible for parsing the given music string.
      Specified by:
      matches in interface Subparser
      Parameters:
      music - The Staccato music string to consider
      Returns:
      true if this subparser will accept the music string, false otherwise
    • getTokenType

      public Token.TokenType getTokenType(String tokenString)
      Description copied from interface: Subparser
      Asks the subparser to provide a TokenType for the given token.
      Specified by:
      getTokenType in interface Subparser
      Parameters:
      tokenString - The Staccato token to map to a type
    • parse

      public int parse(String music, StaccatoParserContext context)
      Description copied from interface: Subparser
      Parses the given music string.
      Specified by:
      parse in interface Subparser
      Parameters:
      music - The Staccato music string to parse
      context -
      Returns:
      index Updated parsing index into the Staccato music string.
    • getValue

      public byte getValue(String ivl, StaccatoParserContext context)
      Given a string like "V0" or "I[Piano]", this method will return the value of the token
    • populateContext

      public static void populateContext(StaccatoParserContext context)