View Javadoc

1   /*
2    * ASReturnStatement.java
3    * 
4    * Copyright (c) 2007-2008 David Holroyd
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package uk.co.badgersinfoil.metaas.dom;
20  
21  /**
22   * A with-statement, such as <code>with (expr) { }</code>.
23   * 
24   * <p>e.g.</p>
25   * <pre class="eg">ASWithStatement stmt = method.newWith("myObject");
26   *stmt.newExprStmt("trace(property)");</pre>
27   * <p>will result in ActionScript code like,</p>
28   * <pre class="eg">with (myObject)) {
29   * 	trace(property);
30   *}</pre>
31   *
32   * @see StatementContainer#newWith(Expression)
33   */
34  public interface ASWithStatement extends Statement, StatementContainer {
35  
36  	/**
37  	 * Returns a string representation of the expression who's value
38  	 * will be used as new scope for the execution of the statements in
39  	 * the body of this with-statement.
40  	 */
41  	public String getScopeString();
42  
43  	public Expression getScope();
44  
45  	/**
46  	 * Changes the expression who's value will be used as new scope for the
47  	 * execution of the statements in the body of this with-statement.
48  	 * 
49  	 * @throws SyntaxException if the given string is not a valid
50  	 *         ActionScript expression.
51  	 */
52  	public void setScope(String expr);
53  
54  	public void setScope(Expression expr);
55  
56  	public Statement getBody();
57  }