package x2x.translator.pragma;

import java.util.ArrayList;

public class CLAWmapping {

  private int _mappedDimension = 0;
  private ArrayList<String> _mappedVariables = null;
  private ArrayList<String> _mappingVariables = null;

  /**
   * loop-extract mapping representation
   * @param mappingClause inner part of the mapping clause like
   * var_list:mapping_list
   */
  public CLAWmapping(String mappingClause){
    _mappedVariables = new ArrayList<String>();
    _mappingVariables = new ArrayList<String>();

    String[] parts = mappingClause.split(":");
    if(parts.length != 2) {
      // TODO throw exception mappingClause is wrong
    }
    String[] vars = parts[0].split(",");
    String[] mappings = parts[1].split(",");
    if(vars.length == 0 || mappings.length == 0){
      // TODO throw exception mappingClause is wrong
    }
    for(String var : vars){
      _mappedVariables.add(var);
    }
    for(String mapping : mappings){
      _mappedVariables.add(mapping);
    }
    _mappedDimension = _mappingVariables.size();
  }

  /**
   * @return the dimension to be mapped
   */
  public int getMappedDimension(){
    return _mappedDimension;
  }

}

@@ -86,44 +86,8 @@
  %7B%0A%0A
-  private int _mappedDimension = 0;%0A
   pr
@@ -955,57 +955,8 @@
   %7D%0A
-    _mappedDimension = _mappingVariables.size();%0A
   %7D%0A
@@ -979,16 +979,26 @@
 urn the 
+number of 
 dimensio
@@ -1069,27 +1069,35 @@
 rn _mapp
-edDimension
+ingVariables.size()
 ;%0A  %7D%0A%0A%7D

Remove useless variable