Esempio n. 1
0
 private List<ISymbol> convertToObjectSymbols(BlockExpression blk) {
   List<ISymbol> syms = new ArrayList<ISymbol>();
   for (ISymbol iSymbol : blk.getArgs()) {
     Symbol symbol = new Symbol((Symbol) iSymbol);
     symbol.setType(JavaTypes.OBJECT());
     syms.add(symbol);
   }
   return syms;
 }
Esempio n. 2
0
 private void 句子() {
   Token token = tokens.get(index++);
   if (token.getWord().equals("int") || token.getWord().equals("double")) {
     index--;
     SymbolType type = 类型();
     token = tokens.get(index++);
     if (token.getType() == TokenType.identifier) {
       Symbol symbol = this.symbolTable.get(token.getWord());
       symbol.setType(type);
     } else {
       throw new RuntimeException("读取的不是标示符");
     }
     String digit = A();
     Symbol symbol = this.symbolTable.get(token.getWord());
     symbol.setValue(digit);
   }
 }