Examples of BooleanErrorListener


Examples of com.google.dart.engine.error.BooleanErrorListener

      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(),
        cache.getOldLength(),
        cache.getNewLength());
    if (errorListener.getErrorReported()) {
      return;
    }

    // Produce an updated AST
    IncrementalParser parser = new IncrementalParser(
View Full Code Here

Examples of com.google.dart.engine.error.BooleanErrorListener

   * @param source the source of the library file
   * @param libraryFileContents the contents from the library file
   * @return the library map read from the given source
   */
  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.
    if (!errorListener.getErrorReported()) {
      unit.accept(libraryBuilder);
    }
    return libraryBuilder.getLibrariesMap();
  }
View Full Code Here

Examples of com.google.dart.engine.error.BooleanErrorListener

    if (referenceSource.length() == 0) {
      Token syntheticToken = new SyntheticStringToken(TokenType.IDENTIFIER, "", sourceOffset);
      return new CommentReference(null, new SimpleIdentifier(syntheticToken));
    }
    try {
      BooleanErrorListener listener = new BooleanErrorListener();
      Scanner scanner = new Scanner(
          null,
          new SubSequenceReader(referenceSource, sourceOffset),
          listener);
      scanner.setSourceStart(1, 1);
      Token firstToken = scanner.tokenize();
      if (listener.getErrorReported()) {
        return null;
      }
      Token newKeyword = null;
      if (tokenMatchesKeyword(firstToken, Keyword.NEW)) {
        newKeyword = firstToken;
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.