Skip to content
Snippets Groups Projects
Commit 647ba7f5 authored by Jesper's avatar Jesper
Browse files

Simplify checkAndDumpAttributeDeps

parent 5c148260
No related branches found
No related tags found
No related merge requests found
...@@ -85,14 +85,10 @@ aspect IncrementalDebug { ...@@ -85,14 +85,10 @@ aspect IncrementalDebug {
*/ */
public String ASTDecl.genDumpAttributeDepsString() { public String ASTDecl.genDumpAttributeDepsString() {
StringBuffer res = new StringBuffer(); StringBuffer res = new StringBuffer();
TemplateContext tt = templateContext();
// Add dump string for each attribute // Add dump string for each attribute
for (AttrDecl attr : listOfCachedAttributes()) { for (AttrDecl attr : listOfCachedAttributes()) {
tt.bind("IsParameterized", attr.isParameterized()); TemplateContext tt = attr.templateContext();
tt.bind("IsNTA", attr.isHOA()); res.append(tt.expand("AttrDecl.checkAndDumpAttributeDeps"));
tt.bind("AttrSign", attr.signature());
tt.bind("IsToken", attr.isToken());
res.append(tt.expand("ASTDecl.checkAndDumpAttributeDeps"));
} }
return res.toString(); return res.toString();
} }
......
...@@ -229,45 +229,45 @@ $endif ...@@ -229,45 +229,45 @@ $endif
]] ]]
# Generate code for checking an attribute handler and dumping its dependencies # Generate code for checking an attribute handler and dumping its dependencies
ASTDecl.checkAndDumpAttributeDeps = [[ AttrDecl.checkAndDumpAttributeDeps = [[
$if (IncrementalLevelParam) $if (IncrementalLevelParam)
$if (IsParameterized) $if (#isParameterized)
for (java.util.Iterator itr = $(AttrSign)_handler.values().iterator(); itr.hasNext();) { for (java.util.Iterator itr = #(signature)_handler.values().iterator(); itr.hasNext();) {
$DDGNodeName handler = ($DDGNodeName)itr.next(); $DDGNodeName handler = ($DDGNodeName)itr.next();
handler.dumpDeps(); handler.dumpDeps();
} }
$else $else
if ($(AttrSign)_handler != null) { if (#(signature)_handler != null) {
$(AttrSign)_handler.dumpDeps(); #(signature)_handler.dumpDeps();
} }
$endif $endif
$if (IsNTA) $if (#isHOA)
$if (IsParameterized) $if (#isParameterized)
if ($(AttrSign)_proxy != null) { if (#(signature)_proxy != null) {
$(AttrSign)_proxy.dumpDependencies(); #(signature)_proxy.dumpDependencies();
} }
$else $else
$if (!IsToken) $if (!#isToken)
if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) { if (#(signature)_computed && (#(signature)_value instanceof $ASTNode)) {
$(AttrSign)_value.dumpDependencies(); #(signature)_value.dumpDependencies();
} }
$endif $endif
$endif $endif
$endif $endif
$endif $endif
$if (IncrementalLevelAttr) $if (IncrementalLevelAttr)
if ($(AttrSign)_handler != null) { if (#(signature)_handler != null) {
$(AttrSign)_handler.dumpDeps(); #(signature)_handler.dumpDeps();
} }
$if (IsNTA) $if (#isHOA)
$if (IsParameterized) $if (#isParameterized)
if ($(AttrSign)_proxy != null) { if (#(signature)_proxy != null) {
$(AttrSign)_proxy.dumpDependencies(); #(signature)_proxy.dumpDependencies();
} }
$else $else
$if (!IsToken) $if (!#isToken)
if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) { if (#(signature)_computed && (#(signature)_value instanceof $ASTNode)) {
$(AttrSign)_value.dumpDependencies(); #(signature)_value.dumpDependencies();
} }
$endif $endif
$endif $endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment