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

1.13      paf         1: /**    @file
1.14      paf         2:        Parser: @b class parser class decl.
1.13      paf         3: 
1.39      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.39.2.2! paf        11: static const char* IDENT_VCLASS_H="$Date: 2003/01/28 15:42:41 $";
        !            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.8       paf        22: class VClass : public VStateless_class {
1.1       paf        23: public: // Value
                     24:        
1.28      paf        25:        const char *type() const { return name_cstr(); }
1.29      paf        26: 
1.39.2.2! paf        27:        override ValuePtr as(const char *atype, bool looking_up);
1.20      parser     28: 
                     29:        /// VClass: true
1.39.2.2! paf        30:        ValuePtr as_expr_result(bool) { return ValuePtr(new VBool(as_bool())); }
1.20      parser     31:        /// VClass: true
                     32:        bool as_bool() const { return true; }
1.9       paf        33: 
1.39.2.2! paf        34:        override ValuePtr get_element(ConstStringPtr aname, Value& aself, bool /*looking_up*/);
        !            35:        override bool put_element(ConstStringPtr aname, ValuePtr avalue, bool replace);
        !            36:        override ValuePtr create_new_value();
1.8       paf        37: 
                     38: protected:
1.1       paf        39:                
1.39.2.2! paf        40:        bool replace_field(ConstStringPtr name, ValuePtr 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.39.2.2! paf        48:        HashStringValue ffields;
1.25      paf        49: 
1.1       paf        50: };
                     51: 
                     52: #endif

E-mail: