PageRenderTime 23ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/interpreter/tags/at2-build270707/src/edu/vub/at/exceptions/XIllegalParameter.java

http://ambienttalk.googlecode.com/
Java | 63 lines | 12 code | 6 blank | 45 comment | 0 complexity | 7d3086c0aa3c065aabe072fef0e0149e MD5 | raw file
 1/**
 2 * AmbientTalk/2 Project
 3 * XIllegalParameter.java created on 25-dec-2006 at 17:36:39
 4 * (c) Programming Technology Lab, 2006 - 2007
 5 * Authors: Tom Van Cutsem & Stijn Mostinckx
 6 * 
 7 * Permission is hereby granted, free of charge, to any person
 8 * obtaining a copy of this software and associated documentation
 9 * files (the "Software"), to deal in the Software without
10 * restriction, including without limitation the rights to use,
11 * copy, modify, merge, publish, distribute, sublicense, and/or
12 * sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following
14 * conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */
28package edu.vub.at.exceptions;
29
30import edu.vub.at.objects.ATTypeTag;
31import edu.vub.at.objects.coercion.NativeTypeTags;
32
33/**
34 * An XIllegalParameter exception is raised when the interpreter detects a faulty
35 * formal parameter list of a function or method when it is invoked. The detection
36 * of such faulty parameter lists is done when the function is defined since its
37 * paramter list is then partially evaluated to produce a correct argument binding 
38 * function.
39 * <p>
40 * Illegal parameter lists can be formed when the rest-parameter (@arg) is not the
41 * last parameter or when optional parameters are followed by mandatory parameters.
42 *
43 * @see edu.vub.at.eval.PartialBinder#calculateResidual(String, ATTable)
44 * 
45 * @author tvcutsem
46 */
47public class XIllegalParameter extends InterpreterException {
48
49	private static final long serialVersionUID = -8300108453776535995L;
50	
51	/**
52	 * Constructor taking the name of the function whose parameter list is being partially 
53	 * evaluated and the message detailing the precise error.
54	 */
55	public XIllegalParameter(String ofFun, String msg) {
56		super("Illegal parameter list for " + ofFun + ": "+msg);
57	}
58	
59	public ATTypeTag getType() {
60		return NativeTypeTags._ILLPARAM_;
61	}
62
63}