Annotation of parser3/src/types/pa_vmethod_frame.C, revision 1.6.12.2
1.2 paf 1: /** @file
2: Parser: method frame class.
3:
1.6.12.1 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:
1.6.12.2! paf 8: static const char * const IDENT_VSTATELESS_CLASS_C="$Date: 2005/08/05 13:03:05 $";
1.2 paf 9:
10: #include "pa_vmethod_frame.h"
11: #include "pa_request.h"
12:
13: // globals
14:
15: const String result_var_name(RESULT_VAR_NAME);
16:
17: // MethodParams: methods
18:
1.6.12.2! paf 19: Value& MethodParams::get_processed(Value* value, const char* msg, int index, Request& r) {
! 20: return r.process_to_value(as_junction(value, msg, index), false /*do not intercept string*/);
1.2 paf 21: }
22:
23: // VMethodFrame: methods
24:
25: VMethodFrame::VMethodFrame(
26: const Junction& ajunction/*info: always method-junction*/,
27: VMethodFrame *acaller) :
28: WContext(0/*empty*/, 0 /* no parent, junctions can be reattached only up to VMethodFrame */),
29:
1.4 paf 30: fcaller(acaller),
1.2 paf 31:
32: store_param_index(0),
33: my(0), fnumbered_params(0),
34: fself(0),
35:
1.4 paf 36: fresult_initial_void(0),
37:
38: junction(ajunction) {
1.2 paf 39:
40: if(junction.method->max_numbered_params_count) // this method uses numbered params?
41: fnumbered_params=new MethodParams;
42: else {
43: my=new HashStringValue;
44:
45: const Method &method=*junction.method;
46: if(method.locals_names) { // are there any local var names?
47: // remember them
48: // those are flags that fname is local == to be looked up in 'my'
49: for(Array_iterator<const String*> i(*method.locals_names); i.has_next(); ) {
50: // speedup: not checking for clash with "result" fname
51: const String& fname=*i.next();
52: set_my_variable(fname, *new VVoid);
53: }
54: }
55: { // always there is one local: $result
56: fresult_initial_void=new VVoid;
57: set_my_variable(result_var_name, *fresult_initial_void);
58: }
59: }
60: }
61:
62: Value* VMethodFrame::get_result_variable() {
63: Value* result=my?my->get(result_var_name):0;
64: return result!=fresult_initial_void ? result : 0;
65: }
E-mail: