home *** CD-ROM | disk | FTP | other *** search
- # define white_space_tok 257
- # define l_brc_tok 258
- # define r_brc_tok 259
- # define double_colon_tok 260
- # define semi_colon_tok 261
- # define l_par_tok 262
- # define r_par_tok 263
- # define l_br_tok 264
- # define r_br_tok 265
- # define operator_string_tok 266
- # define name_tok 267
- # define operator_tok 268
- # define string_tok 269
- # define char_tok 270
- # define number_tok 271
- # define special_tok 272
-
- # line 65 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
-
- #include <malloc.h>
- #include <string.h>
- #include <stream.h>
-
- #include "sys.h"
- #include "smg.h"
- #include "scp_err.h"
- #include "mta_use.h"
- #include "cci_use.h"
- #include "scp_yacc.h"
-
- static sos_Bool global_var_init = FALSE; // 09.07.91 (bs)
- static int nesting = 0;
- static char *in_method_of_sos_class = 0;
- sos_Schema_module scp_mdl;
-
- class string_elem
- { char *s;
- string_elem *next;
- friend class strings;
- friend ostream& operator<< (ostream&, strings&);
- };
-
- class strings
- { string_elem *first, *last;
- friend ostream& operator<< (ostream&, strings&);
- public:
- static strings make (char*);
- char*& operator[](int);
- strings& operator+ (strings&);
- };
-
- strings strings::make (char *s1)
- { strings result;
- result.first=new string_elem;
- result.first->s=s1;
- result.first->next=0;
- result.last=result.first;
- return result;
- }
-
- char*& strings::operator[](int i)
- { string_elem *e = first;
- for (; i; i--) e=e->next;
- return e->s;
- }
-
- strings& strings::operator+ (strings &s1)
- { last->next=s1.first;
- last=s1.last;
- return *this;
- }
-
- static ostream& operator<< (ostream& c, strings &s)
- { string_elem *e, *e1;
- e = s.first;
- for (; e; e=e1)
- { e1 = e->next;
- c << e->s;
- c.flush();
- delete e->s;
- delete e;
- }
- return c;
- }
-
- typedef union {strings s; char *c;} YYSTYPE;
-
- #define yyclearin yychar = -1
- #define yyerrok yyerrflag = 0
- extern int yychar;
- extern int yyerrflag;
- #ifndef YYMAXDEPTH
- #define YYMAXDEPTH 150
- #endif
- YYSTYPE yylval, yyval;
- # define YYERRCODE 256
-
- # line 351 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
-
-
- extern yyparse ();
-
- void scp_compile ()
- { yyparse ();
- }
-
- void yyerror (char *s) { err_raise (err_USE, s);}
-
- #include "scp_lex.h"
- int yyexca[] ={
- -1, 1,
- 0, -1,
- -2, 0,
- };
- # define YYNPROD 54
- # define YYLAST 115
- int yyact[]={
-
- 4, 22, 23, 11, 28, 12, 13, 26, 25, 24,
- 19, 29, 14, 15, 16, 27, 22, 23, 11, 28,
- 12, 13, 26, 25, 24, 19, 29, 14, 15, 16,
- 27, 22, 23, 66, 28, 65, 42, 26, 25, 24,
- 19, 29, 43, 44, 45, 27, 22, 23, 50, 30,
- 46, 42, 37, 54, 35, 19, 29, 43, 44, 45,
- 58, 10, 59, 38, 57, 61, 3, 9, 5, 1,
- 60, 17, 8, 7, 6, 36, 51, 47, 20, 21,
- 31, 18, 41, 2, 48, 0, 0, 0, 40, 39,
- 0, 34, 32, 33, 0, 0, 0, 41, 49, 52,
- 0, 55, 56, 40, 39, 62, 0, 53, 0, 0,
- 0, 0, 0, 63, 64 };
- int yypact[]={
-
- -1000, -257, -1000, -1000, -1000, -1000, -1000, -1000, -213, -1000,
- -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -242, -205,
- -212, -210, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -205,
- -1000, -242, -1000, -1000, -214, -227, -204, -1000, -1000, -1000,
- -1000, -1000, -1000, -1000, -1000, -1000, -205, -205, -202, -1000,
- -205, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -205, -205,
- -1000, -1000, -1000, -228, -232, -1000, -1000 };
- int yypgo[]={
-
- 0, 71, 83, 66, 74, 68, 81, 80, 73, 72,
- 79, 78, 77, 76, 63, 54, 75, 67, 61, 69 };
- int yyr1[]={
-
- 0, 19, 19, 2, 2, 3, 3, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 5, 5, 6, 7,
- 8, 8, 8, 8, 8, 9, 9, 10, 11, 12,
- 12, 12, 12, 12, 13, 13, 14, 14, 14, 14,
- 14, 14, 14, 1, 1, 1, 1, 1, 15, 15,
- 16, 16, 17, 18 };
- int yyr2[]={
-
- 0, 0, 5, 2, 3, 2, 2, 2, 2, 3,
- 3, 3, 3, 3, 3, 3, 2, 5, 7, 7,
- 7, 5, 5, 7, 5, 2, 2, 5, 7, 5,
- 9, 9, 5, 5, 2, 3, 2, 2, 2, 3,
- 3, 3, 3, 3, 2, 2, 2, 3, 1, 2,
- 3, 5, 3, 3 };
- int yychk[]={
-
- -1000, -19, -2, -3, 257, -5, -4, -8, -9, -17,
- -18, 260, 262, 263, 269, 270, 271, -1, -6, 267,
- -11, -10, 258, 259, 266, 265, 264, 272, 261, 268,
- 262, -7, -8, -4, -9, -15, -16, 257, -14, -5,
- -17, -18, 263, 269, 270, 271, 260, -12, -15, -3,
- 262, -13, -14, -1, 257, -15, -15, 266, 262, 264,
- 272, 267, -15, -15, -15, 263, 265 };
- int yydef[]={
-
- 1, -2, 2, 3, 4, 5, 6, 16, 0, 7,
- 8, 9, 10, 11, 12, 13, 14, 15, 0, 48,
- 26, 25, 52, 53, 43, 44, 45, 46, 47, 48,
- 17, 0, 21, 22, 0, 27, 49, 50, 24, 36,
- 37, 38, 39, 40, 41, 42, 48, 48, 0, 20,
- 48, 23, 34, 35, 51, 18, 28, 29, 48, 48,
- 32, 33, 19, 0, 0, 30, 31 };
- typedef struct { char *t_name; int t_val; } yytoktype;
- #ifndef YYDEBUG
- # define YYDEBUG 0 /* don't allow debugging */
- #endif
-
- #if YYDEBUG
-
- yytoktype yytoks[] =
- {
- "white_space_tok", 257,
- "l_brc_tok", 258,
- "r_brc_tok", 259,
- "double_colon_tok", 260,
- "semi_colon_tok", 261,
- "l_par_tok", 262,
- "r_par_tok", 263,
- "l_br_tok", 264,
- "r_br_tok", 265,
- "operator_string_tok", 266,
- "name_tok", 267,
- "operator_tok", 268,
- "string_tok", 269,
- "char_tok", 270,
- "number_tok", 271,
- "special_tok", 272,
- "-unknown-", -1 /* ends search */
- };
-
- char * yyreds[] =
- {
- "-no such reduction-",
- "items : /* empty */",
- "items : items item",
- "item : item_except_white_space",
- "item : white_space_tok",
- "item_except_white_space : name_stuff",
- "item_except_white_space : item_except_name_stuff",
- "item_except_name_stuff : l_brc",
- "item_except_name_stuff : r_brc",
- "item_except_name_stuff : double_colon_tok",
- "item_except_name_stuff : l_par_tok",
- "item_except_name_stuff : r_par_tok",
- "item_except_name_stuff : string_tok",
- "item_except_name_stuff : char_tok",
- "item_except_name_stuff : number_tok",
- "item_except_name_stuff : special",
- "name_stuff : name_stuff_except_call",
- "name_stuff : name_or_op l_par_tok",
- "name_dc : name double_colon_tok white_space",
- "name_lp : name_or_op l_par_tok white_space",
- "name_stuff_except_call : name_dc name_lp item_except_white_space",
- "name_stuff_except_call : name_dc name_stuff_except_call",
- "name_stuff_except_call : name_dc item_except_name_stuff",
- "name_stuff_except_call : name_tok white_space any_except_dclp",
- "name_stuff_except_call : operator any_except_dclpsp",
- "name_or_op : name",
- "name_or_op : operator",
- "name : name_tok white_space",
- "operator : operator_tok operator_string white_space",
- "operator_string : white_space operator_string_tok",
- "operator_string : white_space l_par_tok white_space r_par_tok",
- "operator_string : white_space l_br_tok white_space r_br_tok",
- "operator_string : white_space special_tok",
- "operator_string : white_space name_tok",
- "any_except_dclp : any_except_dclpsp",
- "any_except_dclp : special",
- "any_except_dclpsp : name_stuff",
- "any_except_dclpsp : l_brc",
- "any_except_dclpsp : r_brc",
- "any_except_dclpsp : r_par_tok",
- "any_except_dclpsp : string_tok",
- "any_except_dclpsp : char_tok",
- "any_except_dclpsp : number_tok",
- "special : operator_string_tok",
- "special : r_br_tok",
- "special : l_br_tok",
- "special : special_tok",
- "special : semi_colon_tok",
- "white_space : /* empty */",
- "white_space : white_spaces",
- "white_spaces : white_space_tok",
- "white_spaces : white_spaces white_space_tok",
- "l_brc : l_brc_tok",
- "r_brc : r_brc_tok",
- };
- #endif /* YYDEBUG */
- #line 1 "/usr/lib/yaccpar"
- /* @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10 */
-
- /*
- ** Skeleton parser driver for yacc output
- */
-
- /*
- ** yacc user known macros and defines
- */
- #define YYERROR goto yyerrlab
- #define YYACCEPT { free(yys); free(yyv); return(0); }
- #define YYABORT { free(yys); free(yyv); return(1); }
- #define YYBACKUP( newtoken, newvalue )\
- {\
- if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
- {\
- yyerror( "syntax error - cannot backup" );\
- goto yyerrlab;\
- }\
- yychar = newtoken;\
- yystate = *yyps;\
- yylval = newvalue;\
- goto yynewstate;\
- }
- #define YYRECOVERING() (!!yyerrflag)
- #ifndef YYDEBUG
- # define YYDEBUG 1 /* make debugging available */
- #endif
-
- /*
- ** user known globals
- */
- int yydebug; /* set to 1 to get debugging */
-
- /*
- ** driver internal defines
- */
- #define YYFLAG (-1000)
-
- /*
- ** static variables used by the parser
- */
- static YYSTYPE *yyv; /* value stack */
- static int *yys; /* state stack */
-
- static YYSTYPE *yypv; /* top of value stack */
- static int *yyps; /* top of state stack */
-
- static int yystate; /* current state */
- static int yytmp; /* extra var (lasts between blocks) */
-
- int yynerrs; /* number of errors */
-
- int yyerrflag; /* error recovery flag */
- int yychar; /* current input token number */
-
-
- /*
- ** yyparse - return 0 if worked, 1 if syntax error not recovered from
- */
- int
- yyparse()
- {
- register YYSTYPE *yypvt; /* top of value stack for $vars */
- unsigned yymaxdepth = YYMAXDEPTH;
-
- /*
- ** Initialize externals - yyparse may be called more than once
- */
- yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE));
- yys = (int*)malloc(yymaxdepth*sizeof(int));
- if (!yyv || !yys)
- {
- yyerror( "out of memory" );
- return(1);
- }
- yypv = &yyv[-1];
- yyps = &yys[-1];
- yystate = 0;
- yytmp = 0;
- yynerrs = 0;
- yyerrflag = 0;
- yychar = -1;
-
- goto yystack;
- {
- register YYSTYPE *yy_pv; /* top of value stack */
- register int *yy_ps; /* top of state stack */
- register int yy_state; /* current state */
- register int yy_n; /* internal state number info */
-
- /*
- ** get globals into registers.
- ** branch to here only if YYBACKUP was called.
- */
- yynewstate:
- yy_pv = yypv;
- yy_ps = yyps;
- yy_state = yystate;
- goto yy_newstate;
-
- /*
- ** get globals into registers.
- ** either we just started, or we just finished a reduction
- */
- yystack:
- yy_pv = yypv;
- yy_ps = yyps;
- yy_state = yystate;
-
- /*
- ** top of for (;;) loop while no reductions done
- */
- yy_stack:
- /*
- ** put a state and value onto the stacks
- */
- #if YYDEBUG
- /*
- ** if debugging, look up token value in list of value vs.
- ** name pairs. 0 and negative (-1) are special values.
- ** Note: linear search is used since time is not a real
- ** consideration while debugging.
- */
- if ( yydebug )
- {
- register int yy_i;
-
- (void)printf( "State %d, token ", yy_state );
- if ( yychar == 0 )
- (void)printf( "end-of-file\n" );
- else if ( yychar < 0 )
- (void)printf( "-none-\n" );
- else
- {
- for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val == yychar )
- break;
- }
- (void)printf( "%s\n", yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */
- {
- /*
- ** reallocate and recover. Note that pointers
- ** have to be reset, or bad things will happen
- */
- int yyps_index = (yy_ps - yys);
- int yypv_index = (yy_pv - yyv);
- int yypvt_index = (yypvt - yyv);
- yymaxdepth += YYMAXDEPTH;
- yyv = (YYSTYPE*)realloc((char*)yyv,
- yymaxdepth * sizeof(YYSTYPE));
- yys = (int*)realloc((char*)yys,
- yymaxdepth * sizeof(int));
- if (!yyv || !yys)
- {
- yyerror( "yacc stack overflow" );
- return(1);
- }
- yy_ps = yys + yyps_index;
- yy_pv = yyv + yypv_index;
- yypvt = yyv + yypvt_index;
- }
- *yy_ps = yy_state;
- *++yy_pv = yyval;
-
- /*
- ** we have a new state - find out what to do
- */
- yy_newstate:
- if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
- goto yydefault; /* simple state */
- #if YYDEBUG
- /*
- ** if debugging, need to mark whether new token grabbed
- */
- yytmp = yychar < 0;
- #endif
- if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
- yychar = 0; /* reached EOF */
- #if YYDEBUG
- if ( yydebug && yytmp )
- {
- register int yy_i;
-
- (void)printf( "Received token " );
- if ( yychar == 0 )
- (void)printf( "end-of-file\n" );
- else if ( yychar < 0 )
- (void)printf( "-none-\n" );
- else
- {
- for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val == yychar )
- break;
- }
- (void)printf( "%s\n", yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
- goto yydefault;
- if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/
- {
- yychar = -1;
- yyval = yylval;
- yy_state = yy_n;
- if ( yyerrflag > 0 )
- yyerrflag--;
- goto yy_stack;
- }
-
- yydefault:
- if ( ( yy_n = yydef[ yy_state ] ) == -2 )
- {
- #if YYDEBUG
- yytmp = yychar < 0;
- #endif
- if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
- yychar = 0; /* reached EOF */
- #if YYDEBUG
- if ( yydebug && yytmp )
- {
- register int yy_i;
-
- (void)printf( "Received token " );
- if ( yychar == 0 )
- (void)printf( "end-of-file\n" );
- else if ( yychar < 0 )
- (void)printf( "-none-\n" );
- else
- {
- for ( yy_i = 0;
- yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val
- == yychar )
- {
- break;
- }
- }
- (void)printf( "%s\n", yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- /*
- ** look through exception table
- */
- {
- register int *yyxi = yyexca;
-
- while ( ( *yyxi != -1 ) ||
- ( yyxi[1] != yy_state ) )
- {
- yyxi += 2;
- }
- while ( ( *(yyxi += 2) >= 0 ) &&
- ( *yyxi != yychar ) )
- ;
- if ( ( yy_n = yyxi[1] ) < 0 )
- YYACCEPT;
- }
- }
-
- /*
- ** check for syntax error
- */
- if ( yy_n == 0 ) /* have an error */
- {
- /* no worry about speed here! */
- switch ( yyerrflag )
- {
- case 0: /* new error */
- yyerror( "syntax error" );
- goto skip_init;
- yyerrlab:
- /*
- ** get globals into registers.
- ** we have a user generated syntax type error
- */
- yy_pv = yypv;
- yy_ps = yyps;
- yy_state = yystate;
- yynerrs++;
- skip_init:
- case 1:
- case 2: /* incompletely recovered error */
- /* try again... */
- yyerrflag = 3;
- /*
- ** find state where "error" is a legal
- ** shift action
- */
- while ( yy_ps >= yys )
- {
- yy_n = yypact[ *yy_ps ] + YYERRCODE;
- if ( yy_n >= 0 && yy_n < YYLAST &&
- yychk[yyact[yy_n]] == YYERRCODE) {
- /*
- ** simulate shift of "error"
- */
- yy_state = yyact[ yy_n ];
- goto yy_stack;
- }
- /*
- ** current state has no shift on
- ** "error", pop stack
- */
- #if YYDEBUG
- # define _POP_ "Error recovery pops state %d, uncovers state %d\n"
- if ( yydebug )
- (void)printf( _POP_, *yy_ps,
- yy_ps[-1] );
- # undef _POP_
- #endif
- yy_ps--;
- yy_pv--;
- }
- /*
- ** there is no state on stack with "error" as
- ** a valid shift. give up.
- */
- YYABORT;
- case 3: /* no shift yet; eat a token */
- #if YYDEBUG
- /*
- ** if debugging, look up token in list of
- ** pairs. 0 and negative shouldn't occur,
- ** but since timing doesn't matter when
- ** debugging, it doesn't hurt to leave the
- ** tests here.
- */
- if ( yydebug )
- {
- register int yy_i;
-
- (void)printf( "Error recovery discards " );
- if ( yychar == 0 )
- (void)printf( "token end-of-file\n" );
- else if ( yychar < 0 )
- (void)printf( "token -none-\n" );
- else
- {
- for ( yy_i = 0;
- yytoks[yy_i].t_val >= 0;
- yy_i++ )
- {
- if ( yytoks[yy_i].t_val
- == yychar )
- {
- break;
- }
- }
- (void)printf( "token %s\n",
- yytoks[yy_i].t_name );
- }
- }
- #endif /* YYDEBUG */
- if ( yychar == 0 ) /* reached EOF. quit */
- YYABORT;
- yychar = -1;
- goto yy_newstate;
- }
- }/* end if ( yy_n == 0 ) */
- /*
- ** reduction by production yy_n
- ** put stack tops, etc. so things right after switch
- */
- #if YYDEBUG
- /*
- ** if debugging, print the string that is the user's
- ** specification of the reduction which is just about
- ** to be done.
- */
- if ( yydebug )
- (void)printf( "Reduce by (%d) \"%s\"\n",
- yy_n, yyreds[ yy_n ] );
- #endif
- yytmp = yy_n; /* value to switch over */
- yypvt = yy_pv; /* $vars top of value stack */
- /*
- ** Look in goto table for next state
- ** Sorry about using yy_state here as temporary
- ** register variable, but why not, if it works...
- ** If yyr2[ yy_n ] doesn't have the low order bit
- ** set, then there is no action to be done for
- ** this reduction. So, no saving & unsaving of
- ** registers done. The only difference between the
- ** code just after the if and the body of the if is
- ** the goto yy_stack in the body. This way the test
- ** can be made before the choice of what to do is needed.
- */
- {
- /* length of production doubled with extra bit */
- register int yy_len = yyr2[ yy_n ];
-
- if ( !( yy_len & 01 ) )
- {
- yy_len >>= 1;
- yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
- yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
- *( yy_ps -= yy_len ) + 1;
- if ( yy_state >= YYLAST ||
- yychk[ yy_state =
- yyact[ yy_state ] ] != -yy_n )
- {
- yy_state = yyact[ yypgo[ yy_n ] ];
- }
- goto yy_stack;
- }
- yy_len >>= 1;
- yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
- yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
- *( yy_ps -= yy_len ) + 1;
- if ( yy_state >= YYLAST ||
- yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
- {
- yy_state = yyact[ yypgo[ yy_n ] ];
- }
- }
- /* save until reenter driver code */
- yystate = yy_state;
- yyps = yy_ps;
- yypv = yy_pv;
- }
- /*
- ** code supplied by user is placed in this switch
- */
- switch( yytmp )
- {
-
- case 2:
- # line 141 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { cout << yypvt[-0].s; } break;
- case 4:
- # line 146 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 9:
- # line 156 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 10:
- # line 158 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 11:
- # line 160 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 12:
- # line 162 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 13:
- # line 164 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 14:
- # line 166 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 15:
- # line 168 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 17:
- # line 173 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = yypvt[-1].s + strings::make(yypvt[-0].c); } break;
- case 18:
- # line 177 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = yypvt[-2].s + strings::make(yypvt[-1].c) + yypvt[-0].s; } break;
- case 19:
- # line 181 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = yypvt[-2].s + strings::make(yypvt[-1].c) + yypvt[-0].s; } break;
- case 20:
- # line 186 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- {
- sos_String cn = smg_String (yypvt[-2].s[0]).make_String (TEMP_CONTAINER);
- sos_Schema_type tp = scp_mdl.lookup_type (cn, TRUE);
- cn.destroy();
- sos_Bool is_static;
- sos_Bool is_protected;
- sos_Bool is_sos_method = (sos_Bool)(tp != NO_OBJECT
- AND tp.has_type (sos_Class_type_type));
- if (streql (yypvt[-1].s[0], "operator"))
- is_static = FALSE;
- else if (is_sos_method)
- { sos_String mn = smg_String (yypvt[-1].s[0]).make_String (TEMP_CONTAINER);
- sos_Method_List ml =
- sos_Class_type::make(tp).get_inherited_methods()[mn];
- mn.destroy();
- if (ml == NO_OBJECT)
- { is_static = TRUE;
- is_protected = FALSE;
- }
- else
- { sos_Method m = ml.get_nth(1);
- is_static = m.get_is_static();
- is_protected = (sos_Bool)(m.get_kind() EQ sos_PROTECTED);
- }
- }
- strings result;
- if (is_sos_method)
- { if ((is_static AND nesting != 0 AND NOT is_protected) // 25.8.91 (dt)
- OR global_var_init) // 09.07.91 (bs)
- result = yypvt[-2].s + yypvt[-1].s;
- else
- { if (streql (yypvt[-1].s[0], "operator"))
- { delete yypvt[-1].s[0];
- yypvt[-1].s[0] = strdup ("");
- sos_String mn = smg_String (yypvt[-1].s[1]).make_String (TEMP_CONTAINER);
- sos_String on = cci_Method_impl::operator_string (mn);
- yypvt[-1].s[1] = on.make_Cstring();
- on.destroy();
- mn.destroy();
- }
- result = strings::make (strdup ("_")) + yypvt[-2].s + yypvt[-1].s;
- }
- if (NOT is_static)
- { if (nesting == 0)
- { in_method_of_sos_class = strdup (yypvt[-2].s[0]);
- result = result +
- strings::make (strdup ("sos_Typed_id &_tpid"));
- }
- else
- result = result + strings::make (strdup ("_tpid"));
- if (NOT streql (yypvt[-0].s[0], ")"))
- result = result + strings::make (strdup (","));
- }
- result = result + yypvt[-0].s;
- }
- else
- result = yypvt[-2].s + yypvt[-1].s + yypvt[-0].s;
- yyval.s = result;
- } break;
- case 21:
- # line 246 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = yypvt[-1].s + yypvt[-0].s; } break;
- case 22:
- # line 248 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = yypvt[-1].s + yypvt[-0].s; } break;
- case 23:
- # line 250 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { if (streql (yypvt[-2].c, "self") AND in_method_of_sos_class != 0)
- { delete yypvt[-2].c;
- yyval.s = strings::make (strdup (in_method_of_sos_class)) +
- strings::make (strdup ("::make(_tpid,this)")) + yypvt[-1].s + yypvt[-0].s;
- }
- else
- yyval.s = strings::make(yypvt[-2].c) + yypvt[-1].s + yypvt[-0].s;
- } break;
- case 24:
- # line 259 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = yypvt[-1].s + yypvt[-0].s; } break;
- case 27:
- # line 267 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make(yypvt[-1].c) + yypvt[-0].s; } break;
- case 28:
- # line 271 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make(yypvt[-2].c) + yypvt[-1].s + yypvt[-0].s; } break;
- case 29:
- # line 276 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make (yypvt[-0].c) + yypvt[-1].s; } break;
- case 30:
- # line 278 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make (strdup ("()")) + yypvt[-3].s + yypvt[-1].s;
- delete yypvt[-2].c;
- delete yypvt[-0].c;
- } break;
- case 31:
- # line 283 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make (strdup ("[]")) + yypvt[-3].s + yypvt[-1].s;
- delete yypvt[-2].c;
- delete yypvt[-0].c;
- } break;
- case 32:
- # line 288 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make (yypvt[-0].c) + yypvt[-1].s; } break;
- case 33:
- # line 290 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make (yypvt[-0].c) + yypvt[-1].s; } break;
- case 35:
- # line 295 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 39:
- # line 302 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 40:
- # line 304 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 41:
- # line 306 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 42:
- # line 308 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s=strings::make(yypvt[-0].c); } break;
- case 43:
- # line 312 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { // 09.07.91 (bs)
- if ((nesting == 0) AND ((*yypvt[-0].c) == '='))
- global_var_init = TRUE;
- } break;
- case 47:
- # line 320 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { // 09.07.91 (bs)
- global_var_init = FALSE;
- } break;
- case 48:
- # line 325 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make (strdup ("")); } break;
- case 50:
- # line 330 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = strings::make(yypvt[-0].c); } break;
- case 51:
- # line 332 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { yyval.s = yypvt[-1].s + strings::make(yypvt[-0].c); } break;
- case 52:
- # line 336 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { nesting++;
- yyval.s=strings::make(yypvt[-0].c);
- } break;
- case 53:
- # line 342 "/fzi/prost/stone/SOS3-2/src/scp/scp.y"
- { nesting--;
- yyval.s=strings::make(yypvt[-0].c);
- if (nesting == 0)
- { delete in_method_of_sos_class;
- in_method_of_sos_class = 0;
- }
- } break;
- }
- goto yystack; /* reset registers in driver code */
- }
-