Annotation of parser3/src/types/pa_vproperty.h, revision 1.3
1.2 paf 1: /** @file
2: Parser: @b property class decl.
3:
1.3 ! paf 4: Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)
1.2 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
6: */
7:
8: #ifndef PA_VPROPERTY_H
9: #define PA_VPROPERTY_H
10:
1.3 ! paf 11: static const char * const IDENT_VPROPERTY_H="$Date: 2005/07/28 11:23:02 $";
1.2 paf 12:
13: // include
14:
15: #include "pa_value.h"
16: #include "pa_vbool.h"
17: #include "pa_property.h"
18:
19: /// property two methods
20: class VProperty: public Value {
21: public: // VProperty
22:
23: override const char* type() const { return "property"; }
24:
25: /// VProperty: 0
26: override VStateless_class *get_class() { bark("is '%s', it has no class"); return 0; }
27:
28: /// VProperty: false
29: override bool is_defined() const { bark("is '%s', it has no 'defined'"); return false; }
30:
31: /// VProperty: false
32: override bool as_bool() const { return is_defined(); }
33:
34: /// VProperty: false
35: override Value& as_expr_result(bool) { return *new VBool(as_bool()); }
36:
37: /// VProperty: property
38: override Property* get_property() { return &fproperty; }
39:
40: public: // usage
41:
42: Property& get() { return fproperty; }
43:
44: private:
45:
46: Property fproperty;
47: };
48:
49:
50: #endif
E-mail: