01: /*
02: * Copyright (C) 2007 Júlio Vilmar Gesser.
03: *
04: * This file is part of Java 1.5 parser and Abstract Syntax Tree.
05: *
06: * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License as published by
08: * the Free Software Foundation, either version 3 of the License, or
09: * (at your option) any later version.
10: *
11: * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public License
17: * along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
18: */
19: /*
20: * Created on 07/11/2006
21: */
22: package japa.parser.ast.stmt;
23:
24: import japa.parser.ast.expr.Expression;
25: import japa.parser.ast.visitor.GenericVisitor;
26: import japa.parser.ast.visitor.VoidVisitor;
27:
28: /**
29: * @author Julio Vilmar Gesser
30: */
31: public final class IfStmt extends Statement {
32:
33: public final Expression condition;
34:
35: public final Statement thenStmt;
36:
37: public final Statement elseStmt;
38:
39: public IfStmt(int line, int column, Expression condition,
40: Statement thenStmt, Statement elseStmt) {
41: super (line, column);
42: this .condition = condition;
43: this .thenStmt = thenStmt;
44: this .elseStmt = elseStmt;
45: }
46:
47: @Override
48: public <A> void accept(VoidVisitor<A> v, A arg) {
49: v.visit(this , arg);
50: }
51:
52: @Override
53: public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
54: return v.visit(this, arg);
55: }
56: }
|