Annotation of parser3/src/types/pa_value.C, revision 1.4
1.1 paf 1: /** @file
2: Parser: Value class.
3:
4: Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)
5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.2 paf 6: */
1.1 paf 7:
1.4 ! paf 8: static const char* IDENT_VALUE_C="$Date: 2002/08/01 11:41:21 $";
1.1 paf 9:
10: #include "pa_value.h"
11: #include "pa_vstateless_class.h"
1.4 ! paf 12: #include "pa_vmethod_frame.h"
1.1 paf 13:
14: /// call this before invoking to ensure proper actual numbered params count
15: void Method::check_actual_numbered_params(
16: Value& self, const String& actual_name, Array *actual_numbered_params) const {
17:
18: int actual_count=actual_numbered_params?actual_numbered_params->size():0;
19: if(actual_count<min_numbered_params_count) // not proper count? bark
20: throw Exception("parser.runtime",
21: &actual_name,
22: "native method of %s (%s) accepts minimum %d parameter(s) (%d present)",
23: self.get_class()->name_cstr(),
24: self.type(),
25: min_numbered_params_count,
26: actual_count);
27:
28: }
1.4 ! paf 29:
! 30: Junction::Junction(Pool& apool,
! 31: Value& aself,
! 32: VStateless_class *avclass, const Method *amethod,
! 33: VMethodFrame *amethod_frame,
! 34: Value *arcontext,
! 35: WContext *awcontext,
! 36: const Array *acode) : Pooled(apool),
! 37:
! 38: self(aself),
! 39: vclass(avclass), method(amethod),
! 40: method_frame(amethod_frame),
! 41: rcontext(arcontext),
! 42: wcontext(awcontext),
! 43: code(acode) {
! 44: if(method_frame)
! 45: method_frame->register_junction(*this);
! 46: }
! 47:
! 48: void Junction::invalidate() {
! 49: method_frame=0;
! 50: rcontext=0;
! 51: wcontext=0;
! 52: }
! 53:
! 54: /*
! 55: void Junction::change_context(Junction *source) {
! 56: if(source) {
! 57: method_frame=source->method_frame;
! 58: rcontext=source->rcontext;
! 59: wcontext=source->wcontext;
! 60: } else {
! 61: method_frame=rcontext=0;
! 62: wcontext=0;
! 63: }
! 64: }
! 65: */
! 66:
E-mail: