pike.git/
src/
pike_types.c
Branch:
Tag:
Non-build tags
All tags
No tags
2001-03-18
2001-03-18 19:46:52 by Per Hedbor <ph@opera.com>
c02ce6eb787fca61d8ab2b01167b5a808f1028d2 (
75
lines) (+
66
/-
9
)
[
Show
|
Annotate
]
Branch:
7.9
Implemented object(is|implements id#) in parse_pike_type with friends
Rev: src/pike_types.c:1.165
5:
\*/ /**/ #include "global.h"
-
RCSID("$Id: pike_types.c,v 1.
164
2001/03/18
14
:
32
:
16
grubba
Exp $");
+
RCSID("$Id: pike_types.c,v 1.
165
2001/03/18
19
:
46
:
52
per
Exp $");
#include <ctype.h> #include "svalue.h" #include "pike_types.h"
417:
void push_assign_type(int marker) { marker -= '0';
-
#ifdef PIKE_DEBUG
*/
+
#ifdef PIKE_DEBUG
if ((marker < 0) || (marker > 9)) { fatal("Bad assign marker: %ld\n", marker); }
799:
case 'o': if(!strcmp(buf,"object")) {
+
while(ISSPACE(**s)) ++*s;
+
if(**s == '(') /* object({is,implements} id) */
+
{
+
int is = 1, id;
+
++*s;
+
if( **s != 'i' )
+
goto bad_type;
+
++*s;
+
if( **s == 'm' )
+
is = 0;
+
while( isidchar( **s ) ) ++*s;
+
while( ISSPACE(**s) ) ++*s;
+
if( !**s )
+
goto bad_type;
+
id = atoi( *s );
+
while( **s >= '0' && **s <= '9' )
+
++*s;
+
while(ISSPACE(**s)) ++*s;
+
if( !**s || **s != ')' )
+
goto bad_type;
+
++*s;
+
push_object_type(is, id);
+
}
+
else
push_object_type(0, 0); break; }
4102:
break; case T_OBJECT:
-
if
(t->car
||
t->cdr)
{
-
Pike
_
error
(
"Not
supported
yet!\n"
);
-
}
else
{
-
my_
strcat
(
tObj
);
+
{
+
INT32 i;
+
my_putchar
(
T_OBJECT);
+
i = (INT32)(ptrdiff_
t
)t
->car
;
+
my_putchar( i );
+
i = (INT32)(ptrdiff_
t
)t
->cdr
;
+
+
if( i > 65535
)
i = 0; /* Not constant between recompilations */
+
+
my
_
putchar
(
(i
>>
24
)
& 0xff)
;
+
my_putchar((i >> 16) & 0xff);
+
my_
putchar
(
(i >> 8
)
& 0xff)
;
+
my_putchar(i & 0xff);
} break;
4558:
case 'o': if(!strcmp(buf,"object")) {
+
while(ISSPACE(**s)) ++*s;
+
if(**s == '(') /* object({is,implements} id) */
+
{
+
int is = 1, id;
+
++*s;
+
if( **s != 'i' )
+
goto bad_type;
+
++*s;
+
if( **s == 'm' )
+
is = 0;
+
while( isidchar( **s ) ) ++*s;
+
while( ISSPACE(**s) ) ++*s;
+
if( !**s )
+
goto bad_type;
+
id = atoi( *s );
+
while( **s >= '0' && **s <= '9' )
+
++*s;
+
while(ISSPACE(**s)) ++*s;
+
if( !**s || **s != ')' )
+
goto bad_type;
+
++*s;
+
push_object_type(is, id);
+
}
+
else
push_object_type(0, 0); break; } goto bad_type;
-
+
case 'p': if(!strcmp(buf,"program")) { push_type(T_PROGRAM); break; } goto bad_type;