Annotation of parser3/src/types/pa_vjunction.h, revision 1.24

1.3       paf         1: /**    @file
1.4       paf         2:        Parser: @b junction class decl.
1.3       paf         3: 
1.24    ! paf         4:        Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)
1.12      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_VJUNCTION_H
                      9: #define PA_VJUNCTION_H
1.14      paf        10: 
1.24    ! paf        11: static const char * const IDENT_VJUNCTION_H="$Date: 2005/08/08 08:41:51 $";
1.20      paf        12: 
                     13: // include
1.1       paf        14: 
                     15: #include "pa_value.h"
1.8       parser     16: #include "pa_vbool.h"
1.20      paf        17: #include "pa_junction.h"
1.1       paf        18: 
1.4       paf        19: /// junction is method+self+context, implemented with Junction
1.20      paf        20: class VJunction: public Value {
1.1       paf        21: public: // VJunction
                     22: 
1.20      paf        23:        override const char* type() const { return "junction"; }
1.13      paf        24: 
                     25:        /// VJunction: 0
1.20      paf        26:        override VStateless_class *get_class() { return 0; }
1.8       parser     27: 
1.18      paf        28:        /// VJunction: false
1.20      paf        29:        override bool is_defined() const { return false; }
1.8       parser     30: 
1.18      paf        31:        /// VJunction: false
1.20      paf        32:        override bool as_bool() const { return is_defined(); }
1.18      paf        33: 
                     34:        /// VJunction: false
1.20      paf        35:        override Value& as_expr_result(bool) { return *new VBool(as_bool()); }
1.1       paf        36: 
1.5       paf        37:        /// VJunction: method, root,self,rcontext, code
1.23      paf        38:        override Junction* get_junction() { return &fjunction; }
1.1       paf        39: 
                     40: public: // usage
                     41: 
1.23      paf        42:        /// Code-Junction constructor
                     43:        VJunction(Value& aself,
                     44:                const Method* amethod,
                     45:                VMethodFrame* amethod_frame,
                     46:                Value* arcontext,
                     47:                WContext* awcontext,
                     48:                ArrayOperation* acode): fjunction(aself, amethod, amethod_frame, arcontext, awcontext, acode) {}
                     49: 
                     50:        /// Method-Junction or Getter-Junction constructor
                     51:        VJunction(Value& aself,
                     52:                const Method* amethod,
                     53:                bool ais_getter=false): fjunction(aself, amethod, ais_getter) {}
                     54: 
                     55:        const Junction& junction() const { return fjunction; }
1.1       paf        56: 
                     57: private:
                     58: 
1.23      paf        59:        Junction fjunction;
1.1       paf        60: };
                     61: 
                     62: 
                     63: #endif

E-mail: