Class IParseTree.Search

java.lang.Object
gw.lang.parser.IParseTree.Search
Enclosing interface:
IParseTree

public static class IParseTree.Search extends Object
  • Constructor Details

    • Search

      public Search()
  • Method Details

    • getDeepestLocation

      public static IParseTree getDeepestLocation(boolean statementsOnly, List<IParseTree> locations, int iStart, int iEnd, boolean strict)
    • isDeeper

      public static boolean isDeeper(IParseTree deepest, IParseTree potentiallyDeeper)
    • 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 examine
      iSegmentStart - 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 examine
      iPosition - The position
      strict - 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

      public static IStatement getHiddenStatement(IParsedElement pe)