Mercurial > hg > truffle
changeset 15519:f8cf483ba31e
update description of the MatchRule syntax
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 05 May 2014 16:13:41 -0700 |
parents | fbe9e7088e35 |
children | 4cdc787681d4 |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchRule.java |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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. * * <pre> - * 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>+ ')' * </pre> * * All matched nodes except the root of the match and {@link ConstantNode}s must have a single user.