Module dev.civl.abc

Interface StringLiteralNode

All Superinterfaces:
ASTNode, ExpressionNode, ForLoopInitializerNode, InitializerNode, SizeableNode

public interface StringLiteralNode extends ExpressionNode
Represents an occurrence of a string literal in a program, which is a string surrounded by double quotes. The string may contain various kinds of escape sequences, which have been processed to yield the final "string value". Both the original representation and the string value can be obtained from this class.
  • Method Details

    • getStringRepresentation

      String getStringRepresentation()
      Returns the string literal exactly as it occurred in the source code, with escape sequences, etc.
      Returns:
      original representation in source code
    • setStringRepresentation

      void setStringRepresentation(String representation)
      Sets the value returned by getStringRepresentation().
      Parameters:
      representation - original representation in source code
    • getConstantValue

      StringValue getConstantValue()
      The "executed" version of the string in Java: escape sequences have been replace with the appropriate Java characters, etc.
      Returns:
      string after interpretation
    • copy

      Description copied from interface: ASTNode
      Returns a deep copy of this AST node. The node and all of its descendants will be cloned. The cloning does not copy analysis or attribute information.
      Specified by:
      copy in interface ASTNode
      Specified by:
      copy in interface ExpressionNode
      Specified by:
      copy in interface ForLoopInitializerNode
      Specified by:
      copy in interface InitializerNode
      Specified by:
      copy in interface SizeableNode
      Returns:
      deep copy of this node