예제 #1
0
 @Override
 public AstNode variableDeclaration(boolean statement, CharSequence name, AstNode init) {
   VariableDeclaration vars = new VariableDeclaration();
   vars.setIsStatement(statement);
   VariableInitializer var = new VariableInitializer();
   var.setTarget(name(name));
   var.setInitializer(init);
   vars.addVariable(var);
   return vars;
 }
예제 #2
0
 @Override
 public AstNode variableDeclaration(boolean statement, Iterable<NameValue<AstNode>> vars) {
   VariableDeclaration varDecl = new VariableDeclaration();
   varDecl.setIsStatement(statement);
   for (NameValue<AstNode> v : vars) {
     VariableInitializer var = new VariableInitializer();
     var.setTarget(name(v.getName()));
     var.setInitializer(v.getValue());
     varDecl.addVariable(var);
   }
   return varDecl;
 }