io.deephaven.lang.api.IsScope Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-open-api-lang-parser Show documentation
Show all versions of deephaven-open-api-lang-parser Show documentation
The 'open-api-lang-parser' project
/**
* Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
*/
package io.deephaven.lang.api;
import io.deephaven.lang.generated.*;
import java.util.ArrayList;
import java.util.List;
/**
* A common interface for {@link ChunkerIdent}, {@link ChunkerInvoke}, {@link ChunkerNew} and {@link ChunkerArray} which
* are the only ast nodes that can be "scope objects": thing.field.callMethod()[0].moreMethod.new
* SomeClass().why.would().you.new Ever()
*/
public interface IsScope extends Node {
String getName();
void setScopeTarget(Node target);
Node getScopeTarget();
List getScope();
default List asScopeList() {
List scopes = new ArrayList<>();
scopes.addAll(getScope());
scopes.add(this);
return scopes;
}
}