Package org.antlr.works.ate.syntax.misc

Examples of org.antlr.works.ate.syntax.misc.ATELine


    private int computeAbsoluteGrammarIndex(int lineIndex, int column) {
        List<ATELine> lines = window.getLines();
        if(lineIndex-1<0 || lineIndex-1 >= lines.size())
            return -1;

        ATELine line = lines.get(lineIndex-1);
        return line.position+column-1;
    }
View Full Code Here


    public void moveCursorToLine(int lineIndex) {
        if(lineIndex < 0 || lineIndex > delegate.getLines().size()-1)
            return;

        ATELine line = delegate.getLines().get(lineIndex);
        delegate.goToHistoryRememberCurrentPosition();
        delegate.setCaretPosition(line.position);
    }
View Full Code Here

            }

            if(matchNewLine()) {
                lineNumber++;
                lineIndex = position+1;
                lines.add(new ATELine(lineIndex));
            }
        }
        return valid;
    }
View Full Code Here

        List<ATELine> lines = getLines();
        if(lines == null)
            return -1;

        for(int i=0; i<lines.size(); i++) {
            ATELine line = lines.get(i);
            if(line.position > pos) {
                return i-1;
            }
        }
        return lines.size()-1;
View Full Code Here

    public Point getLineTextPositionsAtLineIndex(int lineIndex) {
        List<ATELine> lines = getLines();
        if(lineIndex == -1 || lines == null)
            return null;

        ATELine startLine = lines.get(lineIndex);
        int start = startLine.position;
        if(lineIndex+1 >= lines.size()) {
            return new Point(start, getTextPane().getDocument().getLength()-1);
        } else {
            ATELine endLine = lines.get(lineIndex+1);
            int end = endLine.position;
            return new Point(start, end-1);
        }
    }
View Full Code Here

        this.text = text;

        position = -1;
        lineNumber = 0;
        lines.clear();
        lines.add(new ATELine(0));

        tokens.clear();
        tokenize();
    }
View Full Code Here

            }

            if(matchNewLine()) {
                lineNumber++;
                lineIndex = position+1;
                lines.add(new ATELine(lineIndex));
            }
        }
        return valid;
    }
View Full Code Here

TOP

Related Classes of org.antlr.works.ate.syntax.misc.ATELine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.