changeset 16391:50d79ad439f1

Truffle/Instrumentation: rename PhylumTag to SyntaxTag (along with related classes/methods)
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Wed, 02 Jul 2014 16:06:42 -0700
parents ae8f4016792a
children 5af4dd229520
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/ASTNodeProber.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/PhylumTag.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/PhylumTagged.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/PhylumTrap.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Probe.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/ProbeListener.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/StandardSyntaxTag.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/StandardTag.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SyntaxTag.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SyntaxTagTrap.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SyntaxTagged.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Wrapper.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/DefaultASTPrinter.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/InstrumentationNode.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/ProbeManager.java
diffstat 16 files changed, 271 insertions(+), 270 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java	Wed Jul 02 16:06:42 2014 -0700
@@ -122,7 +122,7 @@
      * Returns all existing probes with specific tag, or all probes if {@code tag = null}; empty
      * collection if no probes found.
      */
-    public final Collection<Probe> findProbesTaggedAs(PhylumTag tag) {
+    public final Collection<Probe> findProbesTaggedAs(SyntaxTag tag) {
         return probeManager.findProbesTaggedAs(tag);
     }
 
@@ -140,9 +140,9 @@
      *
      * @throws IllegalStateException if a trap is already set
      */
-    public final void setPhylumTrap(PhylumTrap trap) throws IllegalStateException {
+    public final void setTagTrap(SyntaxTagTrap trap) throws IllegalStateException {
         // TODO (mlvdv) consider allowing multiple traps (without inhibiting Truffle inlining)
-        probeManager.setPhylumTrap(trap);
+        probeManager.setTagTrap(trap);
     }
 
     /**
@@ -150,8 +150,8 @@
      *
      * @throws IllegalStateException if no trap is set.
      */
-    public final void clearPhylumTrap() {
-        probeManager.clearPhylumTrap();
+    public final void clearTagTrap() {
+        probeManager.clearTagTrap();
     }
 
     /**
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/ASTNodeProber.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/ASTNodeProber.java	Wed Jul 02 16:06:42 2014 -0700
@@ -47,7 +47,7 @@
      * {@link ExecutionEvents} at the wrapped AST node.</li>
      * <li>if the argument is itself a {@link Wrapper}, i.e. if the AST node at this site has
      * already been wrapped, then the wrapper is returned (with the possible addition of a
-     * {@linkplain PhylumTag tag}).</li>
+     * {@linkplain SyntaxTag tag}).</li>
      * </ul>
      *
      * @param astNode an AST node to which instrumentation might be applied
@@ -59,5 +59,5 @@
      *         {@code astNode}) with an associated {@link Probe} .
      */
 
-    Node probeAs(Node astNode, PhylumTag tag, Object... args);
+    Node probeAs(Node astNode, SyntaxTag tag, Object... args);
 }
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/PhylumTag.java	Wed Jul 02 23:40:19 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.truffle.api.instrument;
-
-/**
- * Program element "tags", presumed to be singletons (best implemented as enums) that define
- * user-visible behavior for debugging and other simple tools. These categories (<em>phyla</em>)
- * should correspond to program structures that are meaningful to a guest language programmer.
- * <p>
- * An untagged Truffle node should be understood as an artifact of the guest language implementation
- * and should not be visible to the user of a guest language programming tool. Nodes may also have
- * more than one tag, for example a variable assignment that is also a statement. Finally, the
- * assignment of tags to nodes could depending on the use-case of whatever tool is using them.
- * <p>
- * <strong>Disclaimer:</strong> experimental interface under development.
- *
- * @see Probe
- * @see Wrapper
- * @see StandardTag
- */
-public interface PhylumTag {
-
-    /**
-     * Human-friendly name of guest language program elements belonging to the category, e.g.
-     * "statement".
-     */
-    String name();
-
-    /**
-     * Criteria and example uses for the tag.
-     */
-    String getDescription();
-
-}
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/PhylumTagged.java	Wed Jul 02 23:40:19 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.truffle.api.instrument;
-
-/**
- * Information about a guest language program element in a Truffle that can be marked as belonging
- * to 0 or more {@linkplain PhylumTag tags}.
- * <p>
- * <strong>Disclaimer:</strong> experimental interface under development.
- *
- * @see Probe
- * @see Wrapper
- */
-public interface PhylumTagged {
-
-    /**
-     * Is this node tagged as belonging to a particular category of language constructs?
-     */
-    boolean isTaggedAs(PhylumTag tag);
-
-    /**
-     * In which categories has this node been tagged (<em>empty set</em> if none).
-     */
-    Iterable<PhylumTag> getPhylumTags();
-
-}
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/PhylumTrap.java	Wed Jul 02 23:40:19 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.truffle.api.instrument;
-
-import com.oracle.truffle.api.frame.*;
-import com.oracle.truffle.api.nodes.*;
-
-/**
- * A trap that can be set to interrupt execution at probed nodes carrying a specific tag.
- */
-public abstract class PhylumTrap {
-
-    private final PhylumTag tag;
-
-    protected PhylumTrap(PhylumTag tag) {
-        this.tag = tag;
-    }
-
-    public final PhylumTag getTag() {
-        return tag;
-    }
-
-    /**
-     * Callback that will be received whenever execution enters a node with the specified tag.
-     */
-    public abstract void phylumTrappedAt(Node node, MaterializedFrame frame);
-}
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Probe.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Probe.java	Wed Jul 02 16:06:42 2014 -0700
@@ -32,7 +32,7 @@
  * associated with programmer-facing tools, there should be no more than one probe associated with a
  * particular piece of source code syntax (i.e. a {@link SourceSection}).
  * <p>
- * Any {@linkplain PhylumTag tags} associated with a particular piece of source code syntax are
+ * Any {@linkplain SyntaxTag tags} associated with a particular piece of source code syntax are
  * managed by the probe.
  * <p>
  * When ASTs are copied, it is presumed that the probe for a site is shared by all AST nodes
@@ -52,7 +52,7 @@
  * @see Instrument
  * @see Wrapper
  */
-public interface Probe extends ExecutionEvents, PhylumTagged {
+public interface Probe extends ExecutionEvents, SyntaxTagged {
 
     /**
      * The source location with which this probe is (presumably uniquely) associated.
@@ -63,7 +63,7 @@
      * Mark this probe as being associated with an AST node in some category useful for debugging
      * and other tools.
      */
-    void tagAs(PhylumTag tag);
+    void tagAs(SyntaxTag tag);
 
     /**
      * Adds an instrument to this probe.
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/ProbeListener.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/ProbeListener.java	Wed Jul 02 16:06:42 2014 -0700
@@ -45,6 +45,6 @@
      * Notifies that a (fully constructed) {@link Probe} has been tagged. A subsequent marking with
      * the same tag is idempotent and generates no notification.
      */
-    void probeTaggedAs(Probe probe, PhylumTag tag);
+    void probeTaggedAs(Probe probe, SyntaxTag tag);
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/StandardSyntaxTag.java	Wed Jul 02 16:06:42 2014 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.truffle.api.instrument;
+
+/**
+ * A somewhat language-agnostic set of user-sensible syntactic categories, suitable for conventional
+ * imperative languages, and is being developed incrementally.
+ * <p>
+ * The need for alternative sets of tags is likely to arise, perhaps for other families of languages
+ * (for example for mostly expression-oriented languages) or even for specific languages.
+ * <p>
+ * <strong>Disclaimer:</strong> experimental interface under development.
+ *
+ * @see Probe
+ * @see Wrapper
+ */
+public enum StandardSyntaxTag implements SyntaxTag {
+
+    /**
+     * Marker for a variable assignment.
+     */
+    ASSIGNMENT("assignment", "a variable assignment"),
+
+    /**
+     * Marker for a call site.
+     */
+    CALL("call", "a method/procedure call site"),
+
+    /**
+     * Marker for a location where a guest language exception is about to be thrown.
+     */
+    THROW("throw", "creator of an exception"),
+
+    /**
+     * Marker for a location where ordinary "stepping" should halt.
+     */
+    STATEMENT("statement", "basic unit of the language, suitable for \"stepping\" in a debugger");
+
+    private final String name;
+    private final String description;
+
+    private StandardSyntaxTag(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+}
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/StandardTag.java	Wed Jul 02 23:40:19 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.truffle.api.instrument;
-
-/**
- * A somewhat language-agnostic set of phylum categories, suitable for conventional imperative
- * languages, and is being developed incrementally.
- * <p>
- * The need for alternative sets of tags is likely to arise, perhaps for other families of languages
- * (for example for mostly expression-oriented languages) or even for specific languages.
- * <p>
- * <strong>Disclaimer:</strong> experimental interface under development.
- *
- * @see Probe
- * @see Wrapper
- */
-public enum StandardTag implements PhylumTag {
-
-    /**
-     * Marker for a variable assignment.
-     */
-    ASSIGNMENT("assignment", "a variable assignment"),
-
-    /**
-     * Marker for a call site.
-     */
-    CALL("call", "a method/procedure call site"),
-
-    /**
-     * Marker for a location where a guest language exception is about to be thrown.
-     */
-    THROW("throw", "creator of an exception"),
-
-    /**
-     * Marker for a location where ordinary "stepping" should halt.
-     */
-    STATEMENT("statement", "basic unit of the language, suitable for \"stepping\" in a debugger");
-
-    private final String name;
-    private final String description;
-
-    private StandardTag(String name, String description) {
-        this.name = name;
-        this.description = description;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SyntaxTag.java	Wed Jul 02 16:06:42 2014 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.truffle.api.instrument;
+
+/**
+ * Program element "tags", presumed to be singletons (best implemented as enums) that define
+ * user-visible behavior for debugging and other simple tools. These categories should correspond to
+ * program structures, for example "statement" and "assignment", that are meaningful
+ * ("human-sensible") to guest language programmers.
+ * <p>
+ * An untagged Truffle node should be understood as an artifact of the guest language implementation
+ * and should not be visible to guest language programmers. Nodes may also have more than one tag,
+ * for example a variable assignment that is also a statement. Finally, the assignment of tags to
+ * nodes could depending on the use-case of whatever tool is using them.
+ * <p>
+ * <strong>Disclaimer:</strong> experimental interface under development.
+ *
+ * @see Probe
+ * @see Wrapper
+ * @see StandardSyntaxTag
+ */
+public interface SyntaxTag {
+
+    /**
+     * Human-friendly name of guest language program elements belonging to the category, e.g.
+     * "statement".
+     */
+    String name();
+
+    /**
+     * Criteria and example uses for the tag.
+     */
+    String getDescription();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SyntaxTagTrap.java	Wed Jul 02 16:06:42 2014 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.truffle.api.instrument;
+
+import com.oracle.truffle.api.frame.*;
+import com.oracle.truffle.api.nodes.*;
+
+/**
+ * A trap that can be set to interrupt execution at probed nodes carrying a specific tag.
+ */
+public abstract class SyntaxTagTrap {
+
+    private final SyntaxTag tag;
+
+    protected SyntaxTagTrap(SyntaxTag tag) {
+        this.tag = tag;
+    }
+
+    public final SyntaxTag getTag() {
+        return tag;
+    }
+
+    /**
+     * Callback that will be received whenever execution enters a node with the specified tag.
+     */
+    public abstract void tagTrappedAt(Node node, MaterializedFrame frame);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SyntaxTagged.java	Wed Jul 02 16:06:42 2014 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.truffle.api.instrument;
+
+/**
+ * Information about a guest language program element in a Truffle AST that can be marked as
+ * belonging to 0 or more {@linkplain SyntaxTag tags}.
+ * <p>
+ * <strong>Disclaimer:</strong> experimental interface under development.
+ *
+ * @see Probe
+ * @see Wrapper
+ */
+public interface SyntaxTagged {
+
+    /**
+     * Is this node tagged as belonging to a particular category of language constructs?
+     */
+    boolean isTaggedAs(SyntaxTag tag);
+
+    /**
+     * In which categories has this node been tagged (<em>empty set</em> if none).
+     */
+    Iterable<SyntaxTag> getSyntaxTags();
+
+}
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Wrapper.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Wrapper.java	Wed Jul 02 16:06:42 2014 -0700
@@ -62,7 +62,7 @@
  * @see Probe
  * @see ExecutionEvents
  */
-public interface Wrapper extends PhylumTagged {
+public interface Wrapper extends SyntaxTagged {
 
     /**
      * Gets the AST node being instrumented, which should never be an instance of {@link Wrapper}.
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/DefaultASTPrinter.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/DefaultASTPrinter.java	Wed Jul 02 16:06:42 2014 -0700
@@ -75,11 +75,11 @@
                 p.print(src.getSource().getName() + ":" + src.getStartLine());
             }
         }
-        if (node instanceof PhylumTagged) {
-            final PhylumTagged taggedNode = (PhylumTagged) node;
+        if (node instanceof SyntaxTagged) {
+            final SyntaxTagged taggedNode = (SyntaxTagged) node;
             p.print("[");
             String prefix = "";
-            for (PhylumTag tag : taggedNode.getPhylumTags()) {
+            for (SyntaxTag tag : taggedNode.getSyntaxTags()) {
                 p.print(prefix);
                 prefix = ",";
                 p.print(tag.toString());
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/InstrumentationNode.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/InstrumentationNode.java	Wed Jul 02 16:06:42 2014 -0700
@@ -41,7 +41,7 @@
 public abstract class InstrumentationNode extends Node implements ExecutionEvents {
 
     interface ProbeCallback {
-        void newTagAdded(ProbeImpl probe, PhylumTag tag);
+        void newTagAdded(ProbeImpl probe, SyntaxTag tag);
     }
 
     /**
@@ -200,7 +200,7 @@
      * An instance is intended to be shared by every clone of the AST node with which it is
      * originally attached, so it holds no parent pointer.
      * <p>
-     * May be categorized by one or more {@linkplain PhylumTag tags}, signifying information useful
+     * May be categorized by one or more {@linkplain SyntaxTag tags}, signifying information useful
      * for instrumentation about its AST location(s).
      */
     static final class ProbeImpl extends InstrumentationNode implements Probe {
@@ -215,9 +215,9 @@
         // TODO (mlvdv) assumption model broken
         @CompilerDirectives.CompilationFinal private Assumption probeUnchanged;
 
-        @CompilerDirectives.CompilationFinal private PhylumTrap trap = null;
+        @CompilerDirectives.CompilationFinal private SyntaxTagTrap trap = null;
 
-        private final ArrayList<PhylumTag> tags = new ArrayList<>();
+        private final ArrayList<SyntaxTag> tags = new ArrayList<>();
 
         private ProbeImpl(SourceSection sourceSection, ProbeCallback probeCallback) {
             this.probeCallback = probeCallback;
@@ -231,7 +231,7 @@
         }
 
         @SlowPath
-        public void tagAs(PhylumTag tag) {
+        public void tagAs(SyntaxTag tag) {
             assert tag != null;
             if (!tags.contains(tag)) {
                 tags.add(tag);
@@ -239,12 +239,12 @@
             }
         }
 
-        public boolean isTaggedAs(PhylumTag tag) {
+        public boolean isTaggedAs(SyntaxTag tag) {
             assert tag != null;
             return tags.contains(tag);
         }
 
-        public Iterable<PhylumTag> getPhylumTags() {
+        public Iterable<SyntaxTag> getSyntaxTags() {
             return tags;
         }
 
@@ -275,7 +275,7 @@
         }
 
         @SlowPath
-        void setTrap(PhylumTrap trap) {
+        void setTrap(SyntaxTagTrap trap) {
             assert trap == null || isTaggedAs(trap.getTag());
             probeUnchanged.invalidate();
             this.trap = trap;
@@ -288,7 +288,7 @@
                     CompilerDirectives.transferToInterpreter();
                 }
                 if (trap != null) {
-                    trap.phylumTrappedAt(astNode, frame.materialize());
+                    trap.tagTrappedAt(astNode, frame.materialize());
                 }
                 if (next != null) {
                     next.internalEnter(astNode, frame);
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/ProbeManager.java	Wed Jul 02 23:40:19 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/ProbeManager.java	Wed Jul 02 16:06:42 2014 -0700
@@ -55,20 +55,20 @@
     /**
      * When non-null, "enter" events with matching tags will trigger a callback.
      */
-    private PhylumTrap phylumTrap = null;
+    private SyntaxTagTrap tagTrap = null;
 
     public ProbeManager() {
         this.probeCallback = new ProbeCallback() {
             /**
              * Receives (from the {@link Probe} implementation) and distributes notification that a
-             * {@link Probe} has acquired a new {@linkplain PhylumTag tag}.
+             * {@link Probe} has acquired a new {@linkplain SyntaxTag tag}.
              */
-            public void newTagAdded(ProbeImpl probe, PhylumTag tag) {
+            public void newTagAdded(ProbeImpl probe, SyntaxTag tag) {
                 for (ProbeListener listener : probeListeners) {
                     listener.probeTaggedAs(probe, tag);
                 }
-                if (phylumTrap != null && tag == phylumTrap.getTag()) {
-                    probe.setTrap(phylumTrap);
+                if (tagTrap != null && tag == tagTrap.getTag()) {
+                    probe.setTrap(tagTrap);
                 }
             }
         };
@@ -124,7 +124,7 @@
         return srcToProbe.get(sourceSection) != null;
     }
 
-    public Collection<Probe> findProbesTaggedAs(PhylumTag tag) {
+    public Collection<Probe> findProbesTaggedAs(SyntaxTag tag) {
         final List<Probe> probes = new ArrayList<>();
         for (Probe probe : srcToProbe.values()) {
             if (tag == null || probe.isTaggedAs(tag)) {
@@ -142,31 +142,31 @@
         return new ArrayList<>(probes);
     }
 
-    public void setPhylumTrap(PhylumTrap trap) {
-        assert trap != null;
-        if (this.phylumTrap != null) {
+    public void setTagTrap(SyntaxTagTrap tagTrap) {
+        assert tagTrap != null;
+        if (this.tagTrap != null) {
             throw new IllegalStateException("trap already set");
         }
-        this.phylumTrap = trap;
+        this.tagTrap = tagTrap;
 
-        PhylumTag tag = trap.getTag();
+        SyntaxTag tag = tagTrap.getTag();
         for (ProbeImpl probe : srcToProbe.values()) {
             if (probe.isTaggedAs(tag)) {
-                probe.setTrap(trap);
+                probe.setTrap(tagTrap);
             }
         }
     }
 
-    public void clearPhylumTrap() {
-        if (this.phylumTrap == null) {
+    public void clearTagTrap() {
+        if (this.tagTrap == null) {
             throw new IllegalStateException("no trap set");
         }
         for (ProbeImpl probe : srcToProbe.values()) {
-            if (probe.isTaggedAs(phylumTrap.getTag())) {
+            if (probe.isTaggedAs(tagTrap.getTag())) {
                 probe.setTrap(null);
             }
         }
-        phylumTrap = null;
+        tagTrap = null;
     }
 
 }