Package org.staccato

Class FunctionSubparser

  • All Implemented Interfaces:
    Subparser

    public class FunctionSubparser
    extends java.lang.Object
    implements Subparser
    • Constructor Detail

      • FunctionSubparser

        public FunctionSubparser()
    • Method Detail

      • matches

        public boolean matches​(java.lang.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​(java.lang.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​(java.lang.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
        Returns:
        index Updated parsing index into the Staccato music string.
      • generateFunctionCall

        public static java.lang.String generateFunctionCall​(java.lang.String functionName,
                                                            java.lang.Object val)
      • generateFunctionCall

        public static java.lang.String generateFunctionCall​(java.lang.String functionName,
                                                            byte... vals)
      • generateParenParamIfNecessary

        public static java.lang.String generateParenParamIfNecessary​(java.lang.String functionId,
                                                                     java.lang.String value)