Examples of CharSequenceReader


Examples of com.google.dart.engine.scanner.CharSequenceReader

    if (cache.getOldLength() > 0 || cache.getNewLength() > 30) {
      return;
    }

    // Produce an updated token stream
    CharacterReader reader = new CharSequenceReader(cache.getNewContents());
    BooleanErrorListener errorListener = new BooleanErrorListener();
    IncrementalScanner scanner = new IncrementalScanner(cache.getSource(), reader, errorListener);
    scanner.rescan(
        cache.getResolvedUnit().getBeginToken(),
        cache.getOffset(),
View Full Code Here

Examples of com.google.dart.engine.scanner.CharSequenceReader

  @Override
  protected void internalPerform() throws AnalysisException {
    final RecordingErrorListener errorListener = new RecordingErrorListener();
    TimeCounterHandle timeCounterScan = PerformanceStatistics.scan.start();
    try {
      Scanner scanner = new Scanner(source, new CharSequenceReader(content), errorListener);
      scanner.setPreserveComments(getContext().getAnalysisOptions().getPreserveComments());
      tokenStream = scanner.tokenize();
      lineInfo = new LineInfo(scanner.getLineStarts());
      errors = errorListener.getErrorsForSource(source);
    } catch (Exception exception) {
View Full Code Here

Examples of com.google.dart.engine.scanner.CharSequenceReader

   */
  public LibraryMap readFromSource(Source source, String libraryFileContents) {
    BooleanErrorListener errorListener = new BooleanErrorListener();
    Scanner scanner = new Scanner(
        source,
        new CharSequenceReader(libraryFileContents),
        errorListener);
    Parser parser = new Parser(source, errorListener);
    CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize());
    LibraryBuilder libraryBuilder = new LibraryBuilder(useDart2jsPaths);
    // If any syntactic errors were found then don't try to visit the AST structure.
View Full Code Here

Examples of com.intellij.util.text.CharSequenceReader

  }

  @NotNull
  public static Document loadDocument(CharSequence seq) throws IOException, JDOMException {
    SAXBuilder builder = ourSaxBuilder.get();
    return builder.build(new CharSequenceReader(seq));
  }
View Full Code Here

Examples of com.intellij.util.text.CharSequenceReader

    return builder.build(new CharArrayReader(chars, 0, length));
  }

  public static Document loadDocument(CharSequence seq) throws IOException, JDOMException {
    SAXBuilder builder = ourSaxBuilder.get();
    return builder.build(new CharSequenceReader(seq));
  }
View Full Code Here

Examples of com.intellij.util.text.CharSequenceReader

        int startLine = 1;
        int startOffset = -1;
        int endLine = 1;
        int endOffset = -1;
        try {
            BufferedReader reader = new BufferedReader(new CharSequenceReader(charsSequence));
            String lineString;
            int currentCharCount = 0;
            while ((lineString = reader.readLine()) != null) {
                currentCharCount += lineString.length();
                currentCharCount++; // line break
View Full Code Here

Examples of com.intellij.util.text.CharSequenceReader

    public static Offset rangeToTextOffset(CharSequence charsSequence, Comment.Range range) {
        int startOffset = 0;
        int endOffset = 0;
        try {
            BufferedReader reader = new BufferedReader(new CharSequenceReader(charsSequence));
            String line;
            int textLineCount = 1;
            while ((line = reader.readLine()) != null) {
                if (textLineCount < range.startLine) {
                    startOffset += line.length();
View Full Code Here

Examples of com.intellij.util.text.CharSequenceReader

      }

      final Document document = FileDocumentManager.getInstance().getCachedDocument(virtualFile);

      if (document != null) {
        parse(new CharSequenceReader(document.getCharsSequence()), builder);
      }
      else {
        final InputStream inputStream;
        try {
          inputStream = virtualFile.getInputStream();
View Full Code Here

Examples of org.apache.commons.io.input.CharSequenceReader

  }

  @Test
  public void loadReader() throws IOException {
    final LineHandler lh = buildLineHandler(limit, line);
    final Reader r = new CharSequenceReader(buildInput(limit, line));

    final RecordLoader loader = new RecordLoader();
    loader.load(r, lh);
  }
View Full Code Here

Examples of org.apache.commons.io.input.CharSequenceReader

            throw new IllegalArgumentException(
                    "Illegal input char(s) at following positions: "
                    + badIndexes);
        //if (sb.length() > 0 && sb.charAt(sb.length()-1) != '\n')
            //sb.append('\n');
        return new CreoleScanner(new CharSequenceReader(sb));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.