@@ -0,0 +1,1121 @@
+package absyn;%0A%0Aimport env.Env;%0Aimport javaslang.collection.Tree;%0Aimport parse.Loc;%0Aimport semantic.SemanticHelper;%0Aimport types.Type;%0A%0Apublic class DecVar extends Dec %7B%0A%0A   public final String name;%0A   public final String typeName;%0A   public final Exp init;%0A%0A   public DecVar(Loc loc, String name, String typeName, Exp init) %7B%0A      super(loc);%0A      this.name = name;%0A      this.typeName = typeName;%0A      this.init = init;%0A   %7D%0A%0A   @Override%0A   public Tree.Node%3CString%3E toTree() %7B%0A      return Tree.of(%22DecVar%22,%0A                     Tree.of(name),%0A                     Tree.of(typeName),%0A                     init.toTree());%0A   %7D%0A%0A   @Override%0A   public void semantic(Env env) %7B%0A      Type t_init = init.semantic(env);%0A      Type t_var = t_init;%0A      if (typeName != null) %7B%0A         Type t_typeName = env.tenv.get(typeName);%0A         if (t_typeName == null)%0A            throw SemanticHelper.undefined(loc, %22type%22, typeName);%0A         if (!t_init.is(t_typeName))%0A            throw SemanticHelper.typeMismatch(init.loc, t_init, t_typeName);%0A         t_var = t_typeName;%0A      %7D%0A      env.venv.put(name, t_var);%0A   %7D%0A%7D%0A

Add variable declaration