diff options
Diffstat (limited to 'src/lombok/core/AST.java')
-rw-r--r-- | src/lombok/core/AST.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lombok/core/AST.java b/src/lombok/core/AST.java index 2229f9ef..c1186d24 100644 --- a/src/lombok/core/AST.java +++ b/src/lombok/core/AST.java @@ -97,6 +97,10 @@ public abstract class AST<N> { protected abstract boolean calculateIsStructurallySignificant(); + public Node getNodeFor(N obj) { + return AST.this.get(obj); + } + public N get() { return node; } @@ -150,6 +154,19 @@ public abstract class AST<N> { return fileName; } + public Node add(N newChild, Kind kind) { + Node n = buildTree(newChild, kind); + if ( n == null ) return null; + n.parent = this; + return n; + } + + public Node recursiveSetHandled() { + this.handled = true; + for ( Node child : children ) child.recursiveSetHandled(); + return this; + } + public abstract void addError(String message); public abstract void addWarning(String message); @@ -164,6 +181,8 @@ public abstract class AST<N> { } } + protected abstract Node buildTree(N item, Kind kind); + protected static class FieldAccess { public final Field field; public final int dim; |