PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/interpreter/tags/at2dist030708/src/edu/vub/at/objects/grammar/ATClosureLiteral.java

http://ambienttalk.googlecode.com/
Java | 58 lines | 6 code | 5 blank | 47 comment | 0 complexity | 6efc5ddcd69eb794c60845308c1071a7 MD5 | raw file
 1/**
 2 * AmbientTalk/2 Project
 3 * ATClosureLiteral.java created on 26-jul-2006 at 16:57:46
 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.grammar;
29
30import edu.vub.at.objects.ATTable;
31
32/**
33 * The public interface to a closure literal AG element.
34 * 
35 * Example: <code>{ |a, b| a + b }</code> where <code>|a, b|</code>
36 * represents the formal arguments list. If there are no formal arguments,
37 * the vertical bars may be omitted. The body may not be empty. 
38 * 
39 * @author tvc
40 */
41public interface ATClosureLiteral extends ATExpression {
42	
43	/**
44	 * A literal closure may contain zero, one or more formal arguments.
45	 * Splicing is allowed in the argument list.
46	 * Example: <code>`({ |a, b| a + b }).arguments == `[a, b]</code>
47	 * @return The formal argument list
48	 */
49	public ATTable base_arguments();
50	
51	/**
52	 * The body of a literal closure may not be empty.
53	 * Example: <code>`({ |a, b| a + b }).bodyExpression == `(a.+(b))</code>
54	 * @return The body of the literal closure
55	 */
56	public ATBegin base_bodyExpression();
57
58}