Exemplo n.º 1
0
 private void constantDeclaration(SymbolTable sym) throws ParseException {
   start("constantDeclaration");
   if (!lex.match("const")) throw new ParseException(6);
   lex.nextLex();
   if (!lex.isIdentifier()) throw new ParseException(27);
   lex.nextLex();
   if (!lex.match("="))
     throw new ParseException(
         20); // TODO: i think this is the wrong exception.  check againset buds using test100
   lex.nextLex();
   int tid = lex.tokenCategory();
   if (tid != Lexer.stringToken || tid != Lexer.realToken || tid != Lexer.intToken)
     throw new ParseException(31);
   lex.nextLex();
   if (sym.nameDefined(lex.tokenText())) throw new ParseException(35, lex.tokenText());
   // TODO enterConstant
   stop("constantDeclaration");
 }