Class StringLiteralTemplateParser


  • public class StringLiteralTemplateParser
    extends Object
    • Method Detail

      • parse

        public static List<StringLiteralTemplateParser.Expr> parse​(IntPredicate $escapeMatcher,
                                                                   boolean simpleExprDisabled,
                                                                   String stringValue)
        Parse a string from a string literal using standard template delimiters e.g., "$foo" and "${foo.bar()}", and return the list of expressions.
        Parameters:
        $escapeMatcher - Given the index of a '$' returns whether or not the '$' is escaped. Command line compilers filter out the '\' char in the string, so the caller must keep track. Other parsers, like many IDE parsers, preserve the '\' chars in the string, so they have a different (and simpler) way of determining escaped '$' chars.
        simpleExprDisabled - If true, disables simple $ expressions to support ${} expressions only. Note, this argument reflects the `manifold.strings.simple.disabled` javac command line option.
        stringValue - The value of the string literal as returned by the tokenizer.
        Returns:
        The list of expressions from the String