コード例 #1
0
ファイル: parser.c プロジェクト: kiendt07/ctd
void compileVarDecls(void) {
  // TODO
//  assert("Parsing variables...");
  while(lookAhead->tokenType == TK_IDENT)
      compileVarDecl();
//  assert("Variables parsed");
}
コード例 #2
0
ファイル: parser.c プロジェクト: BichVN/Compiler
void compileBlock3(void) {
  if (lookAhead->tokenType == KW_VAR) {
    eat(KW_VAR);
    compileVarDecl();
    compileVarDecls();
    compileBlock4();
  }
  else compileBlock4();
}
コード例 #3
0
ファイル: parser.c プロジェクト: minh93/thctd
void compileVarDecls(void) {
  // TODO
  if(lookAhead->tokenType == TK_IDENT)
    {
      compileVarDecl();
      compileVarDecls();
    }
  //else 
  //error(ERR_INVALIDVARDECL, lookAhead->lineNo, lookAhead->colNo);
}
コード例 #4
0
ファイル: parser.c プロジェクト: BichVN/Compiler
void compileVarDecls(void) {
  // TODO
  switch (lookAhead->tokenType) {
  case TK_IDENT:
    compileVarDecl();
    compileVarDecls();
    break;
    // EmptySt needs to check FOLLOW tokens
  case KW_BEGIN:
  case KW_FUNCTION:
  case KW_PROCEDURE:
    break;
    // Error occurs
  default:
    error(ERR_INVALIDVARDECL, lookAhead->lineNo, lookAhead->colNo);
    break;
  }
}
コード例 #5
0
void compileVarDecls(void) {
  while(lookAhead->tokenType == TK_IDENT)
    compileVarDecl();
}