// Copyright (c) 1996-2002 Brian D. Carlstrom

package bdc.scheme.exception;

import bdc.scheme.Pair;
import bdc.scheme.SchemeException;
import bdc.scheme.expression.Expression;
import bdc.util.Fmt;

public class SyntaxException extends SchemeException
{

    String syntaxError;
    Pair   source;

    public SyntaxException (String syntaxError, Pair source)
    {
        this.syntaxError = syntaxError;
        this.source      = source;
    }

    public String toString ()
    {
        return Fmt.S("Syntax error: %s\n%s",
                     syntaxError,
                     Expression.stackTrace(source));
    }
}
