raster@15779
|
1 |
/*
|
raster@15779
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
raster@15779
|
3 |
*
|
raster@15779
|
4 |
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
raster@15779
|
5 |
*
|
raster@15779
|
6 |
* The contents of this file are subject to the terms of either the GNU
|
raster@15779
|
7 |
* General Public License Version 2 only ("GPL") or the Common
|
raster@15779
|
8 |
* Development and Distribution License("CDDL") (collectively, the
|
raster@15779
|
9 |
* "License"). You may not use this file except in compliance with the
|
raster@15779
|
10 |
* License. You can obtain a copy of the License at
|
raster@15779
|
11 |
* http://www.netbeans.org/cddl-gplv2.html
|
raster@15779
|
12 |
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
raster@15779
|
13 |
* specific language governing permissions and limitations under the
|
raster@15779
|
14 |
* License. When distributing the software, include this License Header
|
raster@15779
|
15 |
* Notice in each file and include the License file at
|
raster@15779
|
16 |
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
|
raster@15779
|
17 |
* particular file as subject to the "Classpath" exception as provided
|
raster@15779
|
18 |
* by Sun in the GPL Version 2 section of the License file that
|
raster@15779
|
19 |
* accompanied this code. If applicable, add the following below the
|
raster@15779
|
20 |
* License Header, with the fields enclosed by brackets [] replaced by
|
raster@15779
|
21 |
* your own identifying information:
|
raster@15779
|
22 |
* "Portions Copyrighted [year] [name of copyright owner]"
|
raster@15779
|
23 |
*
|
raster@15779
|
24 |
* If you wish your version of this file to be governed by only the CDDL
|
raster@15779
|
25 |
* or only the GPL Version 2, indicate your decision by adding
|
raster@15779
|
26 |
* "[Contributor] elects to include this software in this distribution
|
raster@15779
|
27 |
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
raster@15779
|
28 |
* single choice of license, a recipient has the option to distribute
|
raster@15779
|
29 |
* your version of this file under either the CDDL, the GPL Version 2 or
|
raster@15779
|
30 |
* to extend the choice of license to its licensees as provided above.
|
raster@15779
|
31 |
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
raster@15779
|
32 |
* Version 2 license, then the option applies only if the new code is
|
raster@15779
|
33 |
* made subject to such option by the copyright holder.
|
raster@15779
|
34 |
*
|
raster@15779
|
35 |
* Contributor(s):
|
raster@15779
|
36 |
*
|
raster@15779
|
37 |
* Portions Copyrighted 2008 Sun Microsystems, Inc.
|
raster@15779
|
38 |
*/
|
raster@15779
|
39 |
package org.netbeans.modules.ada.editor.ast.nodes;
|
raster@15779
|
40 |
|
raster@15779
|
41 |
import org.netbeans.modules.ada.editor.ast.nodes.visitors.Visitor;
|
raster@15779
|
42 |
|
raster@15779
|
43 |
/**
|
raster@15779
|
44 |
* Represent a exit statement
|
raster@15779
|
45 |
* <pre>e.g.<pre>
|
raster@15779
|
46 |
* exit Main_Cycle when Found;
|
raster@15779
|
47 |
* exit when New_Item = Terminal_Item;
|
raster@15779
|
48 |
*/
|
raster@15779
|
49 |
public class ExitStatement extends Statement {
|
raster@15779
|
50 |
|
raster@16367
|
51 |
private Expression loopName;
|
raster@15779
|
52 |
private Expression whenCondition;
|
raster@15779
|
53 |
|
raster@16367
|
54 |
public ExitStatement(int start, int end, Expression loopName, Expression whenCondition) {
|
raster@15779
|
55 |
super(start, end);
|
raster@15779
|
56 |
this.loopName = loopName;
|
raster@15779
|
57 |
this.whenCondition = whenCondition;
|
raster@15779
|
58 |
}
|
raster@15779
|
59 |
|
raster@15779
|
60 |
/**
|
raster@15779
|
61 |
* Returns the loop name of this exit statement.
|
raster@15779
|
62 |
*
|
raster@15779
|
63 |
* @return the loopName node
|
raster@15779
|
64 |
*/
|
raster@16367
|
65 |
public Expression getLoopName() {
|
raster@15779
|
66 |
return loopName;
|
raster@15779
|
67 |
}
|
raster@15779
|
68 |
|
raster@15779
|
69 |
/**
|
raster@15779
|
70 |
* Returns the loop name of this exit statement.
|
raster@15779
|
71 |
*
|
raster@15779
|
72 |
* @return the whenCondition node
|
raster@15779
|
73 |
*/
|
raster@15779
|
74 |
public Expression getWhenCondition() {
|
raster@15779
|
75 |
return whenCondition;
|
raster@15779
|
76 |
}
|
raster@15779
|
77 |
|
raster@15779
|
78 |
@Override
|
raster@15779
|
79 |
public void accept(Visitor visitor) {
|
raster@15779
|
80 |
visitor.visit(this);
|
raster@15779
|
81 |
}
|
raster@15779
|
82 |
}
|