All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.org.python.antlr.Visitor Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4
Show newest version
package org.python.antlr;

import org.python.antlr.ast.VisitorBase;

public class Visitor extends VisitorBase {

    /**
     * Visit each of the children one by one.
     * @args node The node whose children will be visited.
     */
    public void traverse(PythonTree node) throws Exception {
        node.traverse(this);
    }


    public void visit(PythonTree[] nodes) throws Exception {
        for (int i = 0; i < nodes.length; i++) {
            visit(nodes[i]);
        }
    }

    /**
     * Visit the node by calling a visitXXX method.
     */
    public Object visit(PythonTree node) throws Exception {
        Object ret = node.accept(this);
        return ret;
    }

    protected Object unhandled_node(PythonTree node) throws Exception {
        return this;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy