Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2015 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.javascript.jscomp.gwt.client;
import static com.google.common.base.Preconditions.checkState;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multiset;
import com.google.common.collect.Ordering;
import com.google.common.collect.TreeMultiset;
import com.google.gwt.core.client.EntryPoint;
import com.google.javascript.jscomp.Compiler;
import com.google.javascript.jscomp.CompilerOptions;
import com.google.javascript.jscomp.NodeTraversal;
import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback;
import com.google.javascript.jscomp.SourceFile;
import com.google.javascript.jscomp.Var;
import com.google.javascript.jscomp.gwt.client.Util.JsArray;
import com.google.javascript.jscomp.gwt.client.Util.JsObject;
import com.google.javascript.jscomp.gwt.client.Util.JsRegExp;
import com.google.javascript.jscomp.parsing.Config;
import com.google.javascript.jscomp.parsing.ParserRunner;
import com.google.javascript.jscomp.parsing.parser.trees.Comment;
import com.google.javascript.rhino.ErrorReporter;
import com.google.javascript.rhino.InputId;
import com.google.javascript.rhino.Node;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import javax.annotation.Nullable;
import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsMethod;
/**
* GWT module to parse files for dependency and
* {@literal @}{@code fileoverview} annotation
* information.
*/
public class JsfileParser implements EntryPoint {
/**
* All the information parsed out of a single file.
* Exported as a JSON object:
*
* Any trivial values are omitted.
*/
static final class FileInfo {
final ErrorReporter reporter;
boolean goog = false;
boolean isConfig = false;
boolean isExterns = false;
boolean provideGoog = false;
boolean testonly = false;
final Set hasSoyDelcalls = new TreeSet<>();
final Set hasSoyDeltemplates = new TreeSet<>();
final Set importedModules = new TreeSet<>();
final List modName = new ArrayList<>();
final List mods = new ArrayList<>();
// Note: multiple copies doesn't make much sense, but we report
// each copy so that calling code can choose how to handle it
final Multiset provides = TreeMultiset.create();
final Multiset requires = TreeMultiset.create();
final Multiset requiresCss = TreeMultiset.create();
final Multiset visibility = TreeMultiset.create();
final Set> customAnnotations = assoc();
final Set> loadFlags = assoc();
FileInfo(ErrorReporter reporter) {
this.reporter = reporter;
}
private void handleGoog() {
if (provideGoog) {
provides.add("goog");
} else if (goog) {
requires.add("goog");
}
}
/** Exports the file info as a JSON object. */
JsObject