gt: 			if (!m_strName.equals (var.getName ()))
context: /*******************************************************************************
   * Copyright (c) 2011 Matthias-M. Christen, University of Basel, Switzerland.
   * All rights reserved. This program and the accompanying materials
   * are made available under the terms of the GNU Lesser Public License v2.1
   * which accompanies this distribution, and is available at
   * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
   *
   * Contributors:
   *     Matthias-M. Christen, University of Basel, Switzerland - initial API and implementation
   ******************************************************************************/
  package ch.unibas.cs.hpwc.patus.codegen;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Map;
  
  import cetus.hir.BinaryExpression;
  import cetus.hir.BinaryOperator;
  import cetus.hir.Declaration;
  import cetus.hir.Expression;
  import cetus.hir.NameID;
  import cetus.hir.PointerSpecifier;
  import cetus.hir.ProcedureDeclarator;
  import cetus.hir.SizeofExpression;
  import cetus.hir.Specifier;
  import cetus.hir.VariableDeclaration;
  import cetus.hir.VariableDeclarator;
  import ch.unibas.cs.hpwc.patus.arch.TypeDeclspec;
  import ch.unibas.cs.hpwc.patus.geometry.Size;
  import ch.unibas.cs.hpwc.patus.grammar.strategy.IAutotunerParam;
  import ch.unibas.cs.hpwc.patus.representation.StencilCalculation;
  import ch.unibas.cs.hpwc.patus.util.CodeGeneratorUtil;
  import ch.unibas.cs.hpwc.patus.util.StringUtil;
  
  /**
   * Class encapsulating all the generated global identifiers, i.e.,
   * the stencil function,
   *
   * @author Matthias-M. Christen
   */
  public class GlobalGeneratedIdentifiers
  {
  	///////////////////////////////////////////////////////////////////
  	// Inner Types
  
  	public enum EVariableType
  	{
  		OUTPUT_GRID (0x01),
  		INPUT_GRID (0x02),
  		SIZE_PARAMETER (0x04),
  		KERNEL_PARAMETER (0x08),
  		AUTOTUNE_PARAMETER (0x10),
  		INTERNAL_AUTOTUNE_PARAMETER (0x20),
  		INTERNAL_NONKERNEL_AUTOTUNE_PARAMETER (0x40),
  		INTERNAL_ADDITIONAL_KERNEL_PARAMETER (0x80),
  		TRAPEZOIDAL_SIZE (0x100),
  		TRAPEZOIDAL_TMAX (0x200),
  		TRAPEZOIDAL_SLOPE (0x400);
  
  
  		private int m_nMaskValue;
  
  		private EVariableType (int nMaskValue)
  		{
  			m_nMaskValue = nMaskValue;
  		}
  
  		public int mask ()
  		{
  			return m_nMaskValue;
  		}
  
  		public boolean isGrid ()
  		{
  			return INPUT_GRID.equals (this) || OUTPUT_GRID.equals (this);
  		}
  		
  		public boolean isAutotuningParameter ()
  		{
  			return AUTOTUNE_PARAMETER.equals (this) || INTERNAL_AUTOTUNE_PARAMETER.equals (this) || INTERNAL_NONKERNEL_AUTOTUNE_PARAMETER.equals (this);
  		}
  	}
  
  	/**
  	 *
  	 */
  	public static class Variable
  	{
  		private EVariableType m_type;
  		private List<Specifier> m_listSpecifiers;
  		private Specifier m_specType;
  		private String m_strName;
  		private String m_strOriginalName;
  
  		private Expression m_exprDefaultValue;
  
  		/**
  		 * Size of the array
  		 */
  		private Expression m_exprSize;
  
  		/**
  		 * Memory object box. Only valid for grid type variables.
  		 */
  		private Size m_sizeBox;
  		
  		/**
  		 * The values this variable can take (for auto-tuning)
  		 */
  		private IAutotunerParam m_autoparam;
  
  		private VariableDeclaration m_declaration;
  
  
  		public Variable (EVariableType type, List<Specifier> listSpecifiers, String strName, String strOriginalName, Expression exprSize)
  		{
  			m_type = type;
  			m_listSpecifiers = listSpecifiers;
  			m_specType = findDatatype ();
  			m_strName = strName;
  			m_strName = strOriginalName;
  			m_exprSize = exprSize;
  			m_sizeBox = null;
  			m_autoparam = null;
  			m_exprDefaultValue = null;
  
  			m_declaration = new VariableDeclaration (listSpecifiers, new VariableDeclarator (new NameID (strName)));
  		}
  
  		public Variable (EVariableType type, VariableDeclaration decl, String strOriginalName, Expression exprDefaultValue, Expression exprSize, Size sizeBox)
  		{
  			m_type = type;
  			m_declaration = decl;
  			m_listSpecifiers = decl.getSpecifiers ();
  			m_specType = findDatatype ();
  			m_strName = decl.getDeclarator (0).getID ().getName ();
  			m_strOriginalName = strOriginalName;
  			m_exprSize = exprSize;
  			m_sizeBox = sizeBox;
  			m_autoparam = null;
  			m_exprDefaultValue = exprDefaultValue;
  		}
  		
  		public Variable (EVariableType type, VariableDeclaration decl, String strOriginalName, Expression exprSize, IAutotunerParam autoparam)
  		{
  			m_type = type;
  			m_declaration = decl;
  			m_listSpecifiers = decl.getSpecifiers ();
  			m_specType = findDatatype ();
  			m_strName = decl.getDeclarator (0).getID ().getName ();
  			m_strOriginalName = strOriginalName;
  			m_exprSize = exprSize;
  			m_sizeBox = null;
  			m_autoparam = autoparam;
  			m_exprDefaultValue = null;
  		}
  
  		/**
  		 * Creates a new variable.
  		 * @param type The variable type
  		 * @param decl The variable declaration
  		 * @param specOrig The specifier of the original type (of the underlying stencil node)
  		 * @param strArgumentName The name of the variable
  		 * @param data
  		 */
  		public Variable (EVariableType type, VariableDeclaration decl, String strArgumentName, String strOriginalName, Expression exprDefaultValue, CodeGeneratorSharedObjects data)
  		{
  			this (
  				type,
  				decl,
  				strOriginalName,
  				exprDefaultValue,
  				type.isGrid () ?
  					GlobalGeneratedIdentifiers.getGridMemorySize (decl, strArgumentName, data) :
  					new SizeofExpression (decl.getSpecifiers ()),
  				type.isGrid () ? GlobalGeneratedIdentifiers.getGridMemoryBox (decl, strArgumentName, data) : null
  			);
  		}
  
  		public final EVariableType getType ()
  		{
  			return m_type;
  		}
  
  		public final boolean isGrid ()
  		{
  			return m_type.isGrid ();
  		}
  		
  		public final boolean isAutotuningParameter ()
  		{
  			return m_type.isAutotuningParameter ();
  		}
  
  		public final List<Specifier> getSpecifiers ()
  		{
  			return m_listSpecifiers;
  		}
  		
  		public final Specifier getDatatype ()
  		{
  			return m_specType;
  		}
  		
  		private Specifier findDatatype ()
  		{
  			for (Specifier s : m_listSpecifiers)
  				if (Globals.isBaseDatatype (s))
  					return s;
  			return null;	/* TODO: what should happen if no data type is found? */
  		}
  
  		public final String getName ()
  		{
  			return m_strName;
  		}
  
  		public final String getOriginalName ()
  		{
  			return m_strOriginalName;
  		}
  		
  		public final Expression getDefaultValue ()
  		{
  			return m_exprDefaultValue;
  		}
  
  		public final Expression getSize ()
  		{
  			return m_exprSize;
  		}
  
  		public final Size getBoxSize ()
  		{
  			return m_sizeBox;
  		}
  		
  		public final IAutotunerParam getAutotuneParam ()
  		{
  			return m_autoparam;
  		}
  
  		public final VariableDeclaration getDeclaration ()
  		{
  			return m_declaration;
  		}
  
  		@Override
  		public String toString()
  		{
  			return StringUtil.concat (
  				"<", m_type.toString (), "> ",
  				StringUtil.join (m_listSpecifiers, ""), " ",
  				m_strName, " [", m_exprSize.toString (), "]");
  		}
  
  		@Override
  		public boolean equals (Object obj)
  		{
  			if (!(obj instanceof Variable))
  				return false;
  
  			Variable var = (Variable) obj;
  
  