code: @Override protected void visitPrintNode(PrintNode node) {
      Expression expr = translateExpr(node.getExpr());
  
      // Process directives.
      for (PrintDirectiveNode directiveNode : node.getChildren()) {
  
        // Get directive.
        SoyPrintDirective directive = directiveNode.getPrintDirective();
        if (!(directive instanceof SoyJsSrcPrintDirective)) {
          errorReporter.report(
              node.getSourceLocation(), UNKNOWN_SOY_JS_SRC_PRINT_DIRECTIVE, directiveNode.getName());
          return;
        }
  
        // Get directive args.
        List<ExprRootNode> argNodes = directiveNode.getArgs();
  
        // Convert args to CodeChunks.
        List<Expression> argChunks = new ArrayList<>(argNodes.size());
        for (ExprRootNode argNode : argNodes) {
          argChunks.add(translateExpr(argNode));
        }
  
        // Apply directive.
        expr =
            SoyJsPluginUtils.applyDirective(
                expr,
                (SoyJsSrcPrintDirective) directive,
                argChunks,
                node.getSourceLocation(),
                errorReporter);
      }
  
      chunks.add(expr);
    }
docs: Example:
  <pre>
  {$boo.foo}
  {$goo.moo + 5}
  </pre>
  might generate
  <pre>
  opt_data.boo.foo
  gooData4.moo + 5
  </pre>