Package abstrasy

Examples of abstrasy.ASymbol


  public static ContextualCall createContextualCall(Node vObject, String symbole) {
        //System.out.println("Context OBJ="+vObject);
        //System.out.println("Context SYM="+symbole);
        Node meth;
        try{
            ASymbol symb=new ASymbol(PCoder.unselfing(symbole));
            meth=Heap.getv(vObject, symb);
            /*
             * meth prend déjà une référence vers sont propre heap.
             */
            return new ContextualCall(vObject,symb,meth);
View Full Code Here


        /**
         * si le symbole est défini...
         * vérifier qu'il soit bien immutable...
         */
        if (snode != null) {
            ASymbol symbole=snode.getSymbol();
            if (symbole.getStr().indexOf(PCoder.SEP) >= 0)
                    throw new InterpreterException(StdErrors.Local_symbol_required);
            if (!symbole.isImmutable())
                throw new InterpreterException(StdErrors.Immutable_symbol_required);
        }

        /**
         * préparer la gestion de la pile de manière terminale...
View Full Code Here

    }
    else {
      /**
       * forme : (lazy symbole {...}) affecte le symbole avec {...}...
       */
      ASymbol symbole = startAt.getSubNode(1,Node.TYPE_QSYMBOL).getSymbol();
            if(!symbole.isImmutable()) {
        throw new InterpreterException(StdErrors.Immutable_symbol_required);
      }
      Node section = startAt.getSubNode(2, Node.TYPE_LAZY);
      Heap.defv(symbole, section);
      return null;
View Full Code Here

        /*
         * Récupération du symbole...
         */
        Node symbolen = startAt.elementAt(1);
        symbolen.requireNodeType(Node.TYPE_SYMBOL);
        ASymbol symbole=symbolen.getSymbol();
        /**
         * le symbole ne peut pas être composé...
         */
        if (symbole.getIdsCnt() > 1) throw new InterpreterException(StdErrors.Invalid_symbol);
       
        Node section = startAt.getSubNode(2, Node.TYPE_LAZY);
        Node a, a_before, a_after, res;
        do{
            a = startAt.getSubNode(1, Node.VTYPE_BY_VALUE); // récupération de la donnée (primitive simple)
View Full Code Here

            int tn = arg0.getPCFx_Code();

            //
            // récupération du symbole...
            //
            ASymbol symbole = new ASymbol(PCoder.unselfing(startAt.getSubNode(arg_o++, Node.TYPE_QSYMBOL).getSymbol().getStr()));
            if (symbole.getIdsCnt()!=1)
                throw new InterpreterException(StdErrors.Local_symbol_required);

            //
            // vérification de la fin de l'expression
            //
            startAt.isGoodArgsCnt(arg_o);

            //
            // vérifier que nous somme à l'intérieur d'une section interface...
            //
            Node inode = INTERFACE.get();
            if (inode == null)
                throw new InterpreterException(StdErrors.Abstract_misplaced);

            Interface iface = (Interface) inode.getExternal();

            //
            // c'est parti...
            //

            if (tn == PCoder.PC_FUNCTION)
                iface.declare(symbole.getStr(), Node.TYPE_FUNCTION);

            else
                throw new InterpreterException(StdErrors.Syntax_error);

            return null;
View Full Code Here

        startAt.isGoodArgsCnt(4);
        /*
         * forme :
         *          (slot? 'symbole of delegable) -> TRUE/FALSE
         */
        ASymbol symbole = startAt.getSubNode(1,Node.TYPE_QSYMBOL).getSymbol();
        startAt.requirePCode(2, PCoder.PC_OF);
        Node dn = startAt.getSubNode(3, Node.VTYPE_DELEGABLE);
       
        symbole=new ASymbol(PCoder.unselfing(symbole.getStr()));
        if(symbole.getIdsCnt()!=1)
            throw new InterpreterException(StdErrors.Local_symbol_required);
       
        Node slot=Node.VDelegable.getSlot(dn, symbole.getStr());
       
        return new Node(slot==null ?  Node.FALSE:Node.TRUE);
    }
View Full Code Here

        long primaryType=Node.TYPE_NONE;
       
        //
        // symbole (nom du pattern)
        //
        ASymbol symbole=null;
       
        //
        // récupération du symbole s'il y en a un...
        //
        if(startAt.testSubNode(arg_o, Node.TYPE_QSYMBOL)){
            symbole=startAt.getSubNode(arg_o++, Node.TYPE_QSYMBOL).getSymbol();
            if(!symbole.isImmutable())
               throw new InterpreterException(StdErrors.Immutable_symbol_required);          
        }
       
        //
        // body (corps du pattern : lazy)
View Full Code Here

                {
                    /**
                     * forme : (unregister 'Symbol)
                     *          0          1      
                     */
                    ASymbol symbole = startAt.getSubNode(1, Node.TYPE_QSYMBOL).getSymbol();
                    /**
                     * le symbole ne peut pas être composé...
                     */
                    if (symbole.getIdsCnt()>1)
                        throw new InterpreterException(StdErrors.Invalid_symbol);
                    if (!symbole.isImmutable())
                        throw new InterpreterException(StdErrors.Immutable_symbol_required);
                   
                   
                    Node registry=Heap.getv(ASymbol.SYMBOL_REGISTRY);
                    synchronized(registry){
                        if(((Heap)registry.getExternal()).get(symbole.getStr())==null){
                            throw new InterpreterException(StdErrors.Symbol_not_defined);
                        }
                        else {
                            ((Heap)registry.getExternal()).remove_s(symbole.getStr());
                        }
                    }
                    return null;
                }
            default:
View Full Code Here

    int arg_o=1;
       
        //
        // symbole (nom du pattern)
        //
        ASymbol symbole=null;
       
        //
        // body (corps de l'interface : lazy)
        //
        Node body=null;
       
        //
        // récupération du symbole s'il y en a un...
        //
        if(startAt.testSubNode(arg_o, Node.TYPE_QSYMBOL)){
            symbole=startAt.getSubNode(arg_o++, Node.TYPE_QSYMBOL).getSymbol();
            if(!symbole.isImmutable())
               throw new InterpreterException(StdErrors.Immutable_symbol_required);          
        }
       
        //
        // récupération du corps de l'interface...
View Full Code Here

        }
        else {
            /**
       * forme : (scope 'Symbole ...)
       */
            ASymbol symbole = startAt.getSubNode(1, Node.TYPE_QSYMBOL).getSymbol();
            if (!symbole.isImmutable())
                throw new InterpreterException(StdErrors.Immutable_symbol_required);
            Node section = startAt.getSubNode(2, ARGSTYPE);
            Heap.defv(symbole, getSection(section));
            return null;

View Full Code Here

TOP

Related Classes of abstrasy.ASymbol

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.