Annotation of parser3/src/types/pa_vclass.h, revision 1.37.4.1
1.13 paf 1: /** @file
1.14 paf 2: Parser: @b class parser class decl.
1.13 paf 3:
1.23 paf 4: Copyright (c) 2001, 2002 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.37.4.1! paf 11: static const char* IDENT_VCLASS_H="$Date: 2002/08/15 07:53:07 $";
1.1 paf 12:
1.8 paf 13: #include "pa_vstateless_class.h"
1.1 paf 14: #include "pa_vjunction.h"
1.22 paf 15: #include "pa_vobject.h"
1.1 paf 16:
1.13 paf 17: /** stores
1.25 paf 18: - static fields: VClass::ffields
1.13 paf 19: */
1.8 paf 20: class VClass : public VStateless_class {
1.1 paf 21: public: // Value
22:
1.28 paf 23: const char *type() const { return name_cstr(); }
1.29 paf 24:
1.37 paf 25: /*override*/ Value *as(const char *atype, bool looking_up);
1.20 parser 26:
27: /// VClass: true
28: Value *as_expr_result(bool) { return NEW VBool(pool(), as_bool()); }
29: /// VClass: true
30: bool as_bool() const { return true; }
1.9 paf 31:
1.37.4.1! paf 32: /*override*/ Value *get_element(const String& aname, Value& aself, bool /*looking_up*/);
1.34 paf 33: /*override*/ bool put_element(const String& aname, Value *avalue, bool replace);
34: /*override*/ Value *create_new_value(Pool& );
1.1 paf 35:
36: public: // usage
37:
1.8 paf 38: VClass(Pool& apool) : VStateless_class(apool),
39: ffields(apool) {
1.1 paf 40: }
1.8 paf 41:
42: protected:
1.1 paf 43:
44: bool replace_field(const String& name, Value *value) {
45: return
46: (fbase && fbase->replace_field(name, value)) ||
47: ffields.put_replace(name, value);
48: }
1.4 paf 49:
1.25 paf 50: private: // self
1.1 paf 51:
52: Hash ffields;
1.25 paf 53:
1.1 paf 54: };
55:
56: #endif
E-mail: