code: private static Node constructAddOrStringNode(Iterator<CharSequence> partsIterator,
                                                 Node argListNode)
        throws MalformedException {
      if (!partsIterator.hasNext()) {
        return IR.string("");
      }
  
      CharSequence part = partsIterator.next();
      Node partNode = null;
      if (part instanceof JsMessage.PlaceholderReference) {
        JsMessage.PlaceholderReference phRef =
            (JsMessage.PlaceholderReference) part;
  
        for (Node node : argListNode.children()) {
          if (node.isName()) {
            String arg = node.getString();
  
            // We ignore the case here because the transconsole only supports
            // uppercase placeholder names, but function arguments in JavaScript
            // code can have mixed case.
            if (arg.equalsIgnoreCase(phRef.getName())) {
              partNode = IR.name(arg);
            }
          }
        }
  
        if (partNode == null) {
          throw new MalformedException(
              "Unrecognized message placeholder referenced: " + phRef.getName(),
              argListNode);
        }
      } else {
        // The part is just a string literal.
        partNode = IR.string(part.toString());
      }
  
      if (partsIterator.hasNext()) {
        return IR.add(partNode,
                        constructAddOrStringNode(partsIterator, argListNode));
      } else {
        return partNode;
      }
    }
docs: Creates a parse tree corresponding to the remaining message parts in
  an iteration. The result will contain only STRING nodes, NAME nodes
  (corresponding to placeholder references), and/or ADD nodes used to
  combine the other two types.
  
  @param partsIterator  an iterator over message parts
  @param argListNode  a PARAM_LIST node whose children are valid placeholder names
  @return the root of the constructed parse tree
  
  @throws MalformedException if {@code partsIterator} contains a
  placeholder reference that does not correspond to a valid argument in
  the arg list