Package gw.lang.parser
Class IParseTree.Search
java.lang.Object
gw.lang.parser.IParseTree.Search
- Enclosing interface:
- IParseTree
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends IParsedElement>
voidgetContainedParsedElementsByType
(List<IParseTree> locations, Class<E> parsedElementClass, List<E> listOut) static IParseTree
getDeepestLocation
(boolean statementsOnly, List<IParseTree> locations, int iStart, int iEnd, boolean strict) static IParseTree
getDeepestLocation
(List<IParseTree> locations, int iPosition, boolean strict) A convenience method to find the deepest location for a specified position given an array of locations (typically obtained via IGosuParser.getLocations())static IParseTree
getDeepestLocation
(List<IParseTree> locations, int iSegmentStart, int iSegmentEnd, boolean strict) A convenience method to find the deepest location for a specified segment given an array of locations (typically obtained via IGosuParser.getLocatoins())static IParseTree
getDeepestLocationSpanning
(List<IParseTree> locations, int iStart, int iEnd, boolean strict) static IParseTree
getDeepestStatementLocation
(List<IParseTree> locations, int iPosition, boolean strict) A convenience method to find the deepest location for a specified position given an array of locations (typically obtained via IGosuParser.getLocatoins())static IStatement
static IParseTree
getStatementAtLine
(List<IParseTree> locations, int iLineNum, Class clsSkip) static boolean
isDeeper
(IParseTree deepest, IParseTree potentiallyDeeper)
-
Constructor Details
-
Search
public Search()
-
-
Method Details
-
getDeepestLocation
public static IParseTree getDeepestLocation(boolean statementsOnly, List<IParseTree> locations, int iStart, int iEnd, boolean strict) -
isDeeper
-
getDeepestLocation
public static IParseTree getDeepestLocation(List<IParseTree> locations, int iPosition, boolean strict) A convenience method to find the deepest location for a specified position given an array of locations (typically obtained via IGosuParser.getLocations())- Parameters:
locations
- An array of locations.iPosition
- A position to check for.strict
- Whether to match strictly or accept white spaces to the right- Returns:
- The deepest descendent location containing the specified location.
-
getDeepestLocation
public static IParseTree getDeepestLocation(List<IParseTree> locations, int iSegmentStart, int iSegmentEnd, boolean strict) A convenience method to find the deepest location for a specified segment given an array of locations (typically obtained via IGosuParser.getLocatoins())- Parameters:
locations
- A list of IParseTree to examineiSegmentStart
- The start of the segment (inclusive)iSegmentEnd
- The end of the segment (inclusive)strict
- Whether to match strictly or accept white spaces to the right- Returns:
- The deepest location found in the list containing the endpoints.
-
getDeepestStatementLocation
public static IParseTree getDeepestStatementLocation(List<IParseTree> locations, int iPosition, boolean strict) A convenience method to find the deepest location for a specified position given an array of locations (typically obtained via IGosuParser.getLocatoins())- Parameters:
locations
- A list of IParseTree to examineiPosition
- The positionstrict
- Whether to match strictly or accept white spaces to the right- Returns:
- The deepest location found in the list containing the position.
-
getStatementAtLine
public static IParseTree getStatementAtLine(List<IParseTree> locations, int iLineNum, Class clsSkip) -
getContainedParsedElementsByType
public static <E extends IParsedElement> void getContainedParsedElementsByType(List<IParseTree> locations, Class<E> parsedElementClass, List<E> listOut) -
getDeepestLocationSpanning
public static IParseTree getDeepestLocationSpanning(List<IParseTree> locations, int iStart, int iEnd, boolean strict) -
getHiddenStatement
-