Package com.google.template.soy.soytree

Examples of com.google.template.soy.soytree.SoyFileSetNode


      cachedTemplateRegistries = Maps.newHashMap();
      addToCache(null, null);
    } else {
      cachedTemplateRegistries = null;
    }
    SoyFileSetNode soyTreeForNoCaching = soyTree.clone();
    templateRegistryForNoCaching = buildTemplateRegistry(soyTreeForNoCaching);
    templateToIjParamsInfoMap =
        (new FindIjParamsVisitor(templateRegistryForNoCaching)).execForAllTemplates(
            soyTreeForNoCaching);
  }
View Full Code Here


    TemplateRegistry templateRegistry = cachedTemplateRegistries.get(key);
    if (templateRegistry == null) {
      if (!doAddToCache) {
        return null;
      }
      SoyFileSetNode soyTreeClone = soyTree.clone();
      (new InsertMsgsVisitor(key.first, true)).exec(soyTreeClone);
      (new RenameCssVisitor(key.second)).exec(soyTreeClone);
      simplifyVisitor.exec(soyTreeClone);
      templateRegistry = buildTemplateRegistry(soyTreeClone);
      cachedTemplateRegistries.put(key, templateRegistry);
View Full Code Here

  @Override protected void visitTemplateNode(TemplateNode node) {

    // Build templateRegistry if necessary.
    if (templateRegistry == null) {
      SoyFileSetNode soyTree = node.getParent().getParent();
      templateRegistry = new TemplateRegistry(soyTree);
    }

    if (isStartOfPass) {
      isStartOfPass = false;
View Full Code Here


  @Override public Void exec(SoyNode node) {

    Preconditions.checkArgument(node instanceof SoyFileSetNode);
    SoyFileSetNode nodeAsRoot = (SoyFileSetNode) node;

    // First simplify all expressions in the subtree.
    SoytreeUtils.execOnAllV2Exprs(nodeAsRoot, simplifyExprVisitor);

    // Setup.
    nodeIdGen = nodeAsRoot.getNodeIdGenerator();
    templateRegistry = new TemplateRegistry(nodeAsRoot);

    // Simpify the subtree.
    super.exec(nodeAsRoot);
View Full Code Here

   * @throws SoySyntaxException If a syntax error is found.
   */
  public ImmutableMap<String, String> generateParseInfo(
      String javaPackage, String javaClassNameSource) throws SoySyntaxException {

    SoyFileSetNode soyTree = (new SoyFileSetParser(soyFileSuppliers)).parse();

    return (new GenerateParseInfoVisitor(javaPackage, javaClassNameSource)).exec(soyTree);
  }
View Full Code Here

   * @return A SoyMsgBundle containing all the extracted messages (locale "en").
   * @throws SoySyntaxException If a syntax error is found.
   */
  public SoyMsgBundle extractMsgs() throws SoySyntaxException {

    SoyFileSetNode soyTree =
        (new SoyFileSetParser(soyFileSuppliers))
            .setDoEnforceSyntaxVersionV2(false).setDoCheckOverrides(false).parse();

    return (new ExtractMsgsVisitor()).exec(soyTree);
  }
View Full Code Here

    // Defensive copy of options. (Doesn't matter now, but might forget later when it matters.)
    tofuOptions = tofuOptions.clone();

    // TODO: Allow binding a SoyTofu instance to volatile inputs.
    SoyFileSetNode soyTree = (new SoyFileSetParser(soyFileSuppliers)).parse();
    runMiddleendPasses(soyTree, true);

    // If allowExternalCalls is not explicitly set, then disallow by default for Tofu backend.
    if (generalOptions.allowExternalCalls() == null) {
      // TODO: Enable this check when all Google internal projects are compliant.
View Full Code Here

       */
      private void compile() throws SoySyntaxException {

        Pair<SoyFileSetNode, List<SoyFileSupplier.Version>> soyTreeAndVersions =
            (new SoyFileSetParser(soyFileSuppliers)).parseWithVersions();
        SoyFileSetNode soyTree = soyTreeAndVersions.first;
        runMiddleendPasses(soyTree, true);

        ImmutableMap<String, SoyTemplateRuntime> result = SoyToJavaDynamicCompiler.compile(
            bundleName, compileFileSetToJavaSrc(soyTree, copyOfOptions, msgBundle));

View Full Code Here

   * @return Java source code in one big ugly blob. Can be put inside any class without needing
   *     additional imports because all class names in the generated code are fully qualified.
   */
  public String compileToJavaSrc(SoyJavaSrcOptions javaSrcOptions, SoyMsgBundle msgBundle) {

    SoyFileSetNode soyTree = (new SoyFileSetParser(soyFileSuppliers)).parse();
    runMiddleendPasses(soyTree, true);

    return compileFileSetToJavaSrc(soyTree, javaSrcOptions, msgBundle);
  }
View Full Code Here

   */
  public List<String> compileToJsSrc(SoyJsSrcOptions jsSrcOptions, @Nullable SoyMsgBundle msgBundle)
      throws SoySyntaxException {

    boolean doEnforceSyntaxVersionV2 = ! jsSrcOptions.shouldAllowDeprecatedSyntax();
    SoyFileSetNode soyTree = (new SoyFileSetParser(soyFileSuppliers))
        .setDoEnforceSyntaxVersionV2(doEnforceSyntaxVersionV2).parse();
    runMiddleendPasses(soyTree, doEnforceSyntaxVersionV2);

    return jsSrcMainProvider.get().genJsSrc(soyTree, jsSrcOptions, msgBundle);
  }
View Full Code Here

TOP

Related Classes of com.google.template.soy.soytree.SoyFileSetNode

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.