public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Set<T> |
filter(Collection<T> data,
java.util.function.Predicate<T> pred) |
static <T> List<T> |
filter(List<T> data,
java.util.function.Predicate<T> pred) |
static <T> T |
findFirst(List<T> data,
java.util.function.Predicate<T> pred) |
static Field[] |
getAllAnnotatedFields(Class<?> clazz) |
static Field[] |
getAllFields(Class<?> clazz) |
static void |
getAllNestedScopedSymbols(Scope scope,
List<Scope> scopes)
Order of scopes not guaranteed but is currently breadth-first according
to nesting depth.
|
static void |
getAllNestedScopes(Scope scope,
List<Scope> scopes)
Order of scopes not guaranteed but is currently breadth-first according
to nesting depth.
|
static org.antlr.v4.runtime.ParserRuleContext |
getAncestor(org.antlr.v4.runtime.Parser parser,
org.antlr.v4.runtime.ParserRuleContext ctx,
String ruleName)
Return first ancestor node up the chain towards the root that has ruleName.
|
static org.antlr.v4.runtime.ParserRuleContext |
getAncestor(org.antlr.v4.runtime.ParserRuleContext t,
int ruleIndex)
Return first ancestor node up the chain towards the root that has the rule index.
|
static org.antlr.v4.runtime.ParserRuleContext |
getFirstAncestorOfType(org.antlr.v4.runtime.ParserRuleContext t,
Class<?> clazz)
Return first ancestor node up the chain towards the root that is clazz.
|
static <T> String |
join(Collection<T> data,
String separator) |
static <T> String |
join(Collection<T> data,
String separator,
String left,
String right) |
static <T> String |
join(Iterator<T> iter,
String separator,
String left,
String right) |
static <T> String |
join(T[] array,
String separator) |
static String |
joinScopeNames(List<Scope> scopes,
String separator) |
static <T,R> List<R> |
map(Collection<T> data,
java.util.function.Function<T,R> getter) |
static <T,R> List<R> |
map(T[] data,
java.util.function.Function<T,R> getter) |
static String |
tab(int n) |
static String |
toQualifierString(Scope scope,
String separator)
Return a string of scope names with the "stack" growing to the right.
|
static String |
toScopeStackString(Scope scope,
String separator)
Return a string of scope names with the "stack" growing to the left
E.g., myblock:mymethod:myclass.
|
static String |
toString(Scope s) |
static String |
toString(Scope s,
int level) |
public static org.antlr.v4.runtime.ParserRuleContext getAncestor(org.antlr.v4.runtime.Parser parser,
org.antlr.v4.runtime.ParserRuleContext ctx,
String ruleName)
public static org.antlr.v4.runtime.ParserRuleContext getAncestor(org.antlr.v4.runtime.ParserRuleContext t,
int ruleIndex)
public static org.antlr.v4.runtime.ParserRuleContext getFirstAncestorOfType(org.antlr.v4.runtime.ParserRuleContext t,
Class<?> clazz)
public static void getAllNestedScopedSymbols(Scope scope, List<Scope> scopes)
public static void getAllNestedScopes(Scope scope, List<Scope> scopes)
public static String toScopeStackString(Scope scope, String separator)
public static String toQualifierString(Scope scope, String separator)
public static <T> T findFirst(List<T> data, java.util.function.Predicate<T> pred)
public static <T> List<T> filter(List<T> data, java.util.function.Predicate<T> pred)
public static <T> Set<T> filter(Collection<T> data, java.util.function.Predicate<T> pred)
public static <T,R> List<R> map(Collection<T> data, java.util.function.Function<T,R> getter)
public static <T,R> List<R> map(T[] data, java.util.function.Function<T,R> getter)
public static <T> String join(Collection<T> data, String separator)
public static <T> String join(Collection<T> data, String separator, String left, String right)
public static String tab(int n)
Copyright © 2016 ANTLR. All Rights Reserved.