class InstructionSequenceBuilder extends Parser.AbstractSyntaxHandler
{
    private static final Predicate<String> MATCHES_INTEGER = Pattern.compile("[\\+\\-]?\\d+").asMatchPredicate();
    private static final Predicate<String> MATCHES_REAL = Pattern.compile("[\\-]?\\d*\\.\\d*([Ee]\\-?\\d+)?").asMatchPredicate();

    private final InstructionSequence mainSequence = new InstructionSequence();
    private final Stack<InstructionSequence> seqStack = new Stack<>();

    private InstructionSequenceBuilder()
    {
        this.seqStack.push(this.mainSequence);
    }

    /**
     * Returns the instruction sequence that has been build from the syntactic elements.
     * @return the instruction sequence
     */
    public InstructionSequence getInstructionSequence()
    {
        return this.mainSequence;
    }

    /**
     * Parses the given text into an instruction sequence representing a Type 4 function
     * that can be executed.
     * @param text the Type 4 function text
     * @return the instruction sequence
     */
    public static InstructionSequence parse(CharSequence text)
    {
        InstructionSequenceBuilder builder = new InstructionSequenceBuilder();
        Parser.parse(text, builder);
        return builder.getInstructionSequence();
    }

    private InstructionSequence getCurrentSequence()
    {
        return this.seqStack.peek();
    }

    /** {@inheritDoc} */
    @Override
    public void token(CharSequence text)
    {
        String token = text.toString();
        token(token);
    }

    private void token(String token)
    {<FILL_FUNCTION_BODY>}

    /**
     * Parses a value of type "int".
     * @param token the token to be parsed
     * @return the parsed value
     */
    public static int parseInt(String token)
    {
        return Integer.parseInt(token);
    }

    /**
     * Parses a value of type "real".
     * @param token the token to be parsed
     * @return the parsed value
     */
    public static float parseReal(String token)
    {
        return Float.parseFloat(token);
    }

}

        if ("{".equals(token))
        {
            InstructionSequence child = new InstructionSequence();
            getCurrentSequence().addProc(child);
            this.seqStack.push(child);
        }
        else if ("}".equals(token))
        {
            this.seqStack.pop();
        }
        else
        {
            if (MATCHES_INTEGER.test(token))
            {
                getCurrentSequence().addInteger(parseInt(token));
                return;
            }

            if (MATCHES_REAL.test(token))
            {
                getCurrentSequence().addReal(parseReal(token));
                return;
            }

            //TODO Maybe implement radix numbers, such as 8#1777 or 16#FFFE

            getCurrentSequence().addName(token);
        }
    
<methods>public non-sealed void <init>() ,public void comment(java.lang.CharSequence) ,public void newLine(java.lang.CharSequence) ,public void whitespace(java.lang.CharSequence) <variables>