void initialize(AbstractCompiler compiler) throws Exception {
Preconditions.checkState(
!Strings.isNullOrEmpty(templateJs),
"The template JS must be loaded before the scanner is used. "
+ "Make sure that the template file is not empty.");
Node scriptRoot = new JsAst(SourceFile.fromCode(
"template", templateJs)).getAstRoot(compiler);
Map<String, Node> beforeTemplates = Maps.newHashMap();
Map<String, Node> afterTemplates = Maps.newHashMap();
for (Node templateNode : scriptRoot.children()) {