Annotation of researchv10no/cmd/f77/gram.expr, revision 1.1

1.1     ! root        1: funarglist:
        !             2:                { $$ = 0; }
        !             3:        | funargs
        !             4:        ;
        !             5: 
        !             6: funargs:  expr
        !             7:                { $$ = mkchain($1, CHNULL); }
        !             8:        | funargs SCOMMA expr
        !             9:                { $$ = hookup($1, mkchain($3,CHNULL) ); }
        !            10:        ;
        !            11: 
        !            12: 
        !            13: expr:    uexpr
        !            14:        | SLPAR expr SRPAR      { $$ = $2; }
        !            15:        | complex_const
        !            16:        ;
        !            17: 
        !            18: uexpr:   lhs
        !            19:        | simple_const
        !            20:        | expr addop expr   %prec SPLUS
        !            21:                { $$ = mkexpr($2, $1, $3); }
        !            22:        | expr SSTAR expr
        !            23:                { $$ = mkexpr(OPSTAR, $1, $3); }
        !            24:        | expr SSLASH expr
        !            25:                { $$ = mkexpr(OPSLASH, $1, $3); }
        !            26:        | expr SPOWER expr
        !            27:                { $$ = mkexpr(OPPOWER, $1, $3); }
        !            28:        | addop expr  %prec SSTAR
        !            29:                { if($1 == OPMINUS)
        !            30:                        $$ = mkexpr(OPNEG, $2, ENULL);
        !            31:                  else  $$ = $2;
        !            32:                }
        !            33:        | expr relop expr  %prec SEQ
        !            34:                { $$ = mkexpr($2, $1, $3); }
        !            35:        | expr SEQV expr
        !            36:                { NO66(".EQV. operator");
        !            37:                  $$ = mkexpr(OPEQV, $1,$3); }
        !            38:        | expr SNEQV expr
        !            39:                { NO66(".NEQV. operator");
        !            40:                  $$ = mkexpr(OPNEQV, $1, $3); }
        !            41:        | expr SOR expr
        !            42:                { $$ = mkexpr(OPOR, $1, $3); }
        !            43:        | expr SAND expr
        !            44:                { $$ = mkexpr(OPAND, $1, $3); }
        !            45:        | SNOT expr
        !            46:                { $$ = mkexpr(OPNOT, $2, ENULL); }
        !            47:        | expr SCONCAT expr
        !            48:                { NO66("concatenation operator //");
        !            49:                  $$ = mkexpr(OPCONCAT, $1, $3); }
        !            50:        ;
        !            51: 
        !            52: addop:   SPLUS         { $$ = OPPLUS; }
        !            53:        | SMINUS        { $$ = OPMINUS; }
        !            54:        ;
        !            55: 
        !            56: relop:   SEQ   { $$ = OPEQ; }
        !            57:        | SGT   { $$ = OPGT; }
        !            58:        | SLT   { $$ = OPLT; }
        !            59:        | SGE   { $$ = OPGE; }
        !            60:        | SLE   { $$ = OPLE; }
        !            61:        | SNE   { $$ = OPNE; }
        !            62:        ;
        !            63: 
        !            64: lhs:    name
        !            65:                { $$ = mkprim($1, PNULL, CHNULL); }
        !            66:        | name substring
        !            67:                { NO66("substring operator :");
        !            68:                  $$ = mkprim($1, PNULL, $2); }
        !            69:        | name SLPAR funarglist SRPAR
        !            70:                { $$ = mkprim($1, mklist($3), CHNULL); }
        !            71:        | name SLPAR funarglist SRPAR substring
        !            72:                { NO66("substring operator :");
        !            73:                  $$ = mkprim($1, mklist($3), $5); }
        !            74:        ;
        !            75: 
        !            76: substring:  SLPAR opt_expr SCOLON opt_expr SRPAR
        !            77:                { $$ = mkchain($2, mkchain($4,CHNULL)); }
        !            78:        ;
        !            79: 
        !            80: opt_expr:
        !            81:                { $$ = 0; }
        !            82:        | expr
        !            83:        ;
        !            84: 
        !            85: simple:          name
        !            86:                { if($1->vclass == CLPARAM)
        !            87:                        $$ = (expptr) cpexpr(
        !            88:                                ( (struct Paramblock *) ($1) ) -> paramval);
        !            89:                }
        !            90:        | simple_const
        !            91:        ;
        !            92: 
        !            93: simple_const:   STRUE  { $$ = mklogcon(1); }
        !            94:        | SFALSE        { $$ = mklogcon(0); }
        !            95:        | SHOLLERITH  { $$ = mkstrcon(toklen, token); }
        !            96:        | SICON = { $$ = mkintcon( convci(toklen, token) ); }
        !            97:        | SRCON = { $$ = mkrealcon(TYREAL, convcd(toklen, token)); }
        !            98:        | SDCON = { $$ = mkrealcon(TYDREAL, convcd(toklen, token)); }
        !            99:        ;
        !           100: 
        !           101: complex_const:  SLPAR uexpr SCOMMA uexpr SRPAR
        !           102:                { $$ = mkcxcon($2,$4); }
        !           103:        ;
        !           104: 
        !           105: bit_const:  SHEXCON
        !           106:                { NOEXT("hex constant");
        !           107:                  $$ = mkbitcon(4, toklen, token); }
        !           108:        | SOCTCON
        !           109:                { NOEXT("octal constant");
        !           110:                  $$ = mkbitcon(3, toklen, token); }
        !           111:        | SBITCON
        !           112:                { NOEXT("binary constant");
        !           113:                  $$ = mkbitcon(1, toklen, token); }
        !           114:        ;
        !           115: 
        !           116: fexpr:   unpar_fexpr
        !           117:        | SLPAR fexpr SRPAR
        !           118:                { $$ = $2; }
        !           119:        ;
        !           120: 
        !           121: unpar_fexpr:     lhs
        !           122:        | simple_const
        !           123:        | fexpr addop fexpr   %prec SPLUS
        !           124:                { $$ = mkexpr($2, $1, $3); }
        !           125:        | fexpr SSTAR fexpr
        !           126:                { $$ = mkexpr(OPSTAR, $1, $3); }
        !           127:        | fexpr SSLASH fexpr
        !           128:                { $$ = mkexpr(OPSLASH, $1, $3); }
        !           129:        | fexpr SPOWER fexpr
        !           130:                { $$ = mkexpr(OPPOWER, $1, $3); }
        !           131:        | addop fexpr  %prec SSTAR
        !           132:                { if($1 == OPMINUS)
        !           133:                        $$ = mkexpr(OPNEG, $2, ENULL);
        !           134:                  else  $$ = $2;
        !           135:                }
        !           136:        | fexpr SCONCAT fexpr
        !           137:                { NO66("concatenation operator //");
        !           138:                  $$ = mkexpr(OPCONCAT, $1, $3); }
        !           139:        ;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.