Package abstrasy

Examples of abstrasy.Node.addElement()


     */

    public static Node createSExpression(String symbol, Node[] args) throws Exception {
        // crée un link de la forme (symbol arg0 arg1 arg2 ... argn)
        Node res = Node.createExpr();
        res.addElement(Node.createSymbol(symbol));
        for (int i = 0; i < args.length; i++) {
            res.addElement(args[i]);
        }
        return res;
    }
View Full Code Here


    public static Node createSExpression(String symbol, Node[] args) throws Exception {
        // crée un link de la forme (symbol arg0 arg1 arg2 ... argn)
        Node res = Node.createExpr();
        res.addElement(Node.createSymbol(symbol));
        for (int i = 0; i < args.length; i++) {
            res.addElement(args[i]);
        }
        return res;
    }

   /* public static Node createSExpression(String symbol, Node args) throws Exception {
View Full Code Here

            Node expr_new = Node.createExpr().append(OPN_NEW).append(classNode);
            // générer l'expression ((new className) ':init! ...)...
            Node expr_init = Node.createExpr().append(expr_new).append(Node.createQSymbol(":init!"));
            // ajouter les arguments...
            for (int i = 0; i < args.length; i++)
                expr_init.addElement(args[i]);
            return expr_init.letQuoted(true);
        }

    }
View Full Code Here

    }

    public Node external_available_options(Node startAt) throws Exception {
        Node opts = Node.createCList();
        for (int i = 0; i < optAccessList.size(); i++)
            opts.addElement(Node.createQSymbol(optAccessList.get(i).getKey()));
        return opts;
    }


}
View Full Code Here

                // contient un vecteur de références
                Node vector = startAt.getSubNode(1, Node.TYPE_CLIST);
                if (vector.indexOf(objet) >= 0)
                    throw new InterpreterException(StdErrors.Circulare_reference);
                if (!objet.isNodeType(Node.VTYPE_BY_VALUE))
                    vector.addElement(objet);
                res = AExtTools.createNewExpr(
                          Node.createSymbol("Object"),
                          Node.createLazy().append(AExtTools.createSExpression(":set!", new Node[] { objet.toSerialized(vector) }))
                          );
            }
View Full Code Here

  public Node external_list_roots(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 1);
    File[] roots = File.listRoots();
        Node res = Node.createCList();
    for (int i = 0; i < roots.length; i++) {
      res.addElement(new Node(roots[i].getAbsolutePath()));
    }
    return res;
  }

View Full Code Here

    }
    else {
      fl = f.listFiles(filefilter);
    }
    for (int i = 0; i < fl.length; i++) {
      res.addElement(new Node(fl[i].getName()));
    }
    return res;
  }

    private static void _walk_files(File f, Node fx) throws Exception {
View Full Code Here

      if (fl[i].isDirectory() && fl[i].getCanonicalPath().equals(fl[i].getAbsolutePath())) {
                _walk_files(fl[i],fx);
            }
            else{
                Node expr = Node.createExpr();
                expr.addElement(fx);
                expr.addElement(new Node(fl[i].getAbsolutePath()));
                expr.exec(true);
            }
        }
    }
View Full Code Here

                _walk_files(fl[i],fx);
            }
            else{
                Node expr = Node.createExpr();
                expr.addElement(fx);
                expr.addElement(new Node(fl[i].getAbsolutePath()));
                expr.exec(true);
            }
        }
    }
   
View Full Code Here

        Node res = Node.createCList();
        for (int i = 0; i < parts.size(); i++) {
            External_Buffer part = new External_Buffer();
            part.setBuffer(parts.get(i));
            part.getBuffer().setCharset(buffer.getCharset());
            res.addElement(Node.createExternal(part));
        }
        return res;
    }

    /**
 
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.