/** Analyzes this literal, determining its value. */
 @Override
 public void analyze(Log log, SymbolTable table, Subroutine owner, boolean inLoop) {
   type = Type.NUMBER;
   String lexeme = getLexeme();
   try {
     if (lexeme.contains("^")) {
       lexeme = lexeme.replaceAll("(x|\\xd7)10\\^", "E");
     }
     value = Double.valueOf(lexeme);
   } catch (NumberFormatException e) {
     log.error("bad_number", getLexeme());
   }
 }
Beispiel #2
0
 @Override
 public void analyze(Log log, SymbolTable table, Subroutine owner, boolean inLoop) {
   if (targets.size() != sources.size() || targets.size() <= 0) {
     log.error("bad_parallel_declaration");
     return;
   }
   variables = new ArrayList<Variable>();
   for (int i = 0; i < targets.size(); i++) {
     variables.add(new Variable(targets.get(i), sources.get(i), constant));
   }
   for (Variable variable : variables) {
     variable.analyze(log, table, owner, inLoop);
   }
 }