- All Superinterfaces:
Expression,LiteralExpression,Sourceable
This class represents compound literal expressions, including string
literals.
A CompoundLiteralExpression should be set with either a
CompoundLiteralExpression.CIVLCompoundLiteralObject or a constant value, but not both of them.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe CIVL model counterpart ofCompoundLiteralObjectin ABC.static interfaceThe CIVL model counterpart ofLiteralObjectin ABC.static interfaceThe CIVL model counterpart ofScalarLiteralObjectin ABC.Nested classes/interfaces inherited from interface dev.civl.mc.model.IF.expression.Expression
Expression.ExpressionKindNested classes/interfaces inherited from interface dev.civl.mc.model.IF.expression.LiteralExpression
LiteralExpression.LiteralKind -
Method Summary
Modifier and TypeMethodDescriptioncreateCompoundLiteralObject(CIVLType type, List<CompoundLiteralExpression.CIVLLiteralObject> elements) createScalarLiteralObject(CIVLType type, Expression expr) booleanvoidSetCompoundLiteralExpression.CIVLCompoundLiteralObjectof this expression.type()Methods inherited from interface dev.civl.mc.model.IF.expression.Expression
calculateConstantValue, calculateDerefs, constantValue, containsHere, expressionKind, expressionScope, freeVariables, getExpressionType, hasConstantValue, hasDerefs, isErrorFree, isPurelyLocal, lowestScope, purelyLocalAnalysis, purelyLocalAnalysisOfVariables, replaceWith, replaceWith, setErrorFree, variableAddressedOf, variableAddressedOfMethods inherited from interface dev.civl.mc.model.IF.expression.LiteralExpression
literalKind, setLiteralConstantValueMethods inherited from interface dev.civl.mc.model.IF.Sourceable
getSource, setCIVLSource
-
Method Details
-
type
CIVLType type()- Returns:
- a C aggregate type
-
isStringLiteral
boolean isStringLiteral()- Returns:
- true iff this compound literal expression represents a string literal
-
setLiteralObject
SetCompoundLiteralExpression.CIVLCompoundLiteralObjectof this expression. A CompoundLiteralExpression must either have a CompoundLiteralObj or a constant value. -
getLiteralObject
CompoundLiteralExpression.CIVLCompoundLiteralObject getLiteralObject()- Returns:
- the
CompoundLiteralExpression.CIVLCompoundLiteralObjectof this expression; or null if this expression has a constant value
-
createScalarLiteralObject
CompoundLiteralExpression.CIVLLiteralObject createScalarLiteralObject(CIVLType type, Expression expr) -
createCompoundLiteralObject
CompoundLiteralExpression.CIVLCompoundLiteralObject createCompoundLiteralObject(CIVLType type, List<CompoundLiteralExpression.CIVLLiteralObject> elements)
-