void Block(char *exit_label)
{
	while ( (Look != 'e') && (Look !='l') && (Look !='u') ) {
		Fin();
		printf("# BLOCK start\n");
		switch (Look) {
		case 'i':
			DoIf(exit_label);
			break;
		case 'w':
			DoWhile();
			break;
		case 'p':
			DoLoop();
			break;
		case 'r':
			DoRepeat();
			break;
		case 'f':
			DoFor();
			break;
		case 'd':
			DoDo();
			break;
		case 'b':
			DoBreak(exit_label);
			break;
		default:
			Assignment();
			break;
		}
		Fin();
		printf("# BLOCK end\n");
	}
}
示例#2
0
void Block(char *L)
{
    while (! strchr("elu", Look)) {
        dprint("Block: get Look = %c\n", Look);
        switch (Look) {
            case 'i':
                DoIf(L);
                break;
            case 'w':
                DoWhile();
                break;
            case 'p':
                DoLoop();
                break;
            case 'r':
                DoRepeat();
                break;
            case 'f':
                DoFor();
                break;
            case 'd':
                DoDo();
                break;
            case 'b':
                DoBreak(L);
            default:
                Assignment();
                break;
        }
        /* this is for convinent, otherwise newline character will
        cause an error */
        /*Newline();*/
        Fin();
    }
}
void Block() {
  while(Look != 'e' && Look !='l' && Look != 'u') {
    Fin();
    switch(Look) {
      case 'i': DoIf(); break;
      case 'w': DoWhile(); break;
      case 'p': DoLoop(); break;
      case 'r': DoRepeat(); break;
      case 'f': DoFor(); break;
      default : Assignment(); break;
    }
  }
}
示例#4
0
/* Parse and Translate a Block of Statements 
 * <block> ::= ( <statement> )*
 * <statement> ::= <if> | <while> | <assignment>
 * */
void Block()
{
    Scan();
    while(strchr("el", Token) == NULL) {
        switch (Token) {
            case 'i':
                DoIf();
                break;
            case 'w':
                DoWhile();
                break;
            case 'x':
                Assignment();
                break;
            default:
                break;
        }
        Semi();
        Scan();
    }
}
void Block() {
  Scan();
  NewLine();
  while(Token != 'e' && Token != 'l') {
    switch(Token) {
      case 'i':
        DoIf();
        break;
      case 'w':
        DoWhile();
        break;
      case 'W':
        DoWrite();
        break;
      case 'R':
        DoRead();
        break;
      default:
        Assignment();
    }
    NewLine();
    Scan();
  }
}