Annotation of parser3/src/types/pa_vjunction.h, revision 1.28
1.3 paf 1: /** @file
1.4 paf 2: Parser: @b junction class decl.
1.3 paf 3:
1.27 misha 4: Copyright (c) 2001-2009 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.28 ! misha 11: static const char * const IDENT_VJUNCTION_H="$Date: 2009-04-18 09:16:26 $";
1.20 paf 12:
13: // include
1.1 paf 14:
15: #include "pa_value.h"
1.20 paf 16: #include "pa_junction.h"
1.1 paf 17:
1.4 paf 18: /// junction is method+self+context, implemented with Junction
1.20 paf 19: class VJunction: public Value {
1.1 paf 20: public: // VJunction
21:
1.20 paf 22: override const char* type() const { return "junction"; }
1.13 paf 23:
24: /// VJunction: 0
1.20 paf 25: override VStateless_class *get_class() { return 0; }
1.8 parser 26:
1.18 paf 27: /// VJunction: false
1.20 paf 28: override bool is_defined() const { return false; }
1.8 parser 29:
1.18 paf 30: /// VJunction: false
1.20 paf 31: override bool as_bool() const { return is_defined(); }
1.18 paf 32:
33: /// VJunction: false
1.25 misha 34: override Value& as_expr_result(bool);
1.1 paf 35:
1.5 paf 36: /// VJunction: method, root,self,rcontext, code
1.23 paf 37: override Junction* get_junction() { return &fjunction; }
1.1 paf 38:
39: public: // usage
40:
1.23 paf 41: /// Code-Junction constructor
42: VJunction(Value& aself,
43: const Method* amethod,
44: VMethodFrame* amethod_frame,
45: Value* arcontext,
46: WContext* awcontext,
47: ArrayOperation* acode): fjunction(aself, amethod, amethod_frame, arcontext, awcontext, acode) {}
48:
49: /// Method-Junction or Getter-Junction constructor
50: VJunction(Value& aself,
51: const Method* amethod,
1.26 misha 52: bool ais_getter=false,
53: String* aauto_name=0
54: ): fjunction(aself, amethod, ais_getter, aauto_name) {}
1.23 paf 55:
56: const Junction& junction() const { return fjunction; }
1.1 paf 57:
1.27 misha 58: inline VJunction *get(Value& aself){
59: return &(fjunction.self)==&aself?this:new VJunction(aself, fjunction.method);
60: }
61:
1.28 ! misha 62: #ifdef USE_DESTRUCTORS
! 63: inline void set_temporal(bool avalue){
! 64: fjunction.is_temporal=avalue;
! 65: }
! 66: #endif
! 67:
! 68: void reattach(WContext *new_wcontext);
! 69:
1.1 paf 70: private:
71:
1.23 paf 72: Junction fjunction;
1.1 paf 73: };
74:
75:
76: #endif
E-mail: