PageRenderTime 31ms CodeModel.GetById 5ms app.highlight 19ms RepoModel.GetById 2ms app.codeStats 0ms

/interpreter/tags/at_build150307/src/edu/vub/at/objects/coercion/ATConversions.java

http://ambienttalk.googlecode.com/
Java | 136 lines | 88 code | 12 blank | 36 comment | 0 complexity | 18bc9fc95eca1680e9c547e86724d90b MD5 | raw file
  1/**
  2 * AmbientTalk/2 Project
  3 * ATConversions.java created on Jul 23, 2006 at 2:20:16 PM
  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.objects.coercion;
 29
 30import edu.vub.at.actors.ATActorMirror;
 31import edu.vub.at.actors.ATAsyncMessage;
 32import edu.vub.at.actors.ATFarReference;
 33import edu.vub.at.actors.natives.NATFarReference;
 34import edu.vub.at.exceptions.InterpreterException;
 35import edu.vub.at.exceptions.XTypeMismatch;
 36import edu.vub.at.objects.ATBoolean;
 37import edu.vub.at.objects.ATClosure;
 38import edu.vub.at.objects.ATField;
 39import edu.vub.at.objects.ATHandler;
 40import edu.vub.at.objects.ATMessage;
 41import edu.vub.at.objects.ATMethod;
 42import edu.vub.at.objects.ATNumber;
 43import edu.vub.at.objects.ATStripe;
 44import edu.vub.at.objects.ATTable;
 45import edu.vub.at.objects.grammar.ATAssignVariable;
 46import edu.vub.at.objects.grammar.ATBegin;
 47import edu.vub.at.objects.grammar.ATDefinition;
 48import edu.vub.at.objects.grammar.ATExpression;
 49import edu.vub.at.objects.grammar.ATMessageCreation;
 50import edu.vub.at.objects.grammar.ATSplice;
 51import edu.vub.at.objects.grammar.ATStatement;
 52import edu.vub.at.objects.grammar.ATSymbol;
 53import edu.vub.at.objects.grammar.ATUnquoteSplice;
 54import edu.vub.at.objects.mirrors.NATMirage;
 55import edu.vub.at.objects.natives.NATBoolean;
 56import edu.vub.at.objects.natives.NATException;
 57import edu.vub.at.objects.natives.NATFraction;
 58import edu.vub.at.objects.natives.NATNumber;
 59import edu.vub.at.objects.natives.NATNumeric;
 60import edu.vub.at.objects.natives.NATObject;
 61import edu.vub.at.objects.natives.NATTable;
 62import edu.vub.at.objects.natives.NATText;
 63import edu.vub.at.objects.symbiosis.JavaClass;
 64import edu.vub.at.objects.symbiosis.JavaObject;
 65
 66/**
 67 * ATConversions is an interface defining all conversion methods between different
 68 * types of ambienttalk language elements. They are hidden from the language level
 69 * because they neither belong to base- nor meta-level.
 70 * 
 71 * @author smostinc
 72 */
 73public interface ATConversions {
 74
 75	public boolean isClosure() throws InterpreterException;
 76	public boolean isSymbol() throws InterpreterException;
 77	public boolean isTable() throws InterpreterException;
 78	public boolean isBoolean() throws InterpreterException;
 79	public boolean isCallFrame() throws InterpreterException;
 80	public boolean isUnquoteSplice() throws InterpreterException;
 81	public boolean isVariableAssignment() throws InterpreterException;
 82	public boolean isSplice() throws InterpreterException;
 83	public boolean isMethod() throws InterpreterException;
 84	public boolean isMessageCreation() throws InterpreterException;
 85	public boolean isStripe() throws InterpreterException;
 86	public boolean isFarReference() throws InterpreterException;
 87	
 88	public ATClosure   asClosure() throws InterpreterException;
 89	public ATSymbol    asSymbol() throws InterpreterException;
 90	public ATTable     asTable() throws InterpreterException;
 91	public ATBoolean   asBoolean() throws InterpreterException;
 92	public ATNumber    asNumber() throws InterpreterException;
 93	public ATMessage   asMessage() throws InterpreterException;
 94	public ATField     asField() throws InterpreterException;
 95	public ATMethod    asMethod() throws InterpreterException;
 96	public ATHandler   asHandler() throws InterpreterException;
 97	public ATStripe    asStripe() throws InterpreterException;
 98	public ATFarReference asFarReference() throws InterpreterException;
 99	public ATAsyncMessage asAsyncMessage() throws InterpreterException;
100	public ATActorMirror asActorMirror() throws InterpreterException;
101	
102	// Abstract Grammar Elements
103	
104	public ATStatement  		asStatement() throws InterpreterException;
105	public ATDefinition 		asDefinition() throws InterpreterException;
106	public ATExpression 		asExpression() throws InterpreterException;
107	public ATBegin      		asBegin() throws InterpreterException;
108	public ATMessageCreation 	asMessageCreation() throws InterpreterException;
109	public ATUnquoteSplice 		asUnquoteSplice() throws InterpreterException;
110	public ATAssignVariable 	asVariableAssignment() throws InterpreterException;
111	public ATSplice 			asSplice() throws InterpreterException;
112
113	// Native Value Elements
114	
115	public boolean isNativeBoolean();
116	public boolean isNativeText();
117	public boolean isAmbientTalkObject();
118	public boolean isJavaObjectUnderSymbiosis();
119	public boolean isNativeField();
120	
121	public NATObject   asAmbientTalkObject() throws XTypeMismatch;
122	public NATMirage   asMirage() throws XTypeMismatch;
123	public NATNumber   asNativeNumber() throws XTypeMismatch;
124	public NATFraction asNativeFraction() throws XTypeMismatch;
125	public NATText     asNativeText() throws XTypeMismatch;
126	public NATTable    asNativeTable() throws XTypeMismatch;
127	public NATBoolean  asNativeBoolean() throws XTypeMismatch;
128	public NATNumeric  asNativeNumeric() throws XTypeMismatch;
129	public NATException asNativeException() throws XTypeMismatch;
130	public NATFarReference asNativeFarReference() throws XTypeMismatch;
131	
132	public JavaObject  asJavaObjectUnderSymbiosis() throws XTypeMismatch;
133	public JavaClass   asJavaClassUnderSymbiosis() throws XTypeMismatch;
134	
135
136}