From b9512b907985e225e6e306b0349789bb3368ba8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emma=20S=C3=B6derberg?= <emma.m.soderberg@gmail.com> Date: Mon, 18 Jan 2021 15:51:50 +0100 Subject: [PATCH] Add start of adding aspect info to traces --- src/template/ast/State.tt | 2 +- src/template/trace/TraceHooks.tt | 102 +++++++++++++------------- src/template/trace/Tracer.tt | 118 ++++++++++++++++--------------- 3 files changed, 113 insertions(+), 109 deletions(-) diff --git a/src/template/ast/State.tt b/src/template/ast/State.tt index c7168bd8..fe748d89 100644 --- a/src/template/ast/State.tt +++ b/src/template/ast/State.tt @@ -441,7 +441,7 @@ $if(TracingEnabled) public static ReceiverFactory receiverFactory = new ReceiverFactory() { public Trace.Receiver build() { return new Trace.Receiver() { - public void accept($StateClass.Trace.Event event, $ASTNode node, String attribute, + public void accept($StateClass.Trace.Event event, String aspect, $ASTNode node, String attribute, Object params, Object value) { } }; diff --git a/src/template/trace/TraceHooks.tt b/src/template/trace/TraceHooks.tt index 46bd522c..4abdb5a2 100644 --- a/src/template/trace/TraceHooks.tt +++ b/src/template/trace/TraceHooks.tt @@ -37,7 +37,7 @@ AttrDecl.traceComputeBegin [[ $if (TraceCompute) $if(#isParameterized) $if(#isCircular) -state().trace().computeBegin(this, "#hostClassName.#signatureJavaStyle", _parameters, ""); +state().trace().computeBegin("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, ""); $else $if(!#isMemoized) $if(!VisitCheckEnabled) @@ -48,10 +48,10 @@ Object _parameters = java.util.Arrays.asList(#parameters); $endif $endif $endif -state().trace().computeBegin(this, "#hostClassName.#signatureJavaStyle", _parameters, ""); +state().trace().computeBegin("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, ""); $endif $else -state().trace().computeBegin(this, "#hostClassName.#signatureJavaStyle", "", ""); +state().trace().computeBegin("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", ""); $endif $endif ]] @@ -60,12 +60,12 @@ AttrDecl.traceComputeEnd [[ $if (TraceCompute) $if(#isParameterized) $if(#isCircular) -state().trace().computeEnd(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().computeEnd("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().computeEnd(this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_value); +state().trace().computeEnd("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_value); $endif $else -state().trace().computeEnd(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().computeEnd("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif ]] @@ -73,9 +73,9 @@ $endif AttrDecl.traceComputeEndInline [[ $if (TraceCompute) $if(#isParameterized) -state().trace().computeEnd(this, "#hostClassName.#signatureJavaStyle", _parameters, ""); +state().trace().computeEnd("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, ""); $else -state().trace().computeEnd(this, "#hostClassName.#signatureJavaStyle", "", ""); +state().trace().computeEnd("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", ""); $endif $endif ]] @@ -85,12 +85,12 @@ $if (TraceCache) $if(#isMemoized) $if(#isParameterized) $if(#isCircular) -state().trace().cacheRead(this, "#hostClassName.#signatureJavaStyle", _parameters, _cache); +state().trace().cacheRead("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _cache); $else -state().trace().cacheRead(this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_values.get(_parameters)); +state().trace().cacheRead("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_values.get(_parameters)); $endif $else -state().trace().cacheRead(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().cacheRead("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -101,12 +101,12 @@ $if (TraceCache) $if(#isMemoized) $if(#isParameterized) $if(#isCircular) -state().trace().cacheWrite(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().cacheWrite("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().cacheWrite(this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_value); +state().trace().cacheWrite("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_value); $endif $else -state().trace().cacheWrite(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().cacheWrite("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -117,12 +117,12 @@ $if (TraceCache) $if(#isMemoized) $if(#isParameterized) $if(#isCircular) -state().trace().cacheAbort(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().cacheAbort("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().cacheAbort(this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_value); +state().trace().cacheAbort("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, #(signature)_value); $endif $else -state().trace().cacheAbort(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().cacheAbort("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -132,15 +132,15 @@ AttrDecl.traceCircularEnterCase1 [[ $if (TraceCircular) $if(#getNTA) $if(#isParameterized) -state().trace().enterCircularNTACase1(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().enterCircularNTACase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().enterCircularNTACase1(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().enterCircularNTACase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $else $if(#isParameterized) -state().trace().enterCircularCase1(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().enterCircularCase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().enterCircularCase1(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().enterCircularCase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -150,18 +150,18 @@ AttrDecl.traceCircularCase1Change [[ $if (TraceCircular) $if(#getNTA) $if(#isParameterized) -state().trace().circularNTACase1Change(this, "#hostClassName.#signatureJavaStyle", _parameters, +state().trace().circularNTACase1Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value + "->" + new_#(signature)_value); $else -state().trace().circularNTACase1Change(this, "#hostClassName.#signatureJavaStyle", "", +state().trace().circularNTACase1Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value + "->" + new_#(signature)_value); $endif $else $if(#isParameterized) -state().trace().circularCase1Change(this, "#hostClassName.#signatureJavaStyle", _parameters, +state().trace().circularCase1Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value + "->" + new_#(signature)_value); $else -state().trace().circularCase1Change(this, "#hostClassName.#signatureJavaStyle", "", +state().trace().circularCase1Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value + "->" + new_#(signature)_value); $endif $endif @@ -172,15 +172,15 @@ AttrDecl.traceCircularExitCase1 [[ $if (TraceCircular) $if(#getNTA) $if(#isParameterized) -state().trace().exitCircularNTACase1(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().exitCircularNTACase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().exitCircularNTACase1(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().exitCircularNTACase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $else $if(#isParameterized) -state().trace().exitCircularCase1(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().exitCircularCase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().exitCircularCase1(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().exitCircularCase1("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -190,15 +190,15 @@ AttrDecl.traceCircularEnterCase2 [[ $if (TraceCircular) $if(#getNTA) $if(#isParameterized) -state().trace().enterCircularNTACase2(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().enterCircularNTACase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().enterCircularNTACase2(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().enterCircularNTACase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $else $if(#isParameterized) -state().trace().enterCircularCase2(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().enterCircularCase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().enterCircularCase2(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().enterCircularCase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -208,18 +208,18 @@ AttrDecl.traceCircularCase2Change [[ $if (TraceCircular) $if(#getNTA) $if(#isParameterized) -state().trace().circularNTACase2Change(this, "#hostClassName.#signatureJavaStyle", _parameters, +state().trace().circularNTACase2Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value + "->" + new_#(signature)_value); $else -state().trace().circularNTACase2Change(this, "#hostClassName.#signatureJavaStyle", "", +state().trace().circularNTACase2Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value + "->" + new_#(signature)_value); $endif $else $if(#isParameterized) -state().trace().circularCase2Change(this, "#hostClassName.#signatureJavaStyle", _parameters, +state().trace().circularCase2Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value + "->" + new_#(signature)_value); $else -state().trace().circularCase2Change(this, "#hostClassName.#signatureJavaStyle", "", +state().trace().circularCase2Change("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value + "->" + new_#(signature)_value); $endif $endif @@ -230,15 +230,15 @@ AttrDecl.traceCircularExitCase2 [[ $if (TraceCircular) $if(#getNTA) $if(#isParameterized) -state().trace().exitCircularNTACase2(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().exitCircularNTACase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().exitCircularNTACase2(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().exitCircularNTACase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $else $if(#isParameterized) -state().trace().exitCircularCase2(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().exitCircularCase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().exitCircularCase2(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().exitCircularCase2("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -248,15 +248,15 @@ AttrDecl.traceCircularExitCase3 [[ $if (TraceCircular) $if(#getNTA) $if(#isParameterized) -state().trace().exitCircularNTACase3(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().exitCircularNTACase3("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().exitCircularNTACase3(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().exitCircularNTACase3("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $else $if(#isParameterized) -state().trace().exitCircularCase3(this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); +state().trace().exitCircularCase3("#getAspectName", this, "#hostClassName.#signatureJavaStyle", _parameters, _value.value); $else -state().trace().exitCircularCase3(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().exitCircularCase3("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif $endif @@ -316,31 +316,31 @@ $endif AttrDecl.traceFlushAttr [[ $if (TraceFlush) $if(#isParameterized) -state().trace().flushAttr(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_values); +state().trace().flushAttr("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_values); $else -state().trace().flushAttr(this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); +state().trace().flushAttr("#getAspectName", this, "#hostClassName.#signatureJavaStyle", "", #(signature)_value); $endif $endif ]] CollEq.traceContributionCheckBegin [[ $if (TraceColl) -state().trace().contributionCheckBegin(this, "#collectionId", "#escapeConditionForTemplate"); +state().trace().contributionCheckBegin("#getAspectName", this, "#collectionId", "#escapeConditionForTemplate"); $endif ]] CollEq.traceContributionCheckEnd [[ $if (TraceColl) -state().trace().contributionCheckEnd(this, "#collectionId", "#escapeConditionForTemplate"); +state().trace().contributionCheckEnd("#getAspectName", this, "#collectionId", "#escapeConditionForTemplate"); $endif ]] CollEq.traceContributionCheckMatch [[ $if (TraceColl) $if(#iterableValue) -state().trace().contributionCheckMatch(this, "#collectionId", "#escapeConditionForTemplate", value); +state().trace().contributionCheckMatch("#getAspectName", this, "#collectionId", "#escapeConditionForTemplate", value); $else -state().trace().contributionCheckMatch(this, "#collectionId", "#escapeConditionForTemplate", #getValue); +state().trace().contributionCheckMatch("#getAspectName", this, "#collectionId", "#escapeConditionForTemplate", #getValue); $endif $endif ]] diff --git a/src/template/trace/Tracer.tt b/src/template/trace/Tracer.tt index 0a90a599..30428bae 100644 --- a/src/template/trace/Tracer.tt +++ b/src/template/trace/Tracer.tt @@ -90,12 +90,16 @@ public static class Trace { TOKEN_READ; } + // For traced operations inherent in all ASTs, e.g., copy, or from elements + // derived from the grammar, e.g., tokens. + public static final String ASPECT_AST = "AST"; + /** * Functional interface for a trace event receiver. * This can be implemented by applications that want to trace attribute evaluation. */ public interface Receiver { - void accept($StateClass.Trace.Event event, $ASTNode node, String attribute, + void accept($StateClass.Trace.Event event, String aspect, $ASTNode node, String attribute, Object params, Object value); } @@ -108,7 +112,7 @@ public static class Trace { // The default event receiver does nothing. private Receiver receiver = new Receiver() { - public void accept($StateClass.Trace.Event event, $ASTNode node, String attribute, + public void accept($StateClass.Trace.Event event, String aspect, $ASTNode node, String attribute, Object params, Object value) { } }; @@ -129,40 +133,40 @@ public static class Trace { * Trace that an attribute instance started its computation. * @param value The value of the attribute instance. */ - public void computeBegin($ASTNode node, String attr, Object params, Object value) { - receiver.accept(Event.COMPUTE_BEGIN, node, attr, params, value); + public void computeBegin(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept(Event.COMPUTE_BEGIN, aspect, node, attr, params, value); } /** * Trace that an attribute instance ended its computation. * @param value The value of the attribute instance. */ - public void computeEnd($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.COMPUTE_END, node, attr, params, value); + public void computeEnd(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.COMPUTE_END, aspect, node, attr, params, value); } /** * Trace that the cache of an attribute instances was read. * @param value The value of the attribute instance. */ - public void cacheRead($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CACHE_READ, node, attr, params, value); + public void cacheRead(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CACHE_READ, aspect, node, attr, params, value); } /** * Trace that an attribute instance was cached. * @param value The value of the attribute instance. */ - public void cacheWrite($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CACHE_WRITE, node, attr, params, value); + public void cacheWrite(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CACHE_WRITE, aspect, node, attr, params, value); } /** * Trace that the caching of an attribute instance was aborted. * @param value The value of the attribute instance. */ - public void cacheAbort($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CACHE_ABORT, node, attr, params, value); + public void cacheAbort(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CACHE_ABORT, aspect, node, attr, params, value); } /** @@ -170,7 +174,7 @@ public static class Trace { * @param value The value of the rewrite. */ public void enterRewriteCase1($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.REWRITE_CASE1_START, node, attr, params, value); + receiver.accept($StateClass.Trace.Event.REWRITE_CASE1_START, ASPECT_AST, node, attr, params, value); } /** @@ -178,7 +182,7 @@ public static class Trace { * @param value The value of the rewrite before and after. */ public void rewriteChange($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.REWRITE_CASE1_CHANGE, node, attr, params, value); + receiver.accept($StateClass.Trace.Event.REWRITE_CASE1_CHANGE, ASPECT_AST, node, attr, params, value); } /** @@ -186,7 +190,7 @@ public static class Trace { * @param value The value of the rewrite. */ public void exitRewriteCase1($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.REWRITE_CASE1_RETURN, node, attr, params, value); + receiver.accept($StateClass.Trace.Event.REWRITE_CASE1_RETURN, ASPECT_AST, node, attr, params, value); } /** @@ -194,7 +198,7 @@ public static class Trace { * @param value The value of the rewrite. */ public void exitRewriteCase2($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.REWRITE_CASE2_RETURN, node, attr, params, value); + receiver.accept($StateClass.Trace.Event.REWRITE_CASE2_RETURN, ASPECT_AST, node, attr, params, value); } /** @@ -202,119 +206,119 @@ public static class Trace { * @param value The value of the rewrite. */ public void exitRewriteCase3($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.REWRITE_CASE3_RETURN, node, attr, params, value); + receiver.accept($StateClass.Trace.Event.REWRITE_CASE3_RETURN, ASPECT_AST, node, attr, params, value); } /** * Trace that a circular attribute instance entered evaluation case 1. * @param value The value of the circular attribute instance. */ - public void enterCircularCase1($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE1_START, node, attr, params, value); + public void enterCircularCase1(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE1_START, aspect, node, attr, params, value); } /** * Trace that a circular attribute instance in evaluation case 1 changed value. * @param value The value of the circular attribute instance, before and after. */ - public void circularCase1Change($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE1_CHANGE, node, attr, params, value); + public void circularCase1Change(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE1_CHANGE, aspect, node, attr, params, value); } /** * Trace that a circular attribute instance returned from evaluation case 1. * @param value The value of the circular attribute instance. */ - public void exitCircularCase1($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE1_RETURN, node, attr, params, value); + public void exitCircularCase1(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE1_RETURN, aspect, node, attr, params, value); } /** * Trace that a circular attribute instance entered evaluation case 2. * @param value The value of the circular attribute instance. */ - public void enterCircularCase2($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE2_START, node, attr, params, value); + public void enterCircularCase2(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE2_START, aspect, node, attr, params, value); } /** * Trace that a circular attribute instance in evaluation case 2 changed value. * @param value The value of the circular attribute instance, before and after. */ - public void circularCase2Change($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE2_CHANGE, node, attr, params, value); + public void circularCase2Change(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE2_CHANGE, aspect, node, attr, params, value); } /** * Trace that a circular attribute instance returned from evaluation case 2. * @param value The value of the circular attribute instance. */ - public void exitCircularCase2($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE2_RETURN, node, attr, params, value); + public void exitCircularCase2(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE2_RETURN, aspect, node, attr, params, value); } /** * Trace that a circular attribute instance returned from evaluation case 2. * @param value The value of the circular attribute instance. */ - public void exitCircularCase3($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE3_RETURN, node, attr, params, value); + public void exitCircularCase3(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_CASE3_RETURN, aspect, node, attr, params, value); } /** * Trace that a circular NTA entered evaluation case 1. * @param value The value of the circular NTA. */ - public void enterCircularNTACase1($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE1_START, node, attr, params, value); + public void enterCircularNTACase1(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE1_START, aspect, node, attr, params, value); } /** * Trace that a circular NTA in evaluation case 1 changed value. * @param value The value of the circular NTA, before and after. */ - public void circularNTACase1Change($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE1_CHANGE, node, attr, params, value); + public void circularNTACase1Change(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE1_CHANGE, aspect, node, attr, params, value); } /** * Trace that a circular NTA returned from evaluation case 1. * @param value The value of the circular NTA. */ - public void exitCircularNTACase1($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE1_RETURN, node, attr, params, value); + public void exitCircularNTACase1(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE1_RETURN, aspect, node, attr, params, value); } /** * Trace that a circular NTA entered evaluation case 2. * @param value The value of the circular NTA. */ - public void enterCircularNTACase2($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE2_START, node, attr, params, value); + public void enterCircularNTACase2(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE2_START, aspect, node, attr, params, value); } /** * Trace that a circular NTA in evaluation case 2 changed value. * @param value The value of the circular NTA, before and after. */ - public void circularNTACase2Change($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE2_CHANGE, node, attr, params, value); + public void circularNTACase2Change(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE2_CHANGE, aspect, node, attr, params, value); } /** * Trace that a circular NTA returned from evaluation case 2. * @param value The value of the circular NTA. */ - public void exitCircularNTACase2($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE2_RETURN, node, attr, params, value); + public void exitCircularNTACase2(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE2_RETURN, aspect, node, attr, params, value); } /** * Trace that a circular NTA returned from evaluation case 2. * @param value The value of the circular NTA. */ - public void exitCircularNTACase3($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE3_RETURN, node, attr, params, value); + public void exitCircularNTACase3(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.CIRCULAR_NTA_CASE3_RETURN, aspect, node, attr, params, value); } /** @@ -323,50 +327,50 @@ public static class Trace { * @param value The value of the node. */ public void copyNode($ASTNode node, Object value) { - receiver.accept($StateClass.Trace.Event.COPY_NODE, node, "ASTNode.copy", "", value); + receiver.accept($StateClass.Trace.Event.COPY_NODE, ASPECT_AST, node, "ASTNode.copy", "", value); } /** * Trace that an attribute was flushed. * @param value The value of the attribute. */ - public void flushAttr($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.FLUSH_ATTR, node, attr, params, value); + public void flushAttr(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.FLUSH_ATTR, aspect, node, attr, params, value); } /** * Trace that an attribute was flushed by incremental evaluation. */ - public void flushIncAttr($ASTNode node, String attr, Object params, Object value) { - receiver.accept($StateClass.Trace.Event.INC_FLUSH_ATTR, node, attr, params, value); + public void flushIncAttr(String aspect, $ASTNode node, String attr, Object params, Object value) { + receiver.accept($StateClass.Trace.Event.INC_FLUSH_ATTR, aspect, node, attr, params, value); } /** * Trace that a contribution check to a collection attribute begun. */ - public void contributionCheckBegin($ASTNode node, String attr, String check) { - receiver.accept($StateClass.Trace.Event.CONTRIBUTION_CHECK_BEGIN, node, attr, check, ""); + public void contributionCheckBegin(String aspect, $ASTNode node, String attr, String check) { + receiver.accept($StateClass.Trace.Event.CONTRIBUTION_CHECK_BEGIN, aspect, node, attr, check, ""); } /** * Trace that a contribution check to a collection attribute ended. */ - public void contributionCheckEnd($ASTNode node, String attr, String check) { - receiver.accept($StateClass.Trace.Event.CONTRIBUTION_CHECK_END, node, attr, check, ""); + public void contributionCheckEnd(String aspect, $ASTNode node, String attr, String check) { + receiver.accept($StateClass.Trace.Event.CONTRIBUTION_CHECK_END, aspect, node, attr, check, ""); } /** * Trace that a contribution check to a collection attribute found a match. */ - public void contributionCheckMatch($ASTNode node, String attr, String check, Object value) { - receiver.accept($StateClass.Trace.Event.CONTRIBUTION_CHECK_MATCH, node, attr, check, value); + public void contributionCheckMatch(String aspect, $ASTNode node, String attr, String check, Object value) { + receiver.accept($StateClass.Trace.Event.CONTRIBUTION_CHECK_MATCH, aspect, node, attr, check, value); } /** * Trace that a token was read. */ public void tokenRead($ASTNode node, String token, Object value) { - receiver.accept($StateClass.Trace.Event.TOKEN_READ, node, token, "", value); + receiver.accept($StateClass.Trace.Event.TOKEN_READ, ASPECT_AST, node, token, "", value); } } -- GitLab