Package lupos.rif.generated.syntaxtree

Examples of lupos.rif.generated.syntaxtree.INode


public class ChildrenSyntaxTreeVisitor implements IRetArguVisitor<List<INode>, Object> {

  private List<INode> list(INode... nodes) {
    List<INode> ret = new ArrayList<INode>();
    for (int i = 0; i < nodes.length; i++) {
      INode node = nodes[i];
      if (node instanceof INodeList)
        ret.addAll(list(node.accept(this, null).toArray(new INode[] {})));
      else if (node instanceof NodeOptional)
        ret.addAll(list(node.accept(this, null).toArray(new INode[] {})));
      else if (node instanceof NodeChoice)
        ret.addAll(list(((NodeChoice) node).choice));
      else if (node != null)
        ret.add(node);
    }
View Full Code Here


  @Override
  public LinkedList<GraphWrapper> getPrecedingElements() {
    final LinkedList<GraphWrapper> precedingElements = new LinkedList<GraphWrapper>();

    if (((INode) element).getParent() != null) {
      INode parent = ((INode) element).getParent();
      while (instanceOf(parent, Arrays.asList(NodeList.class,
          NodeListOptional.class, NodeSequence.class,
          NodeOptional.class, NodeChoice.class)))
        parent = parent.getParent();

      precedingElements.add(new GraphWrapperASTRIF(parent));
    }

    return precedingElements;
View Full Code Here

TOP

Related Classes of lupos.rif.generated.syntaxtree.INode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.