public int getLinePosition(AstNode node) {
        int pos = node.getPosition();
        AstNode parent = node.getParent();
        while (parent != null && parent.getLineno() == node.getLineno()) {
            pos += parent.getPosition();
            parent = parent.getParent();
        }
        return pos-1;
    }