From 9ed0da4ed56ff0ee6e71c21f5e187de05def69e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Fri, 7 Aug 2020 03:15:33 +0200 Subject: [PATCH] Make modelica visitor generic --- javacc-wrapper.xml | 9 +++++++ pmd-modelica/pom.xml | 2 +- .../lang/modelica/ast/ASTClassDefinition.java | 2 +- .../modelica/ast/ASTComponentReference.java | 2 +- .../modelica/ast/ASTDerClassSpecifier.java | 2 +- .../pmd/lang/modelica/ast/ASTElementList.java | 2 +- .../ASTEnumerationShortClassSpecifier.java | 2 +- .../ast/ASTExtendingLongClassSpecifier.java | 2 +- .../ASTMultipleDefinitionImportClause.java | 2 +- .../pmd/lang/modelica/ast/ASTName.java | 2 +- .../modelica/ast/ASTRenamingImportClause.java | 2 +- .../ast/ASTSimpleLongClassSpecifier.java | 2 +- .../ast/ASTSimpleShortClassSpecifier.java | 2 +- .../ast/ASTSingleDefinitionImportClause.java | 2 +- .../modelica/ast/ASTStoredDefinition.java | 2 +- .../ast/ASTUnqualifiedImportClause.java | 2 +- .../lang/modelica/ast/ASTWithinClause.java | 2 +- .../modelica/ast/AbstractModelicaNode.java | 4 +-- .../pmd/lang/modelica/ast/ModelicaNode.java | 14 ++++++++++- .../modelica/ast/ModelicaParserVisitor.java | 25 +++++++++++++++++++ .../ast/ModelicaParserVisitorAdapter.java | 7 +++++- .../modelica/ast/ModelicaVisitorBase.java | 14 +++++++++++ .../resolver/ModelicaSymbolFacade.java | 2 +- .../modelica/rule/AbstractModelicaRule.java | 4 +-- .../resolver/ModelicaResolverTest.java | 2 +- 25 files changed, 88 insertions(+), 25 deletions(-) create mode 100644 pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitor.java create mode 100644 pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaVisitorBase.java diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index f0e14fa6c7..4faebf1886 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -500,6 +500,15 @@ public interface" /> + + + + + + + + diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index bdbac9570d..ef470f41ae 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -40,7 +40,7 @@ generate-sources - + diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java index 7735242eec..fc845b675d 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java @@ -68,7 +68,7 @@ public class ASTClassDefinition extends AbstractModelicaNode { } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTComponentReference.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTComponentReference.java index 958ab1975b..78a8a76084 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTComponentReference.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTComponentReference.java @@ -56,7 +56,7 @@ public final class ASTComponentReference extends AbstractModelicaNode implements } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTDerClassSpecifier.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTDerClassSpecifier.java index 902ce473be..fb490eec04 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTDerClassSpecifier.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTDerClassSpecifier.java @@ -10,7 +10,7 @@ public final class ASTDerClassSpecifier extends AbstractModelicaClassSpecifierNo } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java index 315dca7380..451bbe90d7 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java @@ -20,7 +20,7 @@ public class ASTElementList extends AbstractModelicaNode { } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTEnumerationShortClassSpecifier.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTEnumerationShortClassSpecifier.java index 935de9b3ae..9a88f5a990 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTEnumerationShortClassSpecifier.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTEnumerationShortClassSpecifier.java @@ -10,7 +10,7 @@ public final class ASTEnumerationShortClassSpecifier extends AbstractModelicaCla } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTExtendingLongClassSpecifier.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTExtendingLongClassSpecifier.java index d4e468d718..04a54a1675 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTExtendingLongClassSpecifier.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTExtendingLongClassSpecifier.java @@ -12,7 +12,7 @@ public final class ASTExtendingLongClassSpecifier extends AbstractModelicaClassS } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTMultipleDefinitionImportClause.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTMultipleDefinitionImportClause.java index 2c00b81e89..cea681e9b7 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTMultipleDefinitionImportClause.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTMultipleDefinitionImportClause.java @@ -25,7 +25,7 @@ public final class ASTMultipleDefinitionImportClause extends AbstractModelicaImp } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTName.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTName.java index 2032c2f3a7..634b991a58 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTName.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTName.java @@ -19,7 +19,7 @@ public final class ASTName extends AbstractModelicaNode implements ResolvableMod } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTRenamingImportClause.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTRenamingImportClause.java index c3cc002560..1c19b3f3c0 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTRenamingImportClause.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTRenamingImportClause.java @@ -19,7 +19,7 @@ public final class ASTRenamingImportClause extends AbstractModelicaImportClause } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleLongClassSpecifier.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleLongClassSpecifier.java index 8906bd30d4..36e3439bc5 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleLongClassSpecifier.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleLongClassSpecifier.java @@ -12,7 +12,7 @@ public final class ASTSimpleLongClassSpecifier extends AbstractModelicaClassSpec } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleShortClassSpecifier.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleShortClassSpecifier.java index c3d0a47d50..d144ebb861 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleShortClassSpecifier.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSimpleShortClassSpecifier.java @@ -13,7 +13,7 @@ public final class ASTSimpleShortClassSpecifier extends AbstractModelicaClassSpe } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSingleDefinitionImportClause.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSingleDefinitionImportClause.java index 0c7325b7fd..55e6aaee52 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSingleDefinitionImportClause.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTSingleDefinitionImportClause.java @@ -19,7 +19,7 @@ public class ASTSingleDefinitionImportClause extends AbstractModelicaImportClaus } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java index 0bf29bffc5..45d2d4d26b 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java @@ -18,7 +18,7 @@ public class ASTStoredDefinition extends AbstractModelicaNode implements RootNod } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTUnqualifiedImportClause.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTUnqualifiedImportClause.java index a7ddaf740f..82a12070ab 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTUnqualifiedImportClause.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTUnqualifiedImportClause.java @@ -21,7 +21,7 @@ public final class ASTUnqualifiedImportClause extends AbstractModelicaImportClau } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTWithinClause.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTWithinClause.java index 6f84d1eaf7..a2be396808 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTWithinClause.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTWithinClause.java @@ -10,7 +10,7 @@ public final class ASTWithinClause extends AbstractModelicaNode { } @Override - public Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + protected R acceptModelicaVisitor(ModelicaVisitor visitor, P data) { return visitor.visit(this, data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/AbstractModelicaNode.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/AbstractModelicaNode.java index 326340d672..d2cfbdd646 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/AbstractModelicaNode.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/AbstractModelicaNode.java @@ -30,8 +30,8 @@ abstract class AbstractModelicaNode extends AbstractJjtreeNode R acceptModelicaVisitor(ModelicaVisitor visitor, P data); @Override public String getXPathNodeName() { diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaNode.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaNode.java index 102da32f88..fd6e5306bf 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaNode.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaNode.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.lang.modelica.ast; +import net.sourceforge.pmd.annotation.DeprecatedUntil700; +import net.sourceforge.pmd.lang.ast.AstVisitor; import net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode; import net.sourceforge.pmd.lang.modelica.resolver.ModelicaScope; @@ -12,6 +14,17 @@ import net.sourceforge.pmd.lang.modelica.resolver.ModelicaScope; */ public interface ModelicaNode extends JjtreeNode { + + /** + * @deprecated Use {@link #acceptVisitor(AstVisitor, Object)} + */ + @DeprecatedUntil700 + @Deprecated + default Object jjtAccept(ModelicaParserVisitor visitor, Object data) { + return acceptVisitor(visitor, data); + } + + /** * Returns the lexical scope this node is contained in. */ @@ -24,5 +37,4 @@ public interface ModelicaNode extends JjtreeNode { */ ModelicaScope getMostSpecificScope(); - Object jjtAccept(ModelicaParserVisitor visitor, Object data); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitor.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitor.java new file mode 100644 index 0000000000..628084c1b0 --- /dev/null +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitor.java @@ -0,0 +1,25 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.modelica.ast; + +import net.sourceforge.pmd.annotation.DeprecatedUntil700; +import net.sourceforge.pmd.lang.ast.Node; + +/** + * Backwards-compatibility only. + * + * @deprecated Use {@link ModelicaVisitor} + */ +@Deprecated +@DeprecatedUntil700 +public interface ModelicaParserVisitor extends ModelicaVisitor { + + @Override + default Object visitNode(Node node, Object param) { + node.children().forEach(c -> c.acceptVisitor(this, param)); + return param; + } + +} diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitorAdapter.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitorAdapter.java index e4ca918534..cc60cb6226 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitorAdapter.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaParserVisitorAdapter.java @@ -4,5 +4,10 @@ package net.sourceforge.pmd.lang.modelica.ast; -public class ModelicaParserVisitorAdapter implements ModelicaParserVisitor { +import net.sourceforge.pmd.annotation.DeprecatedUntil700; + + +@Deprecated +@DeprecatedUntil700 +public class ModelicaParserVisitorAdapter extends ModelicaVisitorBase implements ModelicaParserVisitor { } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaVisitorBase.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaVisitorBase.java new file mode 100644 index 0000000000..f96d5e547a --- /dev/null +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ModelicaVisitorBase.java @@ -0,0 +1,14 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.modelica.ast; + +import net.sourceforge.pmd.lang.ast.AstVisitorBase; + +/** + * Base implementation of {@link ModelicaVisitor}. + */ +public class ModelicaVisitorBase extends AstVisitorBase implements ModelicaVisitor { + +} diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaSymbolFacade.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaSymbolFacade.java index ed4df5377d..cf91c2edda 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaSymbolFacade.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaSymbolFacade.java @@ -9,6 +9,6 @@ import net.sourceforge.pmd.lang.modelica.ast.ASTStoredDefinition; public class ModelicaSymbolFacade { public void initializeWith(ASTStoredDefinition node) { ScopeAndDeclarationFinder sc = new ScopeAndDeclarationFinder(); - node.jjtAccept(sc, null); + node.acceptVisitor(sc, null); } } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java index a0b549c1dc..5d677fa72e 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java @@ -9,7 +9,6 @@ import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.ast.AstProcessingStage; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.modelica.ModelicaLanguageModule; -import net.sourceforge.pmd.lang.modelica.ast.ModelicaNode; import net.sourceforge.pmd.lang.modelica.ast.ModelicaParserVisitor; import net.sourceforge.pmd.lang.modelica.internal.ModelicaProcessingStage; import net.sourceforge.pmd.lang.rule.AbstractRule; @@ -25,10 +24,9 @@ public abstract class AbstractModelicaRule extends AbstractRule implements Model @Override public void apply(Node target, RuleContext ctx) { - ((ModelicaNode) target).jjtAccept(this, ctx); + target.acceptVisitor(this, ctx); } - @Override public boolean dependsOn(AstProcessingStage stage) { if (!(stage instanceof ModelicaProcessingStage)) { diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java index 69020917bf..a42550c38d 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java @@ -46,7 +46,7 @@ public class ModelicaResolverTest { private ModelicaNode findNodeByClassAndImage(ASTStoredDefinition ast, Class clazz, String image) { NodeFinder vis = new NodeFinder(clazz, image); - ast.jjtAccept(vis, null); + ast.acceptVisitor(vis, null); return vis.getResult(); }