Beispiel #1
0
void StrucType()
{
  /*
    StrucType -> ArrayType | RecType | PointerType | ProcType
  */

  if ( debugMode) printf( "In StrucType\n");
  switch( sym) 
  {
    case ARRAY_SYM:
      ArrayType();
      break;
    case RECORD_SYM:
      RecType();
      break;
    case POINTER_SYM:
      PointerType();
      break;
    case PROCEDURE_SYM:
      ProcType();
      break;
    default:
      error( invalid_sym, 1);
  }

  if ( debugMode) printf( "Out StrucType\n");
}
Beispiel #2
0
void Decls(void)
{
    unsigned    next_inp;
    unsigned    next_out;
    unsigned    next_err;
    unsigned    next_sem;

    next_inp = 0;
    next_out = 0;
    next_err = 0;
    next_sem = 0;

    for( ;; ) {
        switch( CurrToken ) {
        case T_INPUT:
            Scan();
            if( CurrToken == T_OUTPUT ) {
                Scan();
                if( next_out > next_inp )
                    next_inp = next_out;
                ProcTokens( CLASS_INOUT, &next_inp );
                if( next_inp > next_out ) {
                    next_out = next_inp;
                }
            } else {
                ProcTokens( CLASS_INPUT, &next_inp );
            }
            break;
        case T_OUTPUT:
            Scan();
            ProcTokens( CLASS_OUTPUT, &next_out );
            break;
        case T_ERROR:
            Scan();
            ProcTokens( CLASS_ERROR, &next_err );
            break;
        case T_TYPE:
            Scan();
            ProcType();
            break;
        case T_MECH:
            Scan();
            ProcMech( &next_sem );
            break;
        default:
            return;
        }
    }
}
Beispiel #3
0
void FormType()
{
  /*
    FormType -> { ARRAY OF } ( qualident | ProcType )
  */

  if ( debugMode) printf( "In FormType\n");
  while ( sym == ARRAY_SYM)
  {
    writesym();
    nextsym();
    accept( OF_SYM, 158);
  }

  if ( sym == PROCEDURE_SYM) 
  {
    ProcType();
  }
  else
  {
    qualident();
  }
  if ( debugMode) printf( "Out FormType\n");
}