Search in sources :

Example 6 with CompositeNode

use of org.eclipse.xtext.nodemodel.impl.CompositeNode 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

ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)6 CompositeNode (org.eclipse.xtext.nodemodel.impl.CompositeNode)6 LeafNode (org.eclipse.xtext.nodemodel.impl.LeafNode)3 NodeModelBuilder (org.eclipse.xtext.nodemodel.impl.NodeModelBuilder)3 ILeafNode (org.eclipse.xtext.nodemodel.ILeafNode)2 Before (org.junit.Before)2 EObject (org.eclipse.emf.ecore.EObject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 AbstractNode (org.eclipse.xtext.nodemodel.impl.AbstractNode)1 HiddenLeafNode (org.eclipse.xtext.nodemodel.impl.HiddenLeafNode)1 SyntheticCompositeNode (org.eclipse.xtext.nodemodel.impl.SyntheticCompositeNode)1 IParseResult (org.eclipse.xtext.parser.IParseResult)1 XtextResource (org.eclipse.xtext.resource.XtextResource)1 Test (org.junit.Test)1