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

japa.parser.Position Maven / Gradle / Ivy

Go to download

This package contains a Java 1.7 Parser with AST generation and visitor support. The AST records the source code structure, javadoc and comments. Soon will be possible change the AST nodes or create new ones to modify source code like refactoring. This parser is based on Sreenivasa Viswanadha Java 1.5 parser.

The newest version!
package japa.parser;

import japa.parser.ast.Node;

public class Position {
    private int line;
    private int column;

    public static final Position ABSOLUTE_START = new Position(Node.ABSOLUTE_BEGIN_LINE,-1);
    public static final Position ABSOLUTE_END = new Position(Node.ABSOLUTE_END_LINE,-1);

    public static Position beginOf(Node node){
        return new Position(node.getBeginColumn(),node.getBeginColumn());
    }

    public static Position endOf(Node node){
        return new Position(node.getEndColumn(),node.getEndColumn());
    }

    public Position(int line, int column){
        this.line = line;
        this.column = column;
    }

    public int getLine(){
        return this.line;
    }

    public int getColumn(){
        return this.column;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy