Package abstrasy

Examples of abstrasy.Node$ParseBag


        return ynode;
    }

    public Node external_env_properties(Node startAt) throws Exception {
        startAt.isGoodArgsLength(true, 1);
        Node ynode = Node.createHash();
        Hash hash=ynode.getHash();
        Map<String,String> map = System.getenv();
        Set<String> keys = map.keySet();
        Iterator<String> iterator = keys.iterator();
        while (iterator.hasNext()) {
            String key = iterator.next();
            String value = map.get(key);
            hash.store(new Node(key), new Node(value));
        }
        return ynode;
    }
View Full Code Here


    public Node external_get_env_property(Node startAt) throws Exception {
        startAt.isGoodArgsLength(true, 2);
        String id = startAt.getSubNode(1, Node.TYPE_STRING).getString();
        String env=System.getenv(id);
        return env==null ? Node.createNothing() : new Node(env);
    }
View Full Code Here

    public Node external_execute(Node startAt) throws Exception {
        startAt.isGoodArgsLength(true, 2);
        String command = startAt.getSubNode(1, Node.TYPE_STRING).getString();
        Private_Execute pexec = new Private_Execute(command);
        int res = pexec.exec();
        Node rnode = Node.createHash();
        Hash hash=rnode.getHash();
        hash.store(Node.createQSymbol("result-code"), new Node(res));
        hash.store(Node.createQSymbol("output"), new Node(pexec.getOutput()));
        hash.store(Node.createQSymbol("error"), new Node(pexec.getError()));
        return rnode;
    }
View Full Code Here

  }

  public static final StdErrors createTrace(Interpreter interThrd, Exception exception) {
    int error = 0;
    String message = exception.getMessage();
    Node messageExt = null;
    if (exception instanceof InterpreterException) {
      error = ((InterpreterException) exception).getErrCode();
      messageExt = ((InterpreterException) exception).getMessageExt();
    }
    return new StdErrors(error,
View Full Code Here

  }
 
  public static final StdErrors createTrace(Node fromExecNode, Exception exception) {
    int error = 0;
    String message = exception.getMessage();
    Node messageExt = null;
    if (exception instanceof InterpreterException) {
      error = ((InterpreterException) exception).getErrCode();
      messageExt = ((InterpreterException) exception).getMessageExt();
    }
    return new StdErrors(error,
View Full Code Here

   * @param argvList (arguments de argv -> Node.VLIST)
   * @return
   * @throws Exception
   */
  public Node call(Node argvList) throws Exception {
        Node expr=Node.createExpr().append(methode);//.append(symbol); (optimisation l.bruninx, 2012-06-26)
        if(argvList!=null) expr.appendChildsOf(argvList);
        //Heap.push(); (optimisation l.bruninx, 2012-06-26)
        //Heap.setSELF(object);
    return expr.exec(false);
        //Heap.pull();
        //return result;
  }
View Full Code Here

     *              (Ceci évite de recopier inutilement les arguments dans une liste temporaire)
   * @return
   * @throws Exception
   */
  public Node call(Node argvList,int index) throws Exception {
        Node expr=Node.createExpr().append(methode);
        if(argvList!=null) expr.appendChildsOf(argvList,index);
    return expr.exec(false);
  }
View Full Code Here

    public Node external_get_command(Node startAt) throws Exception {
        if (!inUse) {
            throw new InterpreterException(StdErrors.extend(StdErrors.Already_used, "ShellProcess is not runing"));
        }
        startAt.isGoodArgsLength(true, 1);
        return new Node(command);
    }
View Full Code Here

    public Node external_get_exitCode(Node startAt) throws Exception {
        if (inUse) {
            throw new InterpreterException(StdErrors.extend(StdErrors.Already_used, "ShellProcess is runing"));
        }
        startAt.isGoodArgsLength(true, 1);
        return new Node(exitCode);
    }
View Full Code Here

        return null;
    }
   
    public Node external_get_pwd(Node startAt) throws Exception {
        startAt.isGoodArgsLength(true, 1);
        return pwd==null ? Node.createNothing() : new Node(pwd.getAbsolutePath());
    }
View Full Code Here

TOP

Related Classes of abstrasy.Node$ParseBag

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.