
public class VarDeclNode extends Node  {
	// TODO distinguish parameter decl.
	public static final int STORAGE_CONST = 1 << 0;
	private TypeRefNode typeSpec;
	private Symbol name;
	private Node initializer;

	public VarDeclNode(TypeRefNode typeSpec, Symbol name, Node initializer) {
		this.typeSpec = typeSpec;
		this.name = name;
		this.initializer = initializer;
	}

	public Node get_default_value() {
		return initializer;
	}

	public int get_storage_flags() {
		// TODO Auto-generated method stub
		return 0;
	}

	public TypeRefNode get_type() {
		return typeSpec;
	}

	public void setName(Symbol name) {
		this.name = name;
	}

	public Symbol getName() {
		return name;
	}

	@Override
	public String toIndentedString(int surroundingIndentation) {
		return String.format("%s %s%s", typeSpec.toString(), name.toString(), initializer != null ? " = " + initializer.toString() : "");
	}

}
