Package org.jrubyparser.ast

Examples of org.jrubyparser.ast.ListNode


    private void addNodeToModule(DefnNode defn, Module module, Properties docNodes) {
        List<Argument> args = new ArrayList<Argument>();
        ArgsNode argsNode = defn.getArgsNode();
        if (argsNode.getBlock() != null)
            return;
        ListNode pre = argsNode.getPre();
        if (pre != null) {
            for (int i = 0; i < pre.size(); i++) {
                Node node = pre.get(i);
                if (node instanceof INameNode)
                    args.add(new Argument(((INameNode) node).getName()));
                else
                    return;
            }
        }
        ListNode optional = argsNode.getOptional();
        if (optional != null) {
            for (int i = 0; i < optional.size(); i++) {
                Node node = optional.get(i);
                if (!(node instanceof LocalAsgnNode))
                    return;
                LocalAsgnNode lan = (LocalAsgnNode) node;
                Node valueNode = lan.getValueNode();
                if ((valueNode instanceof StrNode))
View Full Code Here


  private List<Node> getStringArguments(IArgumentNode callNode) throws IllegalArgumentException {
    Node argsNode = callNode.getArgs();
    if(!(argsNode instanceof ListNode))
      throw new IllegalArgumentException("IArgumentNode expected");
    ListNode args = (ListNode) argsNode;
    int top = args.size();
    ArrayList<Node> stringArgs = new ArrayList<Node>(top);
    for(int idx = 0; idx < top; ++idx) {
      Node argNode = args.get(idx);
      switch(argNode.getNodeType()) {
        case STRNODE:
        case FIXNUMNODE:
        case FLOATNODE:
        case NILNODE:
View Full Code Here

      ArrayNode arrayNode = (ArrayNode) argsNode;
      if(arrayNode.size() > 0) {
        Node a = arrayNode.get(0);
        if(a instanceof HashNode) {
          HashNode argsHash = (HashNode) a;
          ListNode listNode = argsHash.getListNode();
          if(listNode.size() > 0)
            argsNode = listNode.get(0);
        }
      }
    }
    return argsNode;
  }
View Full Code Here

TOP

Related Classes of org.jrubyparser.ast.ListNode

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.