code: public HeadedSyntacticCategory addArgument(HeadedSyntacticCategory argument, Direction direction,
        int rootVarNum) {
      SyntacticCategory newCategory = syntacticCategory.addArgument(argument.getSyntax(), direction);
      int[] newSemantics = Ints.concat(semanticVariables, new int[] { rootVarNum },
          argument.semanticVariables);
      int newRoot = semanticVariables.length;
      return new HeadedSyntacticCategory(newCategory, newSemantics, newRoot);
    }
docs: Gets the syntactic category and semantic variables that accepts
  {@code argument} on {@code direction} and returns {@code this}.
  Any semantic variables in both {@code argument} and {@code this}
  are assumed to be equivalent.
  
  @param argument
  @param direction
  @param rootVarNum
  @return