Commit a6bd8fb6 authored by René Schöne's avatar René Schöne
Browse files

Revert changes for trace receiver.

parent 0ab7a2dc
Pipeline #8705 failed with stages
in 1 minute and 31 seconds
......@@ -55,10 +55,10 @@ dependencies {
implementation group: 'de.tudresden.inf.st', name: 'dumpAstWithPlantuml', version: '0.3.5'
grammar2umlClasspath group: 'de.tudresden.inf.st', name: 'grammar2uml', version: '0.1.1'
// ragconnectClasspath group: 'de.tudresden.inf.st', name: 'ragconnect', version: '0.2.4'
ragconnectClasspath fileTree(include: ['ragconnect-0.2.5.jar'], dir: '/data/git/jastadd-ragconnect/ragconnect.base/build/libs')
// jastadd2 "org.jastadd:jastadd:2.3.4"
jastadd2 fileTree(include: ['jastadd2.jar'], dir: '/data/git/jastadd-2/')
ragconnectClasspath group: 'de.tudresden.inf.st', name: 'ragconnect', version: '0.2.4'
// ragconnectClasspath fileTree(include: ['ragconnect-0.2.5.jar'], dir: '/data/git/jastadd-ragconnect/ragconnect.base/build/libs')
jastadd2 "org.jastadd:jastadd:2.3.4"
// jastadd2 fileTree(include: ['jastadd2.jar'], dir: '/data/git/jastadd-2/')
}
// Input files for relast
......@@ -161,13 +161,13 @@ jastadd {
extraJastAddOptions = [
'--lineColumnNumbers',
'--List=JastAddList',
'--incremental=param',
'--cache=all',
// '--incremental=param',
// '--cache=all',
// '--tracing=api,flush',
"--flush=full",
// "--flush=full",
// "--incremental=param,debug",
"--tracing=cache,flush",
// "--tracing=cache,flush",
]
}
......
......@@ -2,7 +2,7 @@ package de.tudresden.inf.st.mrc;
import de.tudresden.inf.st.jastadd.dumpAst.ast.Dumper;
import de.tudresden.inf.st.mrc.ast.*;
import de.tudresden.inf.st.mrc.ast.ASTState.Trace.Receiver;
//import de.tudresden.inf.st.mrc.ast.ASTState.Trace.Receiver;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -25,28 +25,28 @@ public class MinimalMain {
private static final String TOPIC_URI_FOR_INPUT = "mqtt://localhost/" + TOPIC_FOR_INPUT;
private static MqttHandler publisher;
static class MinimalReceiver implements Receiver {
List<String> latestAttributes;
Receiver oldReceiver;
MinimalReceiver(Receiver oldReceiver) {
this.oldReceiver = oldReceiver;
reset();
}
void reset() {
latestAttributes = new ArrayList<>();
}
@SuppressWarnings("rawtypes")
@Override
public void accept(ASTState.Trace.Event event, ASTNode node, String attribute, Object params, Object value) {
oldReceiver.accept(event, node, attribute, params, value);
logger.info("event: {}, node: {}, attribute: {}, params: {}, value: {},", event, node, attribute, params, value);
latestAttributes.add(attribute);
}
}
static MinimalReceiver receiver = null;
// static class MinimalReceiver implements Receiver {
// List<String> latestAttributes;
// Receiver oldReceiver;
//
// MinimalReceiver(Receiver oldReceiver) {
// this.oldReceiver = oldReceiver;
// reset();
// }
//
// void reset() {
// latestAttributes = new ArrayList<>();
// }
//
// @SuppressWarnings("rawtypes")
// @Override
// public void accept(ASTState.Trace.Event event, ASTNode node, String attribute, Object params, Object value) {
// oldReceiver.accept(event, node, attribute, params, value);
// logger.info("event: {}, node: {}, attribute: {}, params: {}, value: {},", event, node, attribute, params, value);
// latestAttributes.add(attribute);
// }
// }
// static MinimalReceiver receiver = null;
public static void main(String[] args) throws Exception {
boolean success;
......@@ -97,8 +97,8 @@ public class MinimalMain {
// aWithNoDependency.getC(0).getOutputOnC();
describedWait(2, "Disconnect normalA");
success = normalA.disconnectInput(TOPIC_URI_FOR_INPUT);
logger.info("disconnect success: {}", success);
// success = normalA.disconnectInput(TOPIC_URI_FOR_INPUT);
// logger.info("disconnect success: {}", success);
describedWait(2, "Publish 4");
// receiver.reset();
......@@ -108,8 +108,8 @@ public class MinimalMain {
// logger.info("latest attributes = {}", receiver.latestAttributes);
describedWait(1, "Disconnect aNoDep");
success = aWithNoDependency.disconnectInput(TOPIC_URI_FOR_INPUT);
logger.info("disconnect success: {}", success);
// success = aWithNoDependency.disconnectInput(TOPIC_URI_FOR_INPUT);
// logger.info("disconnect success: {}", success);
describedWait(1, "Publish 6");
publisher.publish(TOPIC_FOR_INPUT, "6".getBytes());
......@@ -165,13 +165,13 @@ public class MinimalMain {
return result;
}
private static void enableTracing(ASTNode<?> node) {
if (node.trace().getReceiver() != null && node.trace().getReceiver() instanceof MinimalReceiver) {
System.out.println("*** receiver already set up ***");
} else {
System.out.println("*** activate receiver ***");
receiver = new MinimalReceiver(node.trace().getReceiver());
node.trace().setReceiver(receiver);
}
}
// private static void enableTracing(ASTNode<?> node) {
// if (node.trace().getReceiver() != null && node.trace().getReceiver() instanceof MinimalReceiver) {
// System.out.println("*** receiver already set up ***");
// } else {
// System.out.println("*** activate receiver ***");
// receiver = new MinimalReceiver(node.trace().getReceiver());
// node.trace().setReceiver(receiver);
// }
// }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment