Skip to content
Snippets Groups Projects
Commit ea796eea authored by Emma Söderberg's avatar Emma Söderberg
Browse files

Merged in fix-inc-param-debug (pull request #16)

Fix issues with NTA tokens when using param and debug

Approved-by: Jesper Öqvist
parents 47ad4c1c 7c53685a
Branches
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ aspect IncrementalDebug {
if (attr.isHOA()) {
tt.bind("IsParameterized", attr.getNumParameter() > 0);
tt.bind("AttrSign", attr.signature());
tt.bind("IsToken", attr.isToken());
res.append(tt.expand("ASTDecl.checkAndDumpNTADeps"));
}
}
......@@ -73,7 +74,7 @@ aspect IncrementalDebug {
TemplateContext tt = templateContext();
// Add dump string for each coll attribute.
for (CollDecl decl : collDecls()) {
tt.bind("AttrSign", decl.signature());
tt.bind("AttrSign", decl.signature());
res.append(tt.expand("ASTDecl.checkAndDumpCollAttributeDeps"));
}
return res.toString();
......@@ -84,13 +85,10 @@ aspect IncrementalDebug {
*/
public String ASTDecl.genDumpAttributeDepsString() {
StringBuffer res = new StringBuffer();
TemplateContext tt = templateContext();
// Add dump string for each attribute
for (AttrDecl attr : listOfCachedAttributes()) {
tt.bind("IsParameterized", attr.isParameterized());
tt.bind("IsNTA", attr.isHOA());
tt.bind("AttrSign", attr.signature());
res.append(tt.expand("ASTDecl.checkAndDumpAttributeDeps"));
TemplateContext tt = attr.templateContext();
res.append(tt.expand("AttrDecl.checkAndDumpAttributeDeps"));
}
return res.toString();
}
......@@ -120,6 +118,7 @@ aspect IncrementalDebug {
TemplateContext tt = templateContext();
for (AttrDecl attr : listOfCachedAttributes()) {
tt.bind("IsParameterized", attr.getNumParameter() > 0);
tt.bind("IsCircular", attr.isCircular());
tt.bind("PrintAsObject", attr.isPrimitive() || attr.getType().equals("String"));
tt.bind("AttrSign", attr.signature());
res.append(tt.expand("ASTDecl.dumpCachedAttributeValue"));
......
......@@ -139,7 +139,11 @@ if ($(AttrSign)_values != null) {
}
}
$else
$if (IsCircular)
if ($(AttrSign)_computed == $StateClass.NON_CYCLE || $(AttrSign)_computed == state().cycle()) {
$else
if ($(AttrSign)_computed) {
$endif
$if (PrintAsObject)
System.out.println("value(" + relativeNodeID() + ":$(AttrSign), " + $(AttrSign)_value + ")");
$else
......@@ -229,46 +233,50 @@ $endif
]]
# Generate code for checking an attribute handler and dumping its dependencies
ASTDecl.checkAndDumpAttributeDeps = [[
AttrDecl.checkAndDumpAttributeDeps = [[
$if (IncrementalLevelParam)
$if (IsParameterized)
for (java.util.Iterator itr = $(AttrSign)_handler.values().iterator(); itr.hasNext();) {
$if (#isParameterized)
for (java.util.Iterator itr = #(signature)_handler.values().iterator(); itr.hasNext();) {
$DDGNodeName handler = ($DDGNodeName)itr.next();
handler.dumpDeps();
}
$else
if ($(AttrSign)_handler != null) {
$(AttrSign)_handler.dumpDeps();
if (#(signature)_handler != null) {
#(signature)_handler.dumpDeps();
}
$endif
$if (IsNTA)
$if (IsParameterized)
if ($(AttrSign)_proxy != null) {
$(AttrSign)_proxy.dumpDependencies();
$if (#isHOA)
$if (#isParameterized)
if (#(signature)_proxy != null) {
#(signature)_proxy.dumpDependencies();
}
$else
if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) {
$(AttrSign)_value.dumpDependencies();
$if (!#isToken)
if (#(signature)_computed && (#(signature)_value instanceof $ASTNode)) {
#(signature)_value.dumpDependencies();
}
$endif
$endif
$endif
$endif
$if (IncrementalLevelAttr)
if ($(AttrSign)_handler != null) {
$(AttrSign)_handler.dumpDeps();
if (#(signature)_handler != null) {
#(signature)_handler.dumpDeps();
}
$if (IsNTA)
$if (IsParameterized)
if ($(AttrSign)_proxy != null) {
$(AttrSign)_proxy.dumpDependencies();
$if (#isHOA)
$if (#isParameterized)
if (#(signature)_proxy != null) {
#(signature)_proxy.dumpDependencies();
}
$else
if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) {
$(AttrSign)_value.dumpDependencies();
$if (!#isToken)
if (#(signature)_computed && (#(signature)_value instanceof $ASTNode)) {
#(signature)_value.dumpDependencies();
}
$endif
$endif
$endif
$endif
]]
# Generate code for method dumping dependencies in tree
......@@ -299,8 +307,10 @@ if ($(AttrSign)_proxy != null) {
$(AttrSign)_proxy.dumpDepsInTree();
}
$else
$if (!IsToken)
if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) {
$(AttrSign)_value.dumpDepsInTree();
}
$endif
$endif
]]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment