Esempio n. 1
0
void compileConstDecls(void) {
  // TODO
  assert("Parsing subconstants...");
  while (lookAhead->tokenType == TK_IDENT)
      compileConstDecl();
  assert("Subconstants parsed!");
}
Esempio n. 2
0
void compileConstDecls(void) {
  // TODO
  if(lookAhead->tokenType == TK_IDENT)
    {
      compileConstDecl();
      compileConstDecls();
    }
  //else 
  //error(ERR_INVALIDCONSTDECL, lookAhead->lineNo, lookAhead->colNo);
}
Esempio n. 3
0
void compileBlock(void) {
  assert("Parsing a Block ....");
  if (lookAhead->tokenType == KW_CONST) {
    eat(KW_CONST);
    compileConstDecl();
    compileConstDecls();
    compileBlock2();
  }
  else compileBlock2();
  assert("Block parsed!");
}
Esempio n. 4
0
void compileConstDecls(void) {
  // TODO
  switch (lookAhead->tokenType) {
  case TK_IDENT:
    compileConstDecl();
    compileConstDecls();
    break;
    // EmptySt needs to check FOLLOW tokens
   case KW_TYPE:
  case KW_VAR:
  case KW_BEGIN:
  case KW_FUNCTION:
  case KW_PROCEDURE:
    break;
    // Error occurs
  default:
    error(ERR_INVALIDCONSTDECL, lookAhead->lineNo, lookAhead->colNo);
    break;
  }
}
Esempio n. 5
0
void compileConstDecls(void) {// chẹck
    while(lookAhead->tokenType == TK_IDENT)
    compileConstDecl();
}