Class ConditionParser


public class ConditionParser extends Object
A utility class that parses a define condition in a GLSL language style. extractDefines is able to get a list of defines in an expression and update the formatter expression with uppercased defines
  • Constructor Details

    • ConditionParser

      public ConditionParser()
  • Method Details

    • main

      public static void main(String[] argv)
    • extractDefines

      public List<String> extractDefines(String expression)
      Parses a condition and returns the list of defines of this condition. Additionally, this method updates the formattedExpression with uppercased defines names. supported expression syntax example:

      "(LightMap && SeparateTexCoord) || !ColorMap"

      "#if (defined(LightMap) && defined(SeparateTexCoord)) || !defined(ColorMap)"

      "#ifdef LightMap"

      "#ifdef (LightMap && SeparateTexCoord) || !ColorMap"
      expression - the expression to parse
      the list of defines
    • getFormattedExpression

      public String getFormattedExpression()
      the formatted expression previously updated by extractDefines