/interpreter/tags/at2dist110511/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. */
  28. package edu.vub.at.exceptions;
  29. import edu.vub.at.objects.ATTypeTag;
  30. import edu.vub.at.objects.coercion.NativeTypeTags;
  31. /**
  32. * An XIllegalParameter exception is raised when the interpreter detects a faulty
  33. * formal parameter list of a function or method when it is invoked. The detection
  34. * of such faulty parameter lists is done when the function is defined since its
  35. * paramter list is then partially evaluated to produce a correct argument binding
  36. * function.
  37. * <p>
  38. * Illegal parameter lists can be formed when the rest-parameter (@arg) is not the
  39. * last parameter or when optional parameters are followed by mandatory parameters.
  40. *
  41. * @see edu.vub.at.eval.PartialBinder#calculateResidual(String, ATTable)
  42. *
  43. * @author tvcutsem
  44. */
  45. public class XIllegalParameter extends InterpreterException {
  46. private static final long serialVersionUID = -8300108453776535995L;
  47. /**
  48. * Constructor taking the name of the function whose parameter list is being partially
  49. * evaluated and the message detailing the precise error.
  50. */
  51. public XIllegalParameter(String ofFun, String msg) {
  52. super("Illegal parameter list for " + ofFun + ": "+msg);
  53. }
  54. public ATTypeTag getType() {
  55. return NativeTypeTags._ILLPARAM_;
  56. }
  57. }