Annotation of parser3/src/types/pa_vclass.h, revision 1.41

1.13      paf         1: /**    @file
1.14      paf         2:        Parser: @b class parser class decl.
1.13      paf         3: 
1.40      paf         4:        Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.24      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_VCLASS_H
                      9: #define PA_VCLASS_H
1.26      paf        10: 
1.41    ! paf        11: static const char* IDENT_VCLASS_H="$Date: 2003/07/24 11:31:25 $";
1.40      paf        12: 
                     13: // includes
1.1       paf        14: 
1.8       paf        15: #include "pa_vstateless_class.h"
1.1       paf        16: #include "pa_vjunction.h"
1.22      paf        17: #include "pa_vobject.h"
1.1       paf        18: 
1.13      paf        19: /**    stores 
1.25      paf        20: - static fields: VClass::ffields
1.13      paf        21: */
1.40      paf        22: class VClass: public VStateless_class {
1.1       paf        23: public: // Value
                     24:        
1.40      paf        25:        const char* type() const { return name_cstr(); }
1.29      paf        26: 
1.40      paf        27:        override Value* as(const char* atype, bool looking_up);
1.20      parser     28: 
                     29:        /// VClass: true
1.40      paf        30:        override Value& as_expr_result(bool) { return *new VBool(as_bool()); }
1.20      parser     31:        /// VClass: true
1.40      paf        32:        override bool as_bool() const { return true; }
1.1       paf        33: 
1.40      paf        34:        override Value* get_element(const String& aname, Value& aself, bool /*looking_up*/);
                     35:        override bool put_element(const String& aname, Value* avalue, bool replace);
1.41    ! paf        36:        override Value* create_new_value(Pool& apool);
1.8       paf        37: 
                     38: protected:
1.1       paf        39:                
1.40      paf        40:        bool replace_field(const String& name, Value* value) {
1.1       paf        41:                return 
                     42:                        (fbase && fbase->replace_field(name, value)) ||
                     43:                        ffields.put_replace(name, value);
                     44:        }
1.4       paf        45: 
1.25      paf        46: private: // self
1.1       paf        47: 
1.40      paf        48:        HashStringValue ffields;
1.25      paf        49: 
1.1       paf        50: };
                     51: 
                     52: #endif

E-mail: