Interface LexicalScope

  • public interface LexicalScope
    Represents that a lexical scope in the language Note that scopes are changing after variable declaration. For example: void draw() { //scope1 int a; //scope2 int b; //scope3 } See
    • Method Detail

      • getScopeElement

        CtElement getScopeElement()
        the CtElement which represents the current scope
      • forEachElementByName

        <T> T forEachElementByName​(java.lang.String name,
                                   java.util.function.Function<? super CtNamedElement,​T> fnc)
        name - to be searched simple name
        fnc - is called for each named element with same simple name, which is defined in this or parent LexicalScope. Function `fnc` is called as long as there are some matching elements and `fnc` returns null. If `fnc` returns not null value then searching is stopped and that value is a returned
        the value returned by `fnc` or null