/*______________________________________________________________________________ * * org.eidola.kernel.error.SemanticViolation * * Part of the Eidola Kernel Reference Implementation * See http://eidola.org for oodles of relevant fun! * *______________________________________________________________________________ * * Copyright 2000-2001 Paul Cantrell * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 2, as published by the * Free Software Foundation. See the file LICENSE.html for more information. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple * Place, Suite 330 / Boston, MA 02111-1307 / USA. *_______________________________________________________________________________ */ package org.eidola.kernel.error; import org.eidola.kernel.Container; /** A violation of the semantic restrictions on an element. This doesn't always get thrown as an exception -- violations of lazy rules live in an element's error list (see {@link org.eidola.kernel.Element.Compilation#getErrors()}). @author Paul Cantrell @version [Development version] */ public class SemanticViolation extends Exception { public SemanticViolation(Container culprit, String s) { super(s); this.culprit = culprit; } /** Returns the culprit element. This is not necessarily the element * in whose error list this exception lives; it is the element most * directly responsible for the error in some potentially larger context. * For example, if a variable tries to be a public and a private member of * a class, the variable is the culprit, but the exception will appear in the * class's error list. */ public Container getCulprit() { return culprit; } private Container culprit; }