code: public static TreeRewriteRule compile(final String rule) {
  		final String[] parts = rule.split("->");
  		if (parts.length != 2) {
  			throw new IllegalArgumentException(format(
  				"Invalid rewrite rule: %s", rule
  			));
  		}
  
  		return of(
  			TreePattern.compile(parts[0]),
  			TreePattern.compile(parts[1])
  		);
  	}
docs: Compiles the string representation of a rewrite rule:
  <pre>{@code
  add(<x>,0) -> <x>
  mul(<x>,1) -> <x>
  }</pre>
  
  @param rule the rewrite rule
  @return a new rewrite rule, compiled from the given rule string
  @throws IllegalArgumentException if the rewrite rule is invalid
  @throws NullPointerException if the given {@code rule} string is
  {@code null}