Search in sources :

Example 6 with NodeModelBuilder

use of org.eclipse.xtext.nodemodel.impl.NodeModelBuilder in project xtext-core by eclipse.

the class NodeIteratorTest method setUp.

@Before
public void setUp() throws Exception {
    NodeModelBuilder builder = new NodeModelBuilder();
    nodes = new INode[NUM_NODES];
    nodes[0] = new CompositeNode();
    nodes[1] = new LeafNode();
    nodes[2] = new CompositeNode();
    nodes[3] = new CompositeNode();
    nodes[4] = new LeafNode();
    nodes[5] = new LeafNode();
    nodes[6] = new LeafNode();
    nodes[7] = new CompositeNode();
    nodes[8] = new LeafNode();
    nodes[9] = new LeafNode();
    nodes[10] = new CompositeNode();
    builder.addChild((ICompositeNode) nodes[0], (AbstractNode) nodes[1]);
    builder.addChild((ICompositeNode) nodes[0], (AbstractNode) nodes[2]);
    builder.addChild((ICompositeNode) nodes[2], (AbstractNode) nodes[3]);
    builder.addChild((ICompositeNode) nodes[3], (AbstractNode) nodes[4]);
    builder.addChild((ICompositeNode) nodes[3], (AbstractNode) nodes[5]);
    builder.addChild((ICompositeNode) nodes[2], (AbstractNode) nodes[6]);
    builder.addChild((ICompositeNode) nodes[2], (AbstractNode) nodes[7]);
    builder.addChild((ICompositeNode) nodes[2], (AbstractNode) nodes[8]);
    builder.addChild((ICompositeNode) nodes[0], (AbstractNode) nodes[9]);
    builder.addChild((ICompositeNode) nodes[0], (AbstractNode) nodes[10]);
}
Also used : CompositeNode(org.eclipse.xtext.nodemodel.impl.CompositeNode) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) LeafNode(org.eclipse.xtext.nodemodel.impl.LeafNode) NodeModelBuilder(org.eclipse.xtext.nodemodel.impl.NodeModelBuilder) Before(org.junit.Before)

Aggregations

NodeModelBuilder (org.eclipse.xtext.nodemodel.impl.NodeModelBuilder)6 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)4 CompositeNode (org.eclipse.xtext.nodemodel.impl.CompositeNode)3 LeafNode (org.eclipse.xtext.nodemodel.impl.LeafNode)3 IParseResult (org.eclipse.xtext.parser.IParseResult)2 Before (org.junit.Before)2 IOException (java.io.IOException)1 ANTLRReaderStream (org.antlr.runtime.ANTLRReaderStream)1 WrappedException (org.eclipse.emf.common.util.WrappedException)1 ILeafNode (org.eclipse.xtext.nodemodel.ILeafNode)1 INode (org.eclipse.xtext.nodemodel.INode)1 CompositeNodeWithSemanticElement (org.eclipse.xtext.nodemodel.impl.CompositeNodeWithSemanticElement)1 HiddenLeafNode (org.eclipse.xtext.nodemodel.impl.HiddenLeafNode)1 Test (org.junit.Test)1