Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java @ 18754:59bf50cc5a32
Truffle-DSL: implemented @GenerateNodeFactory to enable generation of factories. Factory generation is now disabled by default.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Dec 2014 23:38:25 +0100 |
parents | f6b8787dc113 |
children | 3912400fc33a |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java Mon Dec 29 23:38:21 2014 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java Mon Dec 29 23:38:25 2014 +0100 @@ -71,7 +71,7 @@ } public CodeTypeElement create() { - CodeTypeElement clazz = GeneratorUtils.createClass(node, modifiers(PRIVATE, ABSTRACT, STATIC), baseClassName(node), node.getNodeType(), false); + CodeTypeElement clazz = GeneratorUtils.createClass(node, modifiers(PRIVATE, ABSTRACT), baseClassName(node), node.getNodeType(), false); clazz.getImplements().add(context.getTruffleTypes().getDslNode()); for (NodeChildData child : node.getChildren()) { @@ -1847,10 +1847,10 @@ return builder.getRoot(); } - private static String baseClassName(NodeData node) { + public static String baseClassName(NodeData node) { String nodeid = resolveNodeId(node); String name = ElementUtils.firstLetterUpperCase(nodeid); - name += "BaseNode"; + name += "NodeGen"; return name; } @@ -1874,12 +1874,12 @@ /** * <pre> * variant1 $condition != null - * + * * $type $name = defaultValue($type); * if ($condition) { * $name = $value; * } - * + * * variant2 $condition != null * $type $name = $value; * </pre>