Exemplo n.º 1
0
 public void addMethod(IdentifierTree name, FunctionType functionType) {
   // fixme null scope
   Symbol symbol = new Symbol(name.name(), Symbol.Kind.METHOD, null);
   symbol.addUsage(Usage.create(name, Usage.Kind.DECLARATION));
   symbol.addType(functionType);
   properties.put(name.name(), symbol);
 }
  private void enterLoopBody() {
    Map<IdentifierTree, IdentifierTree> writeUsages = new HashMap<>();

    for (IdentifierTree identifierTree : currentLoopCounters) {
      Symbol symbol = identifierTree.symbol();
      if (symbol != null) {
        for (Usage usage : symbol.usages()) {
          if (usage.isWrite()) {
            writeUsages.put(usage.identifierTree(), identifierTree);
          }
        }
      }
    }

    writeUsagesOfCounters.addLast(writeUsages);
  }