- All Superinterfaces:
ASTNode,ExpressionNode,ForLoopInitializerNode,InitializerNode,SizeableNode
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.expression.ExpressionNode
ExpressionNode.ExpressionKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.The "executed" version of the string in Java: escape sequences have been replace with the appropriate Java characters, etc.Returns the string literal exactly as it occurred in the source code, with escape sequences, etc.voidsetStringRepresentation(String representation) Sets the value returned bygetStringRepresentation().Methods inherited from interface dev.civl.abc.ast.node.IF.ASTNode
addAllTransformAnnotations, addTransformAnnotation, child, childIndex, children, diff, equiv, getAttribute, getOwner, getScope, getSource, id, keepOnly, nextDFS, nodeKind, numChildren, parent, prettyPrint, prettyRepresentation, prettyRepresentation, print, remove, removeChild, removeTransformAnnotation, setAttribute, setChild, setId, setOwner, setScope, toString, transformAnnotationsMethods inherited from interface dev.civl.abc.ast.node.IF.expression.ExpressionNode
addConversion, expressionKind, getConversion, getConvertedType, getInitialType, getNumConversions, isConstantExpression, isLvalue, removeConversions, setInitialTypeMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.InitializerNode
isSideEffectFreeMethods inherited from interface dev.civl.abc.ast.node.IF.expression.SizeableNode
getType
-
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
Sets the value returned bygetStringRepresentation().- 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
StringLiteralNode copy()Description copied from interface:ASTNodeReturns 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:
copyin interfaceASTNode- Specified by:
copyin interfaceExpressionNode- Specified by:
copyin interfaceForLoopInitializerNode- Specified by:
copyin interfaceInitializerNode- Specified by:
copyin interfaceSizeableNode- Returns:
- deep copy of this node
-