private FlowToken finishBuiltinCommand(final BuiltinCommand command)
            throws SnuggleParseException {
        /* Make sure we can use this command in the current mode */
        if (!command.getAllowedModes().contains(currentModeState.latexMode)) {
            /* Not allowed to use this command in this mode */
            return createError(CoreErrorCode.TTEC01, startTokenIndex, position,
                    command.getTeXName(), currentModeState.latexMode);
        }
        
        /* Command and environment definitions need to be handled specifically as their structure is quite
         * specific
         */
        if (command==CorePackageDefinitions.CMD_NEWCOMMAND || command==CorePackageDefinitions.CMD_RENEWCOMMAND) {
            return finishCommandDefinition(command);
        }
        if (command==CorePackageDefinitions.CMD_NEWENVIRONMENT || command==CorePackageDefinitions.CMD_RENEWENVIRONMENT) {
            return finishEnvironmentDefinition(command);
        }

        /* All other commands are handled according to their type */
        switch (command.getType()) {
            case SIMPLE:
                /* Not expecting any more to read so bail out now */
                return finishSimpleCommand(command);
                
            case COMBINER:
                /* Read in next token and combine up */
                return finishCombiningCommand(command);
                
            case COMPLEX:
                /* Read arguments */
                return finishComplexCommand(command);
                
            default:
                throw new SnuggleLogicException("Unexpected switch case " + command.getType());
        }
    }