34
35 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
36
37 // Implementation of SignatureIterator
38
39 // Signature syntax:
40 //
41 // Signature = "(" {Parameter} ")" ReturnType.
42 // Parameter = FieldType.
43 // ReturnType = FieldType | "V".
44 // FieldType = "B" | "C" | "D" | "F" | "I" | "J" | "S" | "Z" | "L" ClassName ";" | "[" FieldType.
45 // ClassName = string.
46
47
48 SignatureIterator::SignatureIterator(Symbol* signature) {
49 _signature = signature;
50 _parameter_index = 0;
51 }
52
53 void SignatureIterator::expect(char c) {
54 if (_signature->byte_at(_index) != c) fatal(err_msg("expecting %c", c));
55 _index++;
56 }
57
58
59 void SignatureIterator::skip_optional_size() {
60 Symbol* sig = _signature;
61 char c = sig->byte_at(_index);
62 while ('0' <= c && c <= '9') c = sig->byte_at(++_index);
63 }
64
65
66 int SignatureIterator::parse_type() {
67 // Note: This function could be simplified by using "return T_XXX_size;"
68 // instead of the assignment and the break statements. However, it
69 // seems that the product build for win32_i486 with MS VC++ 6.0 doesn't
70 // work (stack underflow for some tests) - this seems to be a VC++ 6.0
71 // compiler bug (was problem - gri 4/27/2000).
72 int size = -1;
73 switch(_signature->byte_at(_index)) {
74 case 'B': do_byte (); if (_parameter_index < 0 ) _return_type = T_BYTE;
|
34
35 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
36
37 // Implementation of SignatureIterator
38
39 // Signature syntax:
40 //
41 // Signature = "(" {Parameter} ")" ReturnType.
42 // Parameter = FieldType.
43 // ReturnType = FieldType | "V".
44 // FieldType = "B" | "C" | "D" | "F" | "I" | "J" | "S" | "Z" | "L" ClassName ";" | "[" FieldType.
45 // ClassName = string.
46
47
48 SignatureIterator::SignatureIterator(Symbol* signature) {
49 _signature = signature;
50 _parameter_index = 0;
51 }
52
53 void SignatureIterator::expect(char c) {
54 if (_signature->byte_at(_index) != c) fatal("expecting %c", c);
55 _index++;
56 }
57
58
59 void SignatureIterator::skip_optional_size() {
60 Symbol* sig = _signature;
61 char c = sig->byte_at(_index);
62 while ('0' <= c && c <= '9') c = sig->byte_at(++_index);
63 }
64
65
66 int SignatureIterator::parse_type() {
67 // Note: This function could be simplified by using "return T_XXX_size;"
68 // instead of the assignment and the break statements. However, it
69 // seems that the product build for win32_i486 with MS VC++ 6.0 doesn't
70 // work (stack underflow for some tests) - this seems to be a VC++ 6.0
71 // compiler bug (was problem - gri 4/27/2000).
72 int size = -1;
73 switch(_signature->byte_at(_index)) {
74 case 'B': do_byte (); if (_parameter_index < 0 ) _return_type = T_BYTE;
|