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

org.python.antlr.PythonErrorNode 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.

The newest version!
package org.python.antlr;

import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.tree.CommonErrorNode;

/** A node representing erroneous token range in token stream
 */
public class PythonErrorNode extends PythonTree {

    private CommonErrorNode errorNode;

    public PythonErrorNode(TokenStream input, Token start, Token stop,
                           RecognitionException e) {
        this.errorNode = new CommonErrorNode(input, start, stop, e);
    }

    public PythonErrorNode(CommonErrorNode errorNode){
        this.errorNode = errorNode;
    }

    @Override
    public boolean isNil() {
        return errorNode.isNil();
    }

    @Override
    public int getAntlrType() {
        return errorNode.getType();
    }

    @Override
    public String getText() {
        return errorNode.getText();
    }

    @Override
    public String toString() {
        return errorNode.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy