Class StringLiteralExpr

    • Constructor Detail

      • StringLiteralExpr

        public StringLiteralExpr()
      • StringLiteralExpr

        public StringLiteralExpr​(String value)
        Creates a string literal expression from given string. Escapes EOL characters.
        Parameters:
        value - the value of the literal
      • StringLiteralExpr

        public StringLiteralExpr​(TokenRange tokenRange,
                                 String value)
        This constructor is used by the parser and is considered private.
    • Method Detail

      • accept

        public <R,​A> R accept​(GenericVisitor<R,​A> v,
                                    A arg)
        Description copied from interface: Visitable
        Accept method for visitor support.
        Type Parameters:
        R - the type of the return value of the visitor
        A - the type the user argument passed to the visitor
        Parameters:
        v - the visitor implementation
        arg - the argument passed to the visitor (of type A)
        Returns:
        the result of the visit (of type R)
      • accept

        public <A> void accept​(VoidVisitor<A> v,
                               A arg)
        Description copied from interface: Visitable
        Accept method for visitor support.
        Type Parameters:
        A - the type the argument passed for the visitor
        Parameters:
        v - the visitor implementation
        arg - any value relevant for the visitor (of type A)
      • setEscapedValue

        public StringLiteralExpr setEscapedValue​(String value)
        Sets the content of this expressions to given value. Escapes EOL characters.
        Parameters:
        value - the new literal value
        Returns:
        self
      • asString

        public String asString()
        Returns:
        the unescaped literal value
      • setString

        public StringLiteralExpr setString​(String value)
        Escapes the given string from special characters and uses it as the literal value.
        Parameters:
        value - unescaped string
        Returns:
        this literal expression