Commits

Tim Vernum committed 0e42066

Refactor 'parser' tree into multiple packages

Comments (0)

Files changed (223)

convert/source/java/main/org/adjective/syntactic/convert/j7to8/ASTMethodInfo.java

 
 import org.adjective.syntactic.parser.ast.ASTMethodDeclaration;
 import org.adjective.syntactic.parser.ast.ASTNameList;
-import org.adjective.syntactic.parser.util.JavaType;
+import org.adjective.syntactic.parser.type.JavaType;
 
 public class ASTMethodInfo implements MethodInfo
 {

convert/source/java/main/org/adjective/syntactic/convert/j7to8/ASTTypeInfo.java

 package org.adjective.syntactic.convert.j7to8;
 
 import org.adjective.syntactic.parser.ast.*;
-import org.adjective.syntactic.parser.util.JavaType;
-import org.adjective.syntactic.parser.util.MemberType;
-import org.adjective.syntactic.parser.util.TypeParameter;
+import org.adjective.syntactic.parser.type.JavaType;
+import org.adjective.syntactic.parser.type.MemberType;
+import org.adjective.syntactic.parser.name.TypeParameter;
 
 import java.util.ArrayList;
 import java.util.List;

convert/source/java/main/org/adjective/syntactic/convert/j7to8/ClassFinder.java

 package org.adjective.syntactic.convert.j7to8;
 
 import org.adjective.syntactic.parser.ast.ASTClassOrInterfaceDeclaration;
-import org.adjective.syntactic.parser.util.TypeParameter;
+import org.adjective.syntactic.parser.name.TypeParameter;
 
 import java.util.HashMap;
 import java.util.Map;

convert/source/java/main/org/adjective/syntactic/convert/j7to8/ClassInfo.java

  */
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.util.JavaType;
-import org.adjective.syntactic.parser.util.TypeParameter;
+import org.adjective.syntactic.parser.type.JavaType;
+import org.adjective.syntactic.parser.name.TypeParameter;
 
 import java.lang.reflect.TypeVariable;
 

convert/source/java/main/org/adjective/syntactic/convert/j7to8/ClassMethodInfo.java

  */
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.util.JavaType;
+import org.adjective.syntactic.parser.type.JavaType;
 
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;

convert/source/java/main/org/adjective/syntactic/convert/j7to8/ClassType.java

  */
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.util.BaseType;
-import org.adjective.syntactic.parser.util.JavaType;
-import org.adjective.syntactic.parser.util.ParameterizedName;
-import org.adjective.syntactic.parser.util.UnparameterizedName;
+import org.adjective.syntactic.parser.type.BaseType;
+import org.adjective.syntactic.parser.type.JavaType;
+import org.adjective.syntactic.parser.name.ParameterizedName;
+import org.adjective.syntactic.parser.name.UnparameterizedName;
 
 public class ClassType implements JavaType
 {

convert/source/java/main/org/adjective/syntactic/convert/j7to8/Convert7To8Visitor.java

  */
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.BaseNode;
-import org.adjective.syntactic.parser.DefaultVisitor;
+import org.adjective.syntactic.parser.node.BaseNode;
+import org.adjective.syntactic.parser.util.DefaultVisitor;
 import org.adjective.syntactic.parser.ast.*;
+import org.adjective.syntactic.parser.name.ParameterizedName;
+import org.adjective.syntactic.parser.name.SimpleParameterizedName;
+import org.adjective.syntactic.parser.name.SimpleTypeParameter;
+import org.adjective.syntactic.parser.name.TypeParameter;
+import org.adjective.syntactic.parser.node.ExpressionNode;
+import org.adjective.syntactic.parser.node.StatementNode;
+import org.adjective.syntactic.parser.node.VariableDeclarationNode;
+import org.adjective.syntactic.parser.type.JavaType;
+import org.adjective.syntactic.parser.type.SimpleJavaType;
 import org.adjective.syntactic.parser.util.*;
-import org.adjective.syntactic.util.Pair;
+import org.adjective.syntactic.parser.util.Pair;
 
 import java.lang.reflect.Method;
 import java.util.*;

convert/source/java/main/org/adjective/syntactic/convert/j7to8/Main.java

 
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.BaseNode;
-import org.adjective.syntactic.parser.PrintSourceVisitor;
+import org.adjective.syntactic.parser.node.BaseNode;
+import org.adjective.syntactic.parser.util.PrintSourceVisitor;
 import org.adjective.syntactic.parser.jj.JavaParser;
 
 public class Main

convert/source/java/main/org/adjective/syntactic/convert/j7to8/MethodInfo.java

  */
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.util.JavaType;
+import org.adjective.syntactic.parser.type.JavaType;
 
 public interface MethodInfo {
 

convert/source/java/main/org/adjective/syntactic/convert/j7to8/TypeParameterLookup.java

  */
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.util.JavaType;
+import org.adjective.syntactic.parser.type.JavaType;
 
 public interface TypeParameterLookup {
     JavaType findParameter(String name);

convert/source/java/main/org/adjective/syntactic/convert/j7to8/VariableStack.java

  */
 package org.adjective.syntactic.convert.j7to8;
 
-import org.adjective.syntactic.parser.util.VariableDeclarationNode;
+import org.adjective.syntactic.parser.node.VariableDeclarationNode;
 
 import java.util.HashMap;
 import java.util.Map;

parser/source/grammar/java.jjt

     VISITOR_DATA_TYPE = "T";
     VISITOR_RETURN_TYPE = "R";
     TRACK_TOKENS = true;
-    TOKEN_EXTENDS = "org.adjective.syntactic.parser.BaseToken";
-    NODE_CLASS = "org.adjective.syntactic.parser.BaseNode" ;
+    TOKEN_EXTENDS = "org.adjective.syntactic.parser.node.BaseToken";
+    NODE_CLASS = "org.adjective.syntactic.parser.node.BaseNode" ;
     BUILD_NODE_FILES = false;
     NODE_SCOPE_HOOK = false;
     COMMON_TOKEN_ACTION = false;
    TernaryExpression()
 }
 
-void  MemberValueArrayInitializer():
+void MemberValueArrayInitializer():
 {}
 {
   "{" (MemberValue() ( LOOKAHEAD(2) "," MemberValue() )* [ "," ])? "}"

parser/source/java/parser/org/adjective/syntactic/parser/ASTPrinter.java

-/* ------------------------------------------------------------------------
- * Copyright 2012 Tim Vernum
- * ------------------------------------------------------------------------
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ------------------------------------------------------------------------
- */
-
-package org.adjective.syntactic.parser;
-
-import org.adjective.syntactic.parser.ast.Node;
-import org.adjective.syntactic.parser.ast.SimpleNode;
-
-import java.io.PrintStream;
-
-/**
- * @author <a href="http://blog.adjective.org/">Tim Vernum</a>
- */
-public class ASTPrinter
-{
-    private final PrintStream _stream;
-    private boolean _showSource;
-    private boolean _showTree;
-
-    public ASTPrinter()
-    {
-        this(System.out);
-    }
-
-    public ASTPrinter(PrintStream stream)
-    {
-        _stream = stream;
-    }
-
-    public boolean showSource()
-    {
-        return _showSource || !_showTree;
-    }
-
-    public boolean showTree()
-    {
-        return _showTree || !_showSource;
-    }
-
-    public void print(String file, Node node)
-    {
-        String prefix = "";
-
-        if (showTree())
-        {
-            print((SimpleNode) node, prefix);
-        }
-
-        if (showSource())
-        {
-            try
-            {
-                node.jjtAccept(new PrintSourceVisitor(), System.out);
-            }
-            catch (UnsupportedOperationException e)
-            {
-                System.err.println("\n(( In " + file + ": Cannot convert node to source: " + e.getMessage() + "))");
-                System.err.println("\t" + e.getStackTrace()[0]);
-            }
-            catch(RuntimeException e) {
-                System.err.println("\nException in " + file);
-                e.printStackTrace();
-            }
-        }
-    }
-
-    private void print(SimpleNode node, String prefix)
-    {
-        _stream.print(node.toString(prefix));
-        if (node.jjtGetNumChildren() == 0 || getChild(node, 0).jjtGetFirstToken() != node.jjtGetFirstToken())
-        {
-            _stream.print(' ');
-            _stream.print(node.jjtGetFirstToken().image);
-        }
-        _stream.print('\n');
-        for (int i = 0; i < node.jjtGetNumChildren(); i++)
-        {
-            SimpleNode child = getChild(node, i);
-            print(child, prefix + "  ");
-        }
-    }
-
-    private BaseNode getChild(SimpleNode node, int i)
-    {
-        return (BaseNode) node.jjtGetChild(i);
-    }
-
-    public void setShowSource(final boolean showSource)
-    {
-        this._showSource = showSource;
-    }
-
-    public void setShowTree(final boolean showTree)
-    {
-        this._showTree = showTree;
-    }
-}

parser/source/java/parser/org/adjective/syntactic/parser/BaseNode.java

-/* ------------------------------------------------------------------------
- * Copyright 2012 Tim Vernum
- * ------------------------------------------------------------------------
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ------------------------------------------------------------------------
- */
-
-package org.adjective.syntactic.parser;
-
-import org.adjective.syntactic.parser.ast.*;
-import org.adjective.syntactic.parser.jj.Token;
-import org.adjective.syntactic.parser.util.ArrayType;
-import org.adjective.syntactic.parser.util.JavaType;
-import org.adjective.syntactic.parser.util.NodeType;
-import org.adjective.syntactic.parser.util.TypeNode;
-
-import java.util.*;
-
-/**
- * @author <a href="http://blog.adjective.org/">Tim Vernum</a>
- */
-public class BaseNode extends SimpleNode implements NodeType
-{
-    protected BaseNode(int i)
-    {
-        super(i);
-    }
-
-    protected <T extends Node> T child(Class<T> type)
-    {
-        return child(type, false);
-    }
-
-    protected <T extends Node> T optionalChild(Class<T> type)
-    {
-        return child(type, true);
-    }
-
-    protected BaseNode child(final int i)
-    {
-        return (BaseNode) jjtGetChild(i);
-    }
-
-    private <T extends Node> T child(Class<T> type, boolean optional)
-    {
-        for (NodeType node : children())
-        {
-            if (type.isInstance(node))
-            {
-                return type.cast(node);
-            }
-        }
-        if (optional)
-        {
-            return null;
-        }
-        else
-        {
-            throw new IllegalStateException("No child matching type " + type.getSimpleName());
-        }
-    }
-
-    protected Iterable<? extends BaseNode> children()
-    {
-        return allChildren(BaseNode.class);
-    }
-
-    protected <T extends Node> Iterable<T> allChildren(final Class<T> type)
-    {
-        return new Iterable<T>()
-        {
-            @Override
-            public Iterator<T> iterator()
-            {
-                return new NodeIterator<T>(type, false);
-            }
-
-            @Override
-            public String toString()
-            {
-                return "allChildren(" + type + ") {" + jjtGetNumChildren() + "}";
-            }
-        };
-    }
-
-    protected <T extends Node> Iterable<T> findChildren(final Class<T> type)
-    {
-        return new Iterable<T>()
-        {
-            @Override
-            public Iterator<T> iterator()
-            {
-                return new NodeIterator<T>(type, true);
-            }
-        };
-    }
-
-    protected int countChildren(Class<? extends Node> nodeType)
-    {
-        int count = 0;
-        for (int i = 0; i < jjtGetNumChildren(); i++)
-        {
-            Node node = jjtGetChild(i);
-            if (nodeType.isInstance(node))
-            {
-                count++;
-            }
-        }
-        return count;
-    }
-
-    public <T extends Node> Iterable<T> children(final Class<T> type, final int start)
-    {
-        return this.children(type, start, jjtGetNumChildren());
-    }
-
-    public <T extends Node> Iterable<T> children(final Class<T> type, final int start, final int end)
-    {
-        return new Iterable<T>()
-        {
-            @Override
-            public Iterator<T> iterator()
-            {
-                return new NodeIterator<T>(type, start, end, false);
-            }
-        };
-    }
-
-    public boolean isEmpty()
-    {
-        return jjtGetNumChildren() == 0;
-    }
-
-    protected BaseNode getFirstChild()
-    {
-        if (isEmpty())
-        {
-            throw new NoSuchElementException("Node " + this + " has no children");
-        }
-        return (BaseNode) jjtGetChild(0);
-    }
-
-    protected BaseNode getLastChild()
-    {
-        if (isEmpty())
-        {
-            throw new NoSuchElementException("Node " + this + " has no children");
-        }
-        return (BaseNode) jjtGetChild(jjtGetNumChildren() - 1);
-    }
-
-    protected void appendChild(final Node node)
-    {
-        jjtAddChild(node, jjtGetNumChildren());
-    }
-
-    protected void appendChildren(final Node... nodes)
-    {
-        for (Node node : nodes)
-        {
-            appendChild(node);
-        }
-    }
-
-    @Override
-    public boolean is(Class<? extends Node> nodeType)
-    {
-        return nodeType.isInstance(this);
-    }
-
-    @Override
-    public <T extends Node> T as(Class<T> nodeType)
-    {
-        if (is(nodeType))
-        {
-            return nodeType.cast(this);
-        }
-        else
-        {
-            throw new IllegalStateException("The node " + this + " is not " + nodeType.getSimpleName());
-        }
-    }
-
-    public static JavaType makeType(JavaType type, ASTArraySuffixList arraySuffix)
-    {
-        return makeArrayType(type, arraySuffix == null ? 0 : arraySuffix.getArrayDepth());
-    }
-
-    protected static JavaType makeArrayType(final JavaType type, final int arrayDepth)
-    {
-        if (arrayDepth == 0)
-        {
-            return type;
-        }
-        else
-        {
-            return new ArrayType(type, arrayDepth);
-        }
-    }
-
-    protected String getIdentifierName(final Iterable<ASTIdentifier> identifiers)
-    {
-        StringBuilder builder = new StringBuilder();
-        for (ASTIdentifier identifier : identifiers)
-        {
-            builder.append(identifier.getIdentifier());
-            builder.append(".");
-        }
-        builder.deleteCharAt(builder.length() - 1);
-        return builder.toString();
-    }
-
-    protected int countTokens(final int kind)
-    {
-        int count = 0;
-        for (Token token : tokens())
-        {
-            if (token.kind == kind)
-            {
-                count++;
-            }
-        }
-        return count;
-
-    }
-
-    private Iterable<? extends Token> tokens()
-    {
-        return new Iterable<Token>()
-        {
-            @Override
-            public Iterator<Token> iterator()
-            {
-                return new TokenIterator(jjtGetFirstToken(), jjtGetLastToken());
-            }
-        };
-    }
-
-    protected void setChildren(final Node... elements)
-    {
-        // We run in reverse order to reduce the number of array allocations
-        for (int i = elements.length - 1; i >= 0; i--)
-        {
-            jjtAddChild(elements[i], i);
-        }
-    }
-
-    protected void setChildren(final Iterable<? extends Node> elements)
-    {
-        int i = 0;
-        for (Node element : elements)
-        {
-            jjtAddChild(element, i);
-            i++;
-        }
-    }
-
-    protected TypeNode makeTypeNode(final JavaType type)
-    {
-        TypeNode componentType;
-        switch (type.getBaseType())
-        {
-            case OBJECT:
-            case STRING_LITERAL:
-                componentType = new ASTClassOrInterfaceType(type.getParameterizedTypeName());
-                break;
-            case LAMBDA_LITERAL:
-                throw new IllegalArgumentException("Cannot create a type node for a lambda");
-            case VOID:
-                return new ASTVoidType();
-            default:
-                componentType = new ASTPrimitiveType(type.getBaseType());
-                break;
-        }
-        if (type.getArrayDepth() == 0)
-        {
-            return componentType;
-        }
-        else
-        {
-            return new ASTReferenceType(componentType, type.getArrayDepth());
-        }
-    }
-
-    protected Token makeToken(final int kind, final String image)
-    {
-        final Token token = new Token();
-        token.image = image;
-        token.kind = kind;
-        return token;
-    }
-
-    public <T extends Node> T findAncestor(final Class<T> type)
-    {
-        for (Node node = jjtGetParent(); node != null; node = node.jjtGetParent())
-        {
-            if (type.isInstance(node))
-            {
-                return type.cast(node);
-            }
-        }
-        return null;
-    }
-
-    public void replace(final Node node, final Collection<? extends Node> replacement)
-    {
-        List<Node> nodes = new ArrayList<Node>();
-        for (BaseNode child : children())
-        {
-            if (child == node)
-            {
-                nodes.addAll(replacement);
-            }
-            else
-            {
-                nodes.add(child);
-            }
-        }
-        jjtClearChildren();
-        setChildren(nodes);
-    }
-
-    private class NodeIterator<T extends Node> implements Iterator<T>
-    {
-        private final Class<T> _type;
-        private final boolean _skipNonMatching;
-        private final int _stop;
-        private int _index;
-
-        public NodeIterator(Class<T> type, boolean skipNonMatching)
-        {
-            this(type, 0, jjtGetNumChildren(), skipNonMatching);
-        }
-
-        public NodeIterator(Class<T> type, int start, final int end, boolean skipNonMatching)
-        {
-            _type = type;
-            _skipNonMatching = skipNonMatching;
-            _index = start - 1;
-            _stop = Math.min(end, jjtGetNumChildren());
-            advance();
-        }
-
-        private void advance()
-        {
-            for (_index++; hasNext(); _index++)
-            {
-                Node node = jjtGetChild(_index);
-                if (_type.isInstance(node) || !_skipNonMatching)
-                {
-                    return;
-                }
-            }
-        }
-
-        @Override
-        public boolean hasNext()
-        {
-            return _index < _stop;
-        }
-
-        @Override
-        public T next()
-        {
-            if (!hasNext())
-            {
-                throw new NoSuchElementException();
-            }
-            Node node = jjtGetChild(_index);
-            if (_type.isInstance(node))
-            {
-                advance();
-                return _type.cast(node);
-            }
-            else
-            {
-                throw new IllegalStateException("Node " + node + " is not of type " + _type.getSimpleName());
-            }
-        }
-
-        @Override
-        public void remove()
-        {
-            throw new UnsupportedOperationException("remove() - not implemented");
-        }
-    }
-
-    private class TokenIterator implements Iterator<Token>
-    {
-
-        private Token _next;
-        private final Token _last;
-
-        public TokenIterator(final Token first, final Token last)
-        {
-            _next = first;
-            _last = last;
-        }
-
-        @Override
-        public boolean hasNext()
-        {
-            return _next != null;
-        }
-
-        @Override
-        public Token next()
-        {
-            Token tok = _next;
-            if (tok == null)
-            {
-                throw new NoSuchElementException();
-            }
-            if (_next == _last)
-            {
-                _next = null;
-            }
-            else
-            {
-                _next = _next.next;
-            }
-            return tok;
-        }
-
-        @Override
-        public void remove()
-        {
-            throw new UnsupportedOperationException("TokenIterator.remove - not implemented");
-        }
-    }
-}

parser/source/java/parser/org/adjective/syntactic/parser/BaseToken.java

-package org.adjective.syntactic.parser;
-
-public class BaseToken {
-
-    public int realKind;
-
-}

parser/source/java/parser/org/adjective/syntactic/parser/DefaultVisitor.java

-/*
- * ------------------------------------------------------------------------
- *  Copyright 2013 Tim Vernum
- *  ------------------------------------------------------------------------
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *  ------------------------------------------------------------------------
- */
-package org.adjective.syntactic.parser;
-
-import org.adjective.syntactic.parser.ast.*;
-
-public class DefaultVisitor<R, T> implements JavaParserVisitor<R, T>
-{
-    @Override
-    public R visit(final SimpleNode node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTCompilationUnit node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTPackageDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTAnnotations node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTImports node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTImportDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTStaticImport node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTWildcardImport node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTypes node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTModifiers node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTypeDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTClassOrInterfaceDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTClassOrInterfaceKeyword node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTIdentifier node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTExtendsList node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTImplementsList node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTEnumDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTEnumBody node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTEnumConstants node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTEnumConstant node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTypeParameters node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTypeParameter node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTypeBound node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTClassOrInterfaceBody node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTClassOrInterfaceBodyElement node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTMember node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTFieldDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTVariableDeclarator node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArrayInitializer node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTMethodDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTMethodBody node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArraySuffixList node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArraySuffix node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTFormalParameters node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTFormalParameter node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTVariableModifiers node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTVarArgs node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTConstructorDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTConstructorBody node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTExplicitConstructorInvocation node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTInitializer node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTReferenceType node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTClassOrInterfaceType node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTParameterizedIdentifier node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTypeArguments node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTypeArgument node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTWildcardBounds node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTPrimitiveType node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTVoidType node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTQualifiedIdentifier node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTNameList node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTAssignmentOperator node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTTernaryExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTLogicalOrExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTLogicalAndExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTInclusiveOrExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTExclusiveOrExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTAndExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTEqualityExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTBinaryOperator node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTInstanceOfExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTRelationalExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTShiftExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTAdditiveExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTMultiplicativeExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTUnaryExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTPrefixExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTUnaryOperator node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTPostfixExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTCastExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTPrimaryExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTSuperExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTBracketExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTMemberSuffix node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTMemberReference node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTNew node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTIntegerLiteral node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTFloatingPointLiteral node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTCharacterLiteral node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTStringLiteral node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTThis node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTSuper node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTClassReference node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArrayIndex node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTBooleanLiteral node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTNullLiteral node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArguments node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArgumentList node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTAllocationExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArrayDimensions node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTDefinedArrayDimension node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTUndefinedArrayDimension node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTArrayWithInit node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTExpressionStatement node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTAssertStatement node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTLabeledStatement node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTBlock node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTVariableDeclarationStatement node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTLocalVariableDeclaration node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTEmptyStatement node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTStatementExpression node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;
-    }
-
-    @Override
-    public R visit(final ASTSwitchStatement node, final T data)
-    {
-        node.childrenAccept(this, data);
-        return null;