Annotation of parser3/src/types/pa_vform.h, revision 1.2
1.1 paf 1: /*
2: Parser
3: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
4: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
5:
1.2 ! paf 6: $Id: pa_vform.h,v 1.1 2001/03/13 19:35:08 paf Exp $
1.1 paf 7: */
8:
9: #ifndef PA_VFORM_H
10: #define PA_VFORM_H
11:
12: #include "pa_vstateless_class.h"
13: #include "_form.h"
14: #include "pa_common.h"
15:
16: class VForm : public VStateless_class {
17: public: // Value
18:
19: // all: for error reporting after fail(), etc
20: const char *type() const { return "form"; }
21:
1.2 ! paf 22: // vform: this
! 23: VStateless_class *get_class() { return this; }
! 24:
1.1 paf 25: // form: CLASS,BASE,method,field
26: Value *get_element(const String& aname) {
27: // $CLASS,$BASE,$method
28: if(Value *result=VStateless_class::get_element(aname))
29: return result;
30:
31: // $element
32: return static_cast<Value *>(ffields.get(aname));
33: }
34:
35: public: // usage
36:
37: VForm(Pool& apool) : VStateless_class(apool, form_base_class),
38: ffields(apool) {
39:
40: construct_fields();
41: }
42:
1.2 ! paf 43: // Hash& fields() { return ffields; }
1.1 paf 44:
45: private:
46:
47: void construct_fields();
48:
49: private:
50:
51: Hash ffields;
52:
53: };
54:
55: #endif
E-mail: