From bf54552f9869bbc7b8bbadbcffbda4d99d42da38 Mon Sep 17 00:00:00 2001 From: paltherr Date: Wed, 29 Oct 2003 20:46:30 +0000 Subject: - Added methods Import - Added methods mkImportAll --- sources/scalac/ast/TreeGen.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'sources') diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java index 13176d351e..43e33ad80e 100644 --- a/sources/scalac/ast/TreeGen.java +++ b/sources/scalac/ast/TreeGen.java @@ -581,6 +581,17 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { return clone; } + /** Builds an import of all names of given qualifier. */ + public Import mkImportAll(int pos, Tree qualifier) { + return Import(pos, qualifier, new Name[]{Names.IMPORT_WILDCARD}); + } + public Import mkImportAll(Tree qualifier) { + return mkImportAll(qualifier.pos, qualifier); + } + public Import mkImportAll(int pos, Symbol qualifier) { + return mkImportAll(pos, mkRef(pos, qualifier)); + } + /** Builds an instance test with given value and type. */ public Tree mkIsInstanceOf(int pos, Tree value, Type type) { return mkApplyT_(pos, Select(value, definitions.IS), new Type[]{type}); @@ -609,6 +620,19 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { return mkBlock(trees[0].pos, trees); } + /** Builds an Import node with given qualifier and names. */ + public Import Import(int pos, Tree qualifier, Name[] names) { + Import tree = make.Import(pos, qualifier.symbol(), qualifier, names); + tree.setType(Type.NoType); + return tree; + } + public Import Import(Tree qualifier, Name[] names) { + return Import(qualifier.pos, qualifier, names); + } + public Import Import(int pos, Symbol qualifier, Name[] names) { + return Import(pos, mkRef(pos, qualifier), names); + } + /** Builds a Template node with given symbol, parents and body. */ public Template Template(int pos, Symbol local, Tree[]parents, Tree[]body){ Template tree = make.Template(pos, local, parents, body); -- cgit v1.2.3