public Node createMethodParameter(
Node modifiers, Node type, String varargs, Node name,
List<org.parboiled.Node<Node>> dimOpen, List<org.parboiled.Node<Node>> dimClosed) {
VariableDefinitionEntry e = new VariableDefinitionEntry().astName(createIdentifierIfNeeded(name, currentPos()))
.astArrayDimensions(dimOpen == null ? 0 : dimOpen.size());
if (dimOpen != null) for (org.parboiled.Node<Node> pNode : dimOpen) {
source.registerStructure(e, pNode);
}
if (dimClosed != null) for (org.parboiled.Node<Node> pNode : dimClosed) {
source.registerStructure(e, pNode);
}
if (name != null) e.setPosition(new Position(name.getPosition().getStart(), currentPos()));
VariableDefinition decl = new VariableDefinition().rawTypeReference(type);
if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
if (varargs != null && !varargs.trim().isEmpty()) decl.astVarargs(true);
decl.rawVariables().addToEnd(e);
return posify(decl);