< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java

Print this page




  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.tools.javac.tree;
  27 
  28 import java.util.Iterator;
  29 
  30 import com.sun.source.tree.CaseTree.CaseKind;
  31 import com.sun.source.tree.ModuleTree.ModuleKind;
  32 import com.sun.source.tree.Tree.Kind;
  33 import com.sun.tools.javac.code.*;
  34 import com.sun.tools.javac.code.Attribute.UnresolvedClass;
  35 import com.sun.tools.javac.code.Symbol.*;
  36 import com.sun.tools.javac.code.Type.*;
  37 import com.sun.tools.javac.util.*;
  38 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
  39 
  40 import com.sun.tools.javac.tree.JCTree.*;
  41 
  42 import static com.sun.tools.javac.code.Flags.*;
  43 import static com.sun.tools.javac.code.Kinds.Kind.*;
  44 import static com.sun.tools.javac.code.TypeTag.*;
  45 
  46 /** Factory class for trees.
  47  *
  48  *  <p><b>This is NOT part of any supported API.
  49  *  If you write code that depends on this, you do so at your own risk.
  50  *  This code and its internal interfaces are subject to change or
  51  *  deletion without notice.</b>
  52  */


 444     public JCUnary Unary(JCTree.Tag opcode, JCExpression arg) {
 445         JCUnary tree = new JCUnary(opcode, arg);
 446         tree.pos = pos;
 447         return tree;
 448     }
 449 
 450     public JCBinary Binary(JCTree.Tag opcode, JCExpression lhs, JCExpression rhs) {
 451         JCBinary tree = new JCBinary(opcode, lhs, rhs, null);
 452         tree.pos = pos;
 453         return tree;
 454     }
 455 
 456     public JCTypeCast TypeCast(JCTree clazz, JCExpression expr) {
 457         JCTypeCast tree = new JCTypeCast(clazz, expr);
 458         tree.pos = pos;
 459         return tree;
 460     }
 461 
 462     public JCInstanceOf TypeTest(JCExpression expr, JCTree clazz) {
 463         JCInstanceOf tree = new JCInstanceOf(expr, clazz);






 464         tree.pos = pos;
 465         return tree;
 466     }
 467 
 468     public JCArrayAccess Indexed(JCExpression indexed, JCExpression index) {
 469         JCArrayAccess tree = new JCArrayAccess(indexed, index);
 470         tree.pos = pos;
 471         return tree;
 472     }
 473 
 474     public JCFieldAccess Select(JCExpression selected, Name selector) {
 475         JCFieldAccess tree = new JCFieldAccess(selected, selector, null);
 476         tree.pos = pos;
 477         return tree;
 478     }
 479 
 480     public JCMemberReference Reference(JCMemberReference.ReferenceMode mode, Name name,
 481             JCExpression expr, List<JCExpression> typeargs) {
 482         JCMemberReference tree = new JCMemberReference(mode, name, expr, typeargs);
 483         tree.pos = pos;




  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.tools.javac.tree;
  27 
  28 import java.util.Iterator;
  29 
  30 import com.sun.source.tree.CaseTree.CaseKind;
  31 import com.sun.source.tree.ModuleTree.ModuleKind;

  32 import com.sun.tools.javac.code.*;
  33 import com.sun.tools.javac.code.Attribute.UnresolvedClass;
  34 import com.sun.tools.javac.code.Symbol.*;
  35 import com.sun.tools.javac.code.Type.*;
  36 import com.sun.tools.javac.util.*;
  37 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
  38 
  39 import com.sun.tools.javac.tree.JCTree.*;
  40 
  41 import static com.sun.tools.javac.code.Flags.*;
  42 import static com.sun.tools.javac.code.Kinds.Kind.*;
  43 import static com.sun.tools.javac.code.TypeTag.*;
  44 
  45 /** Factory class for trees.
  46  *
  47  *  <p><b>This is NOT part of any supported API.
  48  *  If you write code that depends on this, you do so at your own risk.
  49  *  This code and its internal interfaces are subject to change or
  50  *  deletion without notice.</b>
  51  */


 443     public JCUnary Unary(JCTree.Tag opcode, JCExpression arg) {
 444         JCUnary tree = new JCUnary(opcode, arg);
 445         tree.pos = pos;
 446         return tree;
 447     }
 448 
 449     public JCBinary Binary(JCTree.Tag opcode, JCExpression lhs, JCExpression rhs) {
 450         JCBinary tree = new JCBinary(opcode, lhs, rhs, null);
 451         tree.pos = pos;
 452         return tree;
 453     }
 454 
 455     public JCTypeCast TypeCast(JCTree clazz, JCExpression expr) {
 456         JCTypeCast tree = new JCTypeCast(clazz, expr);
 457         tree.pos = pos;
 458         return tree;
 459     }
 460 
 461     public JCInstanceOf TypeTest(JCExpression expr, JCTree clazz) {
 462         JCInstanceOf tree = new JCInstanceOf(expr, clazz);
 463         tree.pos = pos;
 464         return tree;
 465     }
 466 
 467     public JCBindingPattern BindingPattern(Name name, JCTree vartype) {
 468         JCBindingPattern tree = new JCBindingPattern(name, null, vartype);
 469         tree.pos = pos;
 470         return tree;
 471     }
 472 
 473     public JCArrayAccess Indexed(JCExpression indexed, JCExpression index) {
 474         JCArrayAccess tree = new JCArrayAccess(indexed, index);
 475         tree.pos = pos;
 476         return tree;
 477     }
 478 
 479     public JCFieldAccess Select(JCExpression selected, Name selector) {
 480         JCFieldAccess tree = new JCFieldAccess(selected, selector, null);
 481         tree.pos = pos;
 482         return tree;
 483     }
 484 
 485     public JCMemberReference Reference(JCMemberReference.ReferenceMode mode, Name name,
 486             JCExpression expr, List<JCExpression> typeargs) {
 487         JCMemberReference tree = new JCMemberReference(mode, name, expr, typeargs);
 488         tree.pos = pos;


< prev index next >