Class ConditionParser

java.lang.Object
com.jme3.material.plugins.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"
      Parameters:
      expression - the expression to parse
      Returns:
      the list of defines
    • getFormattedExpression

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