Annotation of parser3/src/types/pa_vclass.h, revision 1.48.2.4
1.13 paf 1: /** @file
1.14 paf 2: Parser: @b class parser class decl.
1.13 paf 3:
1.43 paf 4: Copyright (c) 2001-2004 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.48.2.4! paf 11: static const char * const IDENT_VCLASS_H="$Date: 2005/07/27 10:39:40 $";
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*/);
1.48.2.4! paf 35: override const Junction* put_element(Value& self, const String& name, Value* value);
1.48.2.1 paf 36: override Value* create_new_value(Pool& apool, HashStringValue& afields);
1.8 paf 37:
1.47 paf 38: public: // VStateless_class
1.46 paf 39:
1.47 paf 40: /// override to pre-cache property accessors into fields
41: override void add_method(const String& name, Method& method);
1.46 paf 42:
1.47 paf 43: private:
44:
45: Property& add_property(const String& aname);
1.48.2.3 paf 46:
47: private:
48:
49: struct Prevent_info {
50: VClass* _this;
51: Value* self;
52: const String* name;
53: };
54: static const Junction* prevent_overwrite_property(Value* value, Prevent_info* info);
55: static const Junction* prevent_append_if_exists_in_base(Value* value, Prevent_info* info);
1.4 paf 56:
1.25 paf 57: private: // self
1.1 paf 58:
1.40 paf 59: HashStringValue ffields;
1.25 paf 60:
1.1 paf 61: };
62:
63: #endif
E-mail: