[Groovy] Class ScriptVariableAnalyzer
- org.apache.groovy.groovysh.util.ScriptVariableAnalyzer
@TypeChecked class ScriptVariableAnalyzer extends Object
Class to Class parsing a script to detect all bound and unbound variables. Based on http://glaforge.appspot.com/article/knowing-which-variables-are-bound-or-not-in-a-groovy-script
Nested Class Summary
Modifiers | Name | Description |
---|---|---|
static class | ScriptVariableAnalyzer.VariableVisitor | define a visitor that visits all variable expressions |
static class | ScriptVariableAnalyzer.VisitorClassLoader | class loader to add our phase operation |
static class | ScriptVariableAnalyzer.VisitorSourceOperation | custom IPrimaryClassNodeOperation to be able to hook our code visitor |
Constructor Summary
Constructor and description |
---|
ScriptVariableAnalyzer
() |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
static Set<String> |
getBoundVars(String scriptText, ClassLoader parent) |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail
ScriptVariableAnalyzer()
Method Detail
static Set<String> getBoundVars(String scriptText, ClassLoader parent)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/apache/groovy/groovysh/util/ScriptVariableAnalyzer.html