1: /*
   2:  * Copyright (c) 1983 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)pcc.h	5.1 (Berkeley) 5/30/85
   7:  */
   8: 
   9: /*
  10:  * This file contains definitions for all the constants and structures
  11:  *	needed to use the intermediate code files generated and read by
  12:  *	the Portable C Compiler and related compilers.
  13:  *
  14:  * Rules for changing this code:
  15:  *   1)	All op values must be integer constants -- this permits us to run
  16:  *	a 'sed' script on this file to create %term declarations for yacc.
  17:  *   2)	Because the PCC uses fancy ASG and UNARY macros, assignment
  18:  *	operators must have values 1 greater than corresponding normal
  19:  *	operators, and unary operators must have values 2 greater ditto.
  20:  *   3) Ops used only by f1 must have values >= 150 (PCCF_FORTOPS).
  21:  *   4)	Other language-dependent ops must have values >= 200.
  22:  */
  23: 
  24: # ifndef    PCC_TOKENS
  25: 
  26: # define    PCC_TOKENS  0
  27: 
  28: # define    PCC_ERROR   1   /* an error node */
  29: # define    PCC_FREE    2   /* an unused node */
  30: 
  31: /*
  32:  * Constants.
  33:  */
  34: # define    PCC_STRING  3   /* a string constant */
  35: # define    PCC_ICON    4   /* an integer constant */
  36: # define    PCC_FCON    5   /* a floating point constant */
  37: # define    PCC_DCON    6   /* a double precision f.p. constant */
  38: 
  39: /*
  40:  * Leaf types.
  41:  */
  42: # define    PCC_NAME    7   /* an identifier */
  43: # define    PCC_REG     8   /* a register */
  44: # define    PCC_OREG    9   /* register and offset */
  45: # define    PCC_CCODES  10  /* condition codes */
  46: # define    PCC_FLD     11  /* a bit field */
  47: 
  48: /*
  49:  * Arithmetic operators.
  50:  */
  51: # define    PCC_PLUS    12  /* + */
  52: # define    PCC_PLUSEQ  13  /* += */
  53: # define    PCC_UPLUS   14  /* unary + (for completeness) */
  54: # define    PCC_MINUS   15  /* - */
  55: # define    PCC_MINUSEQ 16  /* -= */
  56: # define    PCC_UMINUS  17  /* unary - */
  57: # define    PCC_MUL     18  /* * */
  58: # define    PCC_MULEQ   19  /* *= */
  59: /* Reserve a slot for 'unary *', which is PCC jargon for PCC_DEREF (yech) */
  60: # define    PCC_DIV     21  /* / */
  61: # define    PCC_DIVEQ   22  /* /= */
  62: # define    PCC_MOD     23  /* % */
  63: # define    PCC_MODEQ   24  /* %= */
  64: # define    PCC_INCR    25  /* ++ */
  65: # define    PCC_DECR    26  /* -- */
  66: # define    PCC_ASSIGN  27  /* = (these last 3 are stretching it) */
  67: 
  68: /*
  69:  * Bit operators.
  70:  */
  71: # define    PCC_AND     28  /* & */
  72: # define    PCC_ANDEQ   29  /* &= */
  73: /* Reserve a slot for 'unary &', jargon for PCC_ADDROF */
  74: # define    PCC_OR      31  /* | */
  75: # define    PCC_OREQ    32  /* |= */
  76: # define    PCC_ER      33  /* ^ */
  77: # define    PCC_EREQ    34  /* ^= */
  78: # define    PCC_LS      35  /* << */
  79: # define    PCC_LSEQ    36  /* <<= */
  80: # define    PCC_RS      37  /* >> */
  81: # define    PCC_RSEQ    38  /* >>= */
  82: # define    PCC_COMPL   39  /* ~ */
  83: 
  84: /*
  85:  * Booleans.
  86:  */
  87: # define    PCC_EQ      40  /* == */
  88: # define    PCC_NE      41  /* != */
  89: # define    PCC_LE      42  /* <= */
  90: # define    PCC_LT      43  /* < */
  91: # define    PCC_GE      44  /* >= */
  92: # define    PCC_GT      45  /* > */
  93: # define    PCC_ULE     46  /* unsigned <= */
  94: # define    PCC_ULT     47  /* unsigned < */
  95: # define    PCC_UGE     48  /* unsigned >= */
  96: # define    PCC_UGT     49  /* unsigned > */
  97: # define    PCC_QUEST   50  /* ? (for conditional expressions) */
  98: # define    PCC_COLON   51  /* : (for conditional expressions) */
  99: # define    PCC_ANDAND  52  /* && */
 100: # define    PCC_OROR    53  /* || */
 101: # define    PCC_NOT     54  /* ! */
 102: 
 103: /*
 104:  * Function calls.
 105:  */
 106: # define    PCC_CALL    55  /* call by value */
 107: /* no ASG */
 108: # define    PCC_UCALL   57  /* call with no arguments */
 109: # define    PCC_FORTCALL    58  /* call by reference? */
 110: /* no ASG */
 111: # define    PCC_UFORTCALL   60  /* ??? */
 112: # ifdef INLINE
 113: # define    PCC_INLINE  61  /* inline function */
 114: /* no ASG */
 115: # define    PCC_UINLINE 63  /* inline with no arguments */
 116: # endif INLINE
 117: 
 118: /*
 119:  * Referencing and dereferencing.
 120:  */
 121: # define    PCC_DEREF   20  /* * */
 122: # define    PCC_ADDROF  30  /* & */
 123: 
 124: /*
 125:  * Special structure operators.
 126:  */
 127: # define    PCC_DOT     64  /* . */
 128: # define    PCC_STREF   65  /* -> */
 129: # define    PCC_STASG   66  /* structure assignment */
 130: # define    PCC_STARG   67  /* an argument of type structure */
 131: # define    PCC_STCALL  68  /* a function of type structure */
 132: /* no ASG */
 133: # define    PCC_USTCALL 70  /* unary structure function */
 134: 
 135: /*
 136:  * Conversions.
 137:  */
 138: # define    PCC_SCONV   71  /* scalar conversion */
 139: # define    PCC_PCONV   72  /* pointer conversion */
 140: # define    PCC_PMCONV  73  /* pointer multiply conversion */
 141: # define    PCC_PVCONV  74  /* pointer divide conversion */
 142: # define    PCC_CAST    75  /* redundant? */
 143: 
 144: /*
 145:  * Bracket types.
 146:  */
 147: # define    PCC_LB      76  /* [ */
 148: # define    PCC_RB      77  /* ] */
 149: 
 150: /*
 151:  * Comma nodes.
 152:  */
 153: # define    PCC_COMOP   78  /* , (in expressions) */
 154: # define    PCC_CM      79  /* , (in argument lists) */
 155: 
 156: /*
 157:  * Miscellaneous.
 158:  */
 159: # define    PCC_FORCE   80  /* result of last expression goes in r0 */
 160: # define    PCC_GOTO    81  /* unconditional goto */
 161: # define    PCC_CBRANCH 82  /* goto label if !test */
 162: # define    PCC_RETURN  83  /* return from function */
 163: # define    PCC_INIT    84  /* initialized data */
 164: # define    PCC_TYPE    85  /* a type */
 165: # define    PCC_CLASS   86  /* a storage class */
 166: 
 167: # define    PCC_MAXOP   86  /* highest numbered PCC op */
 168: 
 169: /*
 170:  * Special codes for interfacing to /lib/f1.
 171:  */
 172: # define    PCCF_FORTOPS    150
 173: # define    PCCF_FTEXT  150 /* pass literal assembler text */
 174: # define    PCCF_FEXPR  151 /* a statement */
 175: # define    PCCF_FSWITCH    152 /* not implemented */
 176: # define    PCCF_FLBRAC 153 /* beginning of subroutine */
 177: # define    PCCF_FRBRAC 154 /* end of subroutine */
 178: # define    PCCF_FEOF   155 /* end of file */
 179: # define    PCCF_FARIF  156 /* not implemented */
 180: # define    PCCF_FLABEL 157 /* an f77 label */
 181: 
 182: # endif	PCC_TOKENS
 183: 
 184: 
 185: /*
 186:  * Types, as encoded in intermediate file cookies.
 187:  */
 188: # define    PCCT_UNDEF  0
 189: # define    PCCT_FARG   1   /* function argument */
 190: # define    PCCT_CHAR   2
 191: # define    PCCT_SHORT  3
 192: # define    PCCT_INT    4
 193: # define    PCCT_LONG   5
 194: # define    PCCT_FLOAT  6
 195: # define    PCCT_DOUBLE 7
 196: # define    PCCT_STRTY  8
 197: # define    PCCT_UNIONTY    9
 198: # define    PCCT_ENUMTY 10
 199: # define    PCCT_MOETY  11  /* member of enum */
 200: # define    PCCT_UCHAR  12
 201: # define    PCCT_USHORT 13
 202: # define    PCCT_UNSIGNED   14
 203: # define    PCCT_ULONG  15
 204: 
 205: /*
 206:  * Type modifiers.
 207:  */
 208: # define    PCCTM_PTR   020
 209: # define    PCCTM_FTN   040
 210: # define    PCCTM_ARY   060
 211: # define    PCCTM_BASETYPE  017
 212: # define    PCCTM_TYPESHIFT 2
 213: 
 214: 
 215: /*
 216:  * Useful macros.  'PCCOM' macros apply to ops.
 217:  */
 218: # define    PCCOM_ASG   1+
 219: # define    PCCOM_UNARY 2+
 220: # define    PCCOM_NOASG (-1)+
 221: # define    PCCOM_NOUNARY   (-2)+
 222: 
 223: # define    PCCM_TRIPLE(op, var, type)  \
 224:     ((op) | ((var) << 8) | (long) (type) << 16)
 225: # define    PCCM_TEXT(s)            \
 226:     PCCM_TRIPLE(PCCF_FTEXT, (strlen(s) + 3) / 4, 0)
 227: # define    PCCM_ADDTYPE(t, m)      \
 228:     ((((t) &~ PCCTM_BASETYPE) << PCCTM_TYPESHIFT) | \
 229:     (m) | ((t) & PCCTM_BASETYPE))

Defined macros

PCCF_FARIF defined in line 179; never used
PCCF_FEOF defined in line 178; never used
PCCF_FEXPR defined in line 174; never used
PCCF_FLABEL defined in line 180; never used
PCCF_FLBRAC defined in line 176; never used
PCCF_FORTOPS defined in line 172; never used
PCCF_FRBRAC defined in line 177; never used
PCCF_FSWITCH defined in line 175; never used
PCCF_FTEXT defined in line 173; used 1 times
PCCM_ADDTYPE defined in line 227; never used
PCCM_TEXT defined in line 225; never used
PCCM_TRIPLE defined in line 223; used 1 times
PCCOM_ASG defined in line 218; never used
PCCOM_NOASG defined in line 220; never used
PCCOM_NOUNARY defined in line 221; never used
PCCOM_UNARY defined in line 219; never used
PCCTM_ARY defined in line 210; never used
PCCTM_BASETYPE defined in line 211; used 2 times
PCCTM_FTN defined in line 209; never used
PCCTM_PTR defined in line 208; never used
PCCTM_TYPESHIFT defined in line 212; used 1 times
PCCT_CHAR defined in line 190; never used
PCCT_DOUBLE defined in line 195; never used
PCCT_ENUMTY defined in line 198; never used
PCCT_FARG defined in line 189; never used
PCCT_FLOAT defined in line 194; never used
PCCT_INT defined in line 192; never used
PCCT_LONG defined in line 193; never used
PCCT_MOETY defined in line 199; never used
PCCT_SHORT defined in line 191; never used
PCCT_STRTY defined in line 196; never used
PCCT_UCHAR defined in line 200; never used
PCCT_ULONG defined in line 203; never used
PCCT_UNDEF defined in line 188; never used
PCCT_UNIONTY defined in line 197; never used
PCCT_UNSIGNED defined in line 202; never used
PCCT_USHORT defined in line 201; never used
PCC_ADDROF defined in line 122; never used
PCC_AND defined in line 71; never used
PCC_ANDAND defined in line 99; never used
PCC_ANDEQ defined in line 72; never used
PCC_ASSIGN defined in line 66; never used
PCC_CALL defined in line 106; never used
PCC_CAST defined in line 142; never used
PCC_CBRANCH defined in line 161; never used
PCC_CCODES defined in line 45; never used
PCC_CLASS defined in line 165; never used
PCC_CM defined in line 154; never used
PCC_COLON defined in line 98; never used
PCC_COMOP defined in line 153; never used
PCC_COMPL defined in line 82; never used
PCC_DCON defined in line 37; never used
PCC_DECR defined in line 65; never used
PCC_DEREF defined in line 121; never used
PCC_DIV defined in line 60; never used
PCC_DIVEQ defined in line 61; never used
PCC_DOT defined in line 127; never used
PCC_EQ defined in line 87; never used
PCC_ER defined in line 76; never used
PCC_EREQ defined in line 77; never used
PCC_ERROR defined in line 28; never used
PCC_FCON defined in line 36; never used
PCC_FLD defined in line 46; never used
PCC_FORCE defined in line 159; never used
PCC_FORTCALL defined in line 109; never used
PCC_FREE defined in line 29; never used
PCC_GE defined in line 91; never used
PCC_GOTO defined in line 160; never used
PCC_GT defined in line 92; never used
PCC_ICON defined in line 35; never used
PCC_INCR defined in line 64; never used
PCC_INIT defined in line 163; never used
PCC_INLINE defined in line 113; never used
PCC_LB defined in line 147; never used
PCC_LE defined in line 89; never used
PCC_LS defined in line 78; never used
PCC_LSEQ defined in line 79; never used
PCC_LT defined in line 90; never used
PCC_MAXOP defined in line 167; never used
PCC_MINUS defined in line 54; never used
PCC_MINUSEQ defined in line 55; never used
PCC_MOD defined in line 62; never used
PCC_MODEQ defined in line 63; never used
PCC_MUL defined in line 57; never used
PCC_MULEQ defined in line 58; never used
PCC_NAME defined in line 42; never used
PCC_NE defined in line 88; never used
PCC_NOT defined in line 101; never used
PCC_OR defined in line 74; never used
PCC_OREG defined in line 44; never used
PCC_OREQ defined in line 75; never used
PCC_OROR defined in line 100; never used
PCC_PCONV defined in line 139; never used
PCC_PLUS defined in line 51; never used
PCC_PLUSEQ defined in line 52; never used
PCC_PMCONV defined in line 140; never used
PCC_PVCONV defined in line 141; never used
PCC_QUEST defined in line 97; never used
PCC_RB defined in line 148; never used
PCC_REG defined in line 43; never used
PCC_RETURN defined in line 162; never used
PCC_RS defined in line 80; never used
PCC_RSEQ defined in line 81; never used
PCC_SCONV defined in line 138; never used
PCC_STARG defined in line 130; never used
PCC_STASG defined in line 129; never used
PCC_STCALL defined in line 131; never used
PCC_STREF defined in line 128; never used
PCC_STRING defined in line 34; never used
PCC_TOKENS defined in line 26; used 1 times
  • in line 24
PCC_TYPE defined in line 164; never used
PCC_UCALL defined in line 108; never used
PCC_UFORTCALL defined in line 111; never used
PCC_UGE defined in line 95; never used
PCC_UGT defined in line 96; never used
PCC_UINLINE defined in line 115; never used
PCC_ULE defined in line 93; never used
PCC_ULT defined in line 94; never used
PCC_UMINUS defined in line 56; never used
PCC_UPLUS defined in line 53; never used
PCC_USTCALL defined in line 133; never used
Last modified: 1986-12-15
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3437
Valid CSS Valid XHTML 1.0 Strict