summaryrefslogtreecommitdiff
path: root/sources/meta/scalac/ast/MetaStrictTreeCopier.java
blob: 9cc050396af21f5a50341eb502c10f4b0ca8a23d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*     ____ ____  ____ ____  ______                                     *\
**    / __// __ \/ __// __ \/ ____/    SOcos COmpiles Scala             **
**  __\_ \/ /_/ / /__/ /_/ /\_ \       (c) 2002, LAMP/EPFL              **
** /_____/\____/\___/\____/____/                                        **
\*                                                                      */

// $Id$

package meta.scalac.ast;

public class MetaStrictTreeCopier extends AbstractTreeMethodExpander {

    //########################################################################
    // Public Methods

    public void printTreeMethod(TreeNode node) {
        printTreeMethodHeader(node, tree.t_Tree + " tree");
        writer.lbrace();
        writer.print(node.name + " t = make." + node.name + "(");
        node.printArgs(writer, "tree.pos").println(");");
        writer.println("t.type = tree.type;");
        if (node.hasSymbol()) writer.println("t.setSymbol(tree.symbol());");
        writer.println("return t;");
        writer.rbrace();
    }

    //########################################################################
}