Package abstrasy

Examples of abstrasy.Node$ParseBag


     * @return
     * @throws Exception
     */
    private static final Object getArgExternalInstance(Node commande, int argindex, int accessType) throws Exception {
        // retourne l'argument Objet (VObject)
        Node src = commande.getSubNode(argindex, Node.TYPE_NAMESPACE);
        src.requireAccessType(accessType);
        // objet client externe...
        return src.getExternalInstanceOf();
    }
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;
    }
View Full Code Here

     * @param source
     * @return Node
     * @throws Exception
     */
    public static final Node precompile(String source) throws Exception {
        Node cnode = Node.compile(source);
        cnode = unImbric_(cnode); // transforme en fonction systématiquement...
        if (!cnode.isLazy()) {
            cnode = Node.createLazy().append(cnode);
        }
        return cnode;
    }
View Full Code Here

         * @return Node correspondant à l'expression forgée
         * @throws Exception
         */
        public static final Node createInitExpr(Node classNode, Node... args) throws Exception {
            // générer l'expression (new className)...
            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

        optAccessList.set(id, startAt.getSubNode(2, Node.VTYPE_VALUABLE));
        return null;
    }

    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

    int s = c.get(Calendar.SECOND);
    int ms = c.get(Calendar.MILLISECOND);
    int dd = c.get(Calendar.DAY_OF_MONTH);
    int mm = c.get(Calendar.MONTH);
    int yy = c.get(Calendar.YEAR);
        Node listOfPairs = Node.createHash();
        Hash hash=listOfPairs.getHash();
    hash.store(new Node(K_DAY), new Node(dd));
    hash.store(new Node(K_MONTH), new Node(mm + 1));
    hash.store(new Node(K_YEAR), new Node(yy));
    hash.store(new Node(K_HOUR), new Node(h));
    hash.store(new Node(K_MINUTE), new Node(m));
    hash.store(new Node(K_SECOND), new Node(s));
    hash.store(new Node(K_MILLIS), new Node(ms));
    return listOfPairs;
  }
View Full Code Here

    hash.store(new Node(K_MILLIS), new Node(ms));
    return listOfPairs;
  }

    private static  Node intToListOfPairs(int h, int m, int s, int ms, int dd, int mm, int yy) throws Exception {
        Node listOfPairs = Node.createHash();
        Hash hash=listOfPairs.getHash();
    if (dd != 0)
      hash.store(new Node(K_DAY), new Node(dd));
   
    if (mm != 0)
      hash.store(new Node(K_MONTH), new Node(mm));
   
    if (yy != 0)
      hash.store(new Node(K_YEAR), new Node(yy));
   
    if (h != 0)
      hash.store(new Node(K_HOUR), new Node(h));
   
    if (m != 0)
      hash.store(new Node(K_MINUTE), new Node(m + 1));
   
    if (s != 0)
      hash.store(new Node(K_SECOND), new Node(s));
   
    if (ms != 0)
      hash.store(new Node(K_MILLIS), new Node(ms));
   
    if (listOfPairs.size() == 0)
      hash.store(new Node(K_MILLIS), new Node(ms));
   
    return listOfPairs;
  }
View Full Code Here

    return listOfPairs;
  }

    public static Node external_milliseconds_to_delta(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 2);
        Node anode = startAt.getSubNode(1, Node.TYPE_NUMBER);
    long millis = (long) anode.getNumber();
    long mps = 1000;
    long mpm = mps * 60;
    long mph = mpm * 60;
    long mpd = mph * 24;
    long d = millis / mpd;
View Full Code Here

    return intToListOfPairs((int) h, (int) m + 1, (int) s, (int) millis, (int) d, 0, 0);
  }

    public static Node external_delta_to_milliseconds(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 2);
        Node anode = startAt.getSubNode(1, Node.TYPE_HASH);
    long mps = 1000;
    long mpm = mps * 60;
    long mph = mpm * 60;
    long mpd = mph * 24;
        Hash hash=anode.getHash();
    int h = getNumPairValueIfExists(0, hash, new Node(K_HOUR));
    int m = getNumPairValueIfExists(0, hash, new Node(K_MINUTE));
    int s = getNumPairValueIfExists(0, hash, new Node(K_SECOND));
    int ms = getNumPairValueIfExists(0, hash, new Node(K_MILLIS));
    int dd = getNumPairValueIfExists(0, hash, new Node(K_DAY));
    int mm = getNumPairValueIfExists(0, hash, new Node(K_MONTH));
    int yy = getNumPairValueIfExists(0, hash, new Node(K_YEAR));
    if ((mm != 0)||(yy != 0))  {
      throw new InterpreterException(StdErrors.extend(StdErrors.Invalid_parameter,"unreliable"));
    }
    return new Node(ms + (s * mps) + (m * mpm) + (h * mph) + (dd * mpd));
  }
 
View Full Code Here

    return new Node(ms + (s * mps) + (m * mpm) + (h * mph) + (dd * mpd));
  }

  public Node external_milliseconds(Node startAt) throws Exception {
        startAt.isGoodArgsCnt(1);
    return new Node(date.getTime());
  }
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.