Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Jastadd2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
Jastadd2
Commits
ccc3b081
Commit
ccc3b081
authored
Jul 5, 2018
by
Emma Söderberg
Browse files
Options
Downloads
Patches
Plain Diff
Adds dumping of cached values for collection attributes for incremental/debug.
parent
aff42221
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/jastadd/incremental/IncrementalDebug.jadd
+15
-0
15 additions, 0 deletions
src/jastadd/incremental/IncrementalDebug.jadd
src/template/incremental/Debug.tt
+9
-1
9 additions, 1 deletion
src/template/incremental/Debug.tt
with
24 additions
and
1 deletion
src/jastadd/incremental/IncrementalDebug.jadd
+
15
−
0
View file @
ccc3b081
...
@@ -39,6 +39,7 @@ aspect IncrementalDebug {
...
@@ -39,6 +39,7 @@ aspect IncrementalDebug {
tt.expand("ASTDecl.printParamListMethod", out);
tt.expand("ASTDecl.printParamListMethod", out);
tt.expand("ASTDecl.printValueMethod", out);
tt.expand("ASTDecl.printValueMethod", out);
tt.bind("DumpAttributeValues", genDumpAttributeValuesString());
tt.bind("DumpAttributeValues", genDumpAttributeValuesString());
tt.bind("DumpCollAttributeValues", genDumpCollAttributeValuesString());
tt.expand("ASTDecl.dumpCachedValuesMethod", out);
tt.expand("ASTDecl.dumpCachedValuesMethod", out);
tt.bind("DumpTokenDeps", genDumpTokenDepsString());
tt.bind("DumpTokenDeps", genDumpTokenDepsString());
tt.bind("DumpAttributeDeps", genDumpAttributeDepsString());
tt.bind("DumpAttributeDeps", genDumpAttributeDepsString());
...
@@ -128,4 +129,18 @@ aspect IncrementalDebug {
...
@@ -128,4 +129,18 @@ aspect IncrementalDebug {
}
}
return res.toString();
return res.toString();
}
}
/**
* Generate string with code for dumping collection attribute values.
*/
public String ASTDecl.genDumpCollAttributeValuesString() {
StringBuffer res = new StringBuffer();
TemplateContext tt = templateContext();
for (int k = 0; k < getNumCollDecl(); k++) {
CollDecl attr = getCollDecl(k);
tt.bind("AttrSign", attr.signature());
res.append(tt.expand("ASTDecl.dumpCollAttributeValue"));
}
return res.toString();
}
}
}
This diff is collapsed.
Click to expand it.
src/template/incremental/Debug.tt
+
9
−
1
View file @
ccc3b081
...
@@ -118,7 +118,7 @@ $endif
...
@@ -118,7 +118,7 @@ $endif
ASTDecl.dumpCachedValuesMethod = [[
ASTDecl.dumpCachedValuesMethod = [[
public void #name.dumpCachedValues() {
public void #name.dumpCachedValues() {
$DumpAttributeValues
$DumpAttributeValues
// TODO: d
ump
c
oll
ection v
alues
$D
ump
C
oll
AttributeV
alues
$if (!#isASTNodeDecl)
$if (!#isASTNodeDecl)
super.dumpCachedValues();
super.dumpCachedValues();
$endif
$endif
...
@@ -151,6 +151,14 @@ $endif
...
@@ -151,6 +151,14 @@ $endif
$endif
$endif
]]
]]
# Generate code for dumping a collection attribute value.
# TODO: Add support for parameterized/NTA collection attributes.
ASTDecl.dumpCollAttributeValue = [[
if ($(AttrSign)_computed) {
System.out.println("value(" + relativeNodeID() + ":$(AttrSign), " + $(AttrSign)_value + ")");
}
]]
# Generate code for method dumping dependencies
# Generate code for method dumping dependencies
ASTDecl.dumpDependenciesMethod = [[
ASTDecl.dumpDependenciesMethod = [[
private boolean #name.inc_dumpDependencies_visited = false;
private boolean #name.inc_dumpDependencies_visited = false;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment