Variables 

Abstract variable declarations 

Abstract variable declarations are written using VAR(...):

scala> import treehugger.forest._, definitions._, treehuggerDSL._
import treehugger.forest._
import definitions._
import treehuggerDSL._

scala> val tree = (VAR("foo", IntClass): Tree)
tree: treehugger.forest.Tree = ValDef(Modifiers(<mutable>, , Map()),Typed(Ident(foo),TypeTree()),EmptyTree)

scala> treeToString(tree)
res0: String = var foo: Int

or in general:

VAR(sym|"x", typ|"C").tree

Variable definitions 

Value definitions are written as:

scala> val tree2 = VAR("foo", IntClass) := LIT(0)
tree2: treehugger.forest.ValDef = ValDef(Modifiers(<mutable>, , Map()),Typed(Ident(foo),TypeTree()),Literal(Constant(0)))

scala> treeToString(tree2)
res1: String = var foo: Int = 0

as a special form of initializing the variable with the default value of the type, WILDCARD can be used as follows:

scala> val tree3 = VAR("foo", IntClass) := WILDCARD
tree3: treehugger.forest.ValDef = ValDef(Modifiers(<mutable>, , Map()),Typed(Ident(foo),TypeTree()),Ident(_))

scala> treeToString(tree3)
res2: String = var foo: Int = _