ForInLoopTree.java revision 1590:1916a2c680d8
1106424Sroberto/*
2106424Sroberto * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3106424Sroberto * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4106424Sroberto *
5106424Sroberto * This code is free software; you can redistribute it and/or modify it
6106424Sroberto * under the terms of the GNU General Public License version 2 only, as
7106424Sroberto * published by the Free Software Foundation.  Oracle designates this
8106424Sroberto * particular file as subject to the "Classpath" exception as provided
9106424Sroberto * by Oracle in the LICENSE file that accompanied this code.
10106424Sroberto *
11106424Sroberto * This code is distributed in the hope that it will be useful, but WITHOUT
12106424Sroberto * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13106424Sroberto * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14106424Sroberto * version 2 for more details (a copy is included in the LICENSE file that
15106424Sroberto * accompanied this code).
16106424Sroberto *
17106424Sroberto * You should have received a copy of the GNU General Public License version
18106424Sroberto * 2 along with this work; if not, write to the Free Software Foundation,
19106424Sroberto * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20106424Sroberto *
21106424Sroberto * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22106424Sroberto * or visit www.oracle.com if you need additional information or have any
23106424Sroberto * questions.
24106424Sroberto */
25106424Sroberto
26106424Srobertopackage jdk.nashorn.api.tree;
27106424Sroberto
28106424Sroberto/**
29106424Sroberto * A tree node for for..in statement
30106424Sroberto *
31106424Sroberto * For example:
32106424Sroberto * <pre>
33106424Sroberto *   for ( <em>variable</em> in <em>expression</em> )
34106424Sroberto *       <em>statement</em>
35106424Sroberto * </pre>
36106424Sroberto *
37106424Sroberto * @since 1.9
38106424Sroberto */
39106424Srobertopublic interface ForInLoopTree extends LoopTree {
40106424Sroberto    /**
41106424Sroberto     * The for..in left hand side expression.
42106424Sroberto     *
43106424Sroberto     * @return the left hand side expression
44106424Sroberto     */
45106424Sroberto    ExpressionTree getVariable();
46106424Sroberto
47182007Sroberto    /**
48182007Sroberto     * The object or array being whose properties are iterated.
49182007Sroberto     *
50106424Sroberto     * @return the object or array expression being iterated
51106424Sroberto     */
52106424Sroberto    ExpressionTree getExpression();
53106424Sroberto
54106424Sroberto    /**
55106424Sroberto     * The statement contained in this for..in statement.
56106424Sroberto     *
57106424Sroberto     * @return the statement
58106424Sroberto     */
59106424Sroberto    @Override
60106424Sroberto    StatementTree getStatement();
61106424Sroberto
62106424Sroberto    /**
63106424Sroberto     * Returns if this is a for..each..in statement or not.
64106424Sroberto     *
65106424Sroberto     * @return true if this is a for..each..in statement
66106424Sroberto     */
67106424Sroberto    boolean isForEach();
68106424Sroberto}
69106424Sroberto