# HG changeset patch # User Tom Rodriguez # Date 1399331621 25200 # Node ID f8cf483ba31ec3350f392f1bbc49626ff3b93e22 # Parent fbe9e7088e3500ce54b650c2b1c4516f895ae9c4 update description of the MatchRule syntax diff -r fbe9e7088e35 -r f8cf483ba31e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchRule.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchRule.java Mon May 05 21:23:25 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchRule.java Mon May 05 16:13:41 2014 -0700 @@ -27,15 +27,18 @@ import com.oracle.graal.nodes.*; /** - * This annotation declares a textual pattern for matching an HIR DAG. It's an s-expression with a - * node followed by its inputs. Node types are always uppercase and lowercase words are the names of - * nodes. + * This annotation declares a textual pattern for matching an HIR tree. The format is a LISP style + * s-expression with node types and/or names that are matched against the HIR. Node types are always + * uppercase and the names of nodes are always lowercase. Named nodes can be used to match trees + * where a node is used multiple times but only as an input to the full match. * *
- *   NAME := [a-z][a-zA-Z0-9]*
- *   NODETYPE := [A-Z][a-zA-Z0-9]*
- *   NODEORNAME :=  NODE [ = NAME ] | NAME
- *   EXPRESSION := ( NODEORNAME [ EXPRESSION | NODEORNAME [ EXPRESSION | NODEORNAME ] )
+ *   <node-name>    := [a-z][a-zA-Z0-9]*
+ *   <node-type>    := [A-Z][a-zA-Z0-9]*
+ *   <node-spec>    := <node-type> { '=' <node-name> }
+ *   <node-or-name> := <node-spec> | <node-name>
+ *   <argument>     := <node-or-name> | <match-rule>
+ *   <match-rule>   := '(' <node-spec> <argument>+ ')'
  * 
* * All matched nodes except the root of the match and {@link ConstantNode}s must have a single user.