- All Superinterfaces:
ASTNode,BlockItemNode
A static assertion has syntax
_Static_assert ( constant-expression , string-literal ). It may
appear anywhere an external definition may appear, i.e., in the outermost
file scope. It is an assertion which is checked statically (i.e., at
"compile time"). The constant expression is evaluated. If it is 0, a
violation is reported.-
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.statement.BlockItemNode
BlockItemNode.BlockItemKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.Gets the constant expression argument from this static assertion.Gests the string literal message argument from this static assertion.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.statement.BlockItemNode
blockItemKind
-
Method Details
-
getExpression
ExpressionNode getExpression()Gets the constant expression argument from this static assertion.- Returns:
- the constant expression argument
-
getMessage
StringLiteralNode getMessage()Gests the string literal message argument from this static assertion. This is the message printed if the assertion is violated.- Returns:
- the string literal argument
-
copy
StaticAssertionNode 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 interfaceBlockItemNode- Returns:
- deep copy of this node
-