Package lupos.rif.model

Examples of lupos.rif.model.RuleList.addItem()


    result.setParent(argu);
    if (n.f2.which == 1) {
      List<INode> nodes = (List<INode>) n.f2.choice.accept(this, result);
      List<INode> terms = (List<INode>) nodes.get(0).accept(this, result);
      for (INode term : terms)
        result.addItem((IExpression) term.accept(this, result));
      // Tail anh�ngen
      if (((NodeOptional) nodes.get(1)).present()) {
        result.isOpen = true;
        result.addItem((IExpression) ((List<INode>) nodes.get(1)
            .accept(this, result)).get(1).accept(this, result));
View Full Code Here


      for (INode term : terms)
        result.addItem((IExpression) term.accept(this, result));
      // Tail anh�ngen
      if (((NodeOptional) nodes.get(1)).present()) {
        result.isOpen = true;
        result.addItem((IExpression) ((List<INode>) nodes.get(1)
            .accept(this, result)).get(1).accept(this, result));
      }
    }
    return result;
  }
View Full Code Here

  @Builtin(Name = "make-list")
  public static RuleList make_list(final Argument arg) {
    final RuleList result = new RuleList();
    for (final Item item : arg.arguments) {
      if (item instanceof Variable)
        result.addItem(new RuleVariable(item.getName()));
      else if (item instanceof Literal)
        result.addItem(new Constant((Literal) item, result));
      else if (item instanceof IExpression)
        result.addItem((IExpression) item);
    }
View Full Code Here

    final RuleList result = new RuleList();
    for (final Item item : arg.arguments) {
      if (item instanceof Variable)
        result.addItem(new RuleVariable(item.getName()));
      else if (item instanceof Literal)
        result.addItem(new Constant((Literal) item, result));
      else if (item instanceof IExpression)
        result.addItem((IExpression) item);
    }
    return result;
  }
View Full Code Here

      if (item instanceof Variable)
        result.addItem(new RuleVariable(item.getName()));
      else if (item instanceof Literal)
        result.addItem(new Constant((Literal) item, result));
      else if (item instanceof IExpression)
        result.addItem((IExpression) item);
    }
    return result;
  }

  @Builtin(Name = "count")
View Full Code Here

        if (first) {
          first = false;
          continue;
        }
        if (item instanceof Variable)
          list.addItem(new RuleVariable(item.getName()));
        else if (item instanceof Literal)
          list.addItem(new Constant((Literal) item, list));
        else if (item instanceof IExpression)
          list.addItem((IExpression) item);
      }
View Full Code Here

          continue;
        }
        if (item instanceof Variable)
          list.addItem(new RuleVariable(item.getName()));
        else if (item instanceof Literal)
          list.addItem(new Constant((Literal) item, list));
        else if (item instanceof IExpression)
          list.addItem((IExpression) item);
      }
      return list;
    }
View Full Code Here

        if (item instanceof Variable)
          list.addItem(new RuleVariable(item.getName()));
        else if (item instanceof Literal)
          list.addItem(new Constant((Literal) item, list));
        else if (item instanceof IExpression)
          list.addItem((IExpression) item);
      }
      return list;
    }
    return null;
  }
View Full Code Here

      list.getItems().clear();
      for (int i = 0; i < original.size(); i++) {
        final IExpression expr = original.get(i);
        if (i == index) {
          if (item instanceof Variable)
            list.addItem(new RuleVariable(item.getName()));
          else if (item instanceof Literal)
            list.addItem(new Constant((Literal) item, list));
          else if (item instanceof IExpression)
            list.addItem((IExpression) item);
        }
View Full Code Here

        final IExpression expr = original.get(i);
        if (i == index) {
          if (item instanceof Variable)
            list.addItem(new RuleVariable(item.getName()));
          else if (item instanceof Literal)
            list.addItem(new Constant((Literal) item, list));
          else if (item instanceof IExpression)
            list.addItem((IExpression) item);
        }
        list.addItem(expr);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.