Class ParserUtil

java.lang.Object
com.softwaremining.jcl.utils.ParserUtil

public class ParserUtil extends Object
Used by JCL modules to parse JCL formats
  • Constructor Details

    • ParserUtil

      public ParserUtil()
  • Method Details

    • splitCOmmaAndBrakets

      public static String[] splitCOmmaAndBrakets(String nextLine)
    • splitCOmmaAndBrakets

      public static String[] splitCOmmaAndBrakets(String nextLine, boolean removeTerminatingComma)
      input types: X=Y,A=(B,C),E,F returns new String { "X=Y" , "A=(B,C)" , "E=F"}
      Parameters:
      nextLine -
      Returns:
    • findMatchingCloseBracket

      public static int findMatchingCloseBracket(String str, char openBracket, char closeBracket)
    • removeSurroundingQuotes

      public static String removeSurroundingQuotes(String data)
    • removeSurroundingBrakets

      public static String removeSurroundingBrakets(String input)
    • removeExtraSpaces

      public static String removeExtraSpaces(String data)
      E.g. Turn " A B C D " into "A B C D"
      Parameters:
      data -
      Returns:
    • removeMatchingBrakets

      public static String removeMatchingBrakets(String input)
      Removes the very first matching '(' ... ')' pair from the input string. Only the two parentheses characters are removed; the enclosed text stays intact.
      Parameters:
      input - the original string
      Returns:
      a new string with the first matching parentheses removed
    • splitTrimmed

      public static String[] splitTrimmed(String nextLine)
      Java's 'String.split' will convert "A B" to 3 tokens "A", " " and "B" This version will generate "A" and "B"
      Parameters:
      nextLine -
      Returns: