- All Superinterfaces:
ASTNode,BlockItemNode,DeclarationNode,OrdinaryDeclarationNode
-
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.BlockItemKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.declaration.OrdinaryDeclarationNode
OrdinaryDeclarationNode.OrdinaryDeclarationKind -
Method Summary
Modifier and TypeMethodDescriptionAn object declaration may contain any number of alignment specifiers.copy()Returns a deep copy of this AST node.Returns the entity whose existence is declared by this declaration.Gets the (optional) initializer for the object being declared.booleanDoes the declaration include theautostorage class specifier? Default value isfalse, it can be changed usingsetAutoStorage(boolean).booleanDoes the declaration include theregisterstorage class specifier?.booleanDoes this declaration have shared storage scope? Having shared scope means that this declaration declares a variable with workgroup scope.booleanDoes the declaration include the_Thread_localstorage class specifier? Default value isnull; it can be changed usingsetThreadLocalStorage(boolean).booleanOnly used when thisVariableDeclarationNodeis used as a parameter in FORTRAN program.voidsetAutoStorage(boolean value) Sets the value that will be returned byhasAutoStorage().voidsetConstantAlignmentSpecifiers(SequenceNode<ExpressionNode> specifiers) Sets the node that will be returned by methodconstantAlignmentSpecifiers().voidsetInitializer(InitializerNode initializer) Sets the value that will be returned bygetInitializer().voidsetIsRefParameter(boolean isRefParameter) Sets the boolean field representing the type of this node.voidsetRegisterStorage(boolean value) Sets the value that will be returned byhasRegisterStorage().voidsetSharedStorage(boolean value) Sets the value that will be returned by.invalid reference
#hasRSharedStorage()voidsetThreadLocalStorage(boolean value) Sets the value that will be returned byhasThreadLocalStorage().voidsetTypeAlignmentSpecifiers(SequenceNode<TypeNode> specifiers) Sets the node that will be returned bytypeAlignmentSpecifiers().An object declaration may contain any number of alignment specifiers.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
blockItemKindMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.DeclarationNode
getIdentifier, getName, isDefinition, setEntity, setIdentifier, setIsDefinitionMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.OrdinaryDeclarationNode
getTypeNode, hasExternStorage, hasStaticStorage, ordinaryDeclarationKind, setExternStorage, setStaticStorage, setTypeNode
-
Method Details
-
getEntity
Variable getEntity()Description copied from interface:DeclarationNodeReturns the entity whose existence is declared by this declaration. This is initiallynull, and can be changed byDeclarationNode.setEntity(Entity).- Specified by:
getEntityin interfaceDeclarationNode- Returns:
- the entity declared by this declaration
- See Also:
-
hasAutoStorage
boolean hasAutoStorage()Does the declaration include the
autostorage class specifier? Default value isfalse, it can be changed usingsetAutoStorage(boolean).- Returns:
trueif declaration containsauto- See Also:
-
setAutoStorage
void setAutoStorage(boolean value) Sets the value that will be returned byhasAutoStorage().- Parameters:
value-trueif declaration containsauto
-
hasRegisterStorage
boolean hasRegisterStorage()Does the declaration include the
registerstorage class specifier?. Initiallyfalse, the value can be changed usingsetRegisterStorage(boolean).C11 6.9(2): "The storage-class specifiers
autoandregistershall not appear in the declaration specifiers in an external declaration."C11 6.7.1(7): "The declaration of an identifier for a function that has block scope shall have no explicit storage-class specifier other than
extern."Since the only remaining kinds of scopes are function prototype and function, neither of which can contain function declarations, I conclude that
autoandregistercan never occur in a function declaration.Ergo: this is for objects only, not functions.
- Returns:
trueiff declaration containsregister
-
setRegisterStorage
void setRegisterStorage(boolean value) Sets the value that will be returned byhasRegisterStorage().- Parameters:
value-trueiff declaration containsregister
-
getInitializer
InitializerNode getInitializer()Gets the (optional) initializer for the object being declared. Returnsnullif the declaration does not use an initializer. Default value isnull; it can be changed usingsetInitializer(InitializerNode).- Returns:
- the initializer for the object, or
nullif no initializer is present
-
setInitializer
Sets the value that will be returned bygetInitializer().- Parameters:
initializer- the initializer for the object, ornullif no initializer is present
-
hasThreadLocalStorage
boolean hasThreadLocalStorage()Does the declaration include the_Thread_localstorage class specifier? Default value isnull; it can be changed usingsetThreadLocalStorage(boolean).- Returns:
trueiff declaration contains_Thread_local
-
setThreadLocalStorage
void setThreadLocalStorage(boolean value) Sets the value that will be returned byhasThreadLocalStorage().- Parameters:
value-trueiff declaration contains_Thread_local
-
typeAlignmentSpecifiers
SequenceNode<TypeNode> typeAlignmentSpecifiers()An object declaration may contain any number of alignment specifiers. These have the form_Alignas ( Type )and_Alignas ( constant-expression ). This method returns the types occurring in the first form (if any). Initiallynull, this node can be set usingsetTypeAlignmentSpecifiers(SequenceNode).- Returns:
- sequence node of type alignments
-
setTypeAlignmentSpecifiers
Sets the node that will be returned bytypeAlignmentSpecifiers().- Parameters:
specifiers- sequence node of type alignments
-
constantAlignmentSpecifiers
SequenceNode<ExpressionNode> constantAlignmentSpecifiers()An object declaration may contain any number of alignment specifiers. These have the form_Alignas ( Type )and_Alignas ( constant-expression ). This method returns the constant expressions occurring in the second form (if any). Default value isnull, the node can be set usingsetConstantAlignmentSpecifiers(SequenceNode).- Returns:
- sequence node of constant alignments
-
setConstantAlignmentSpecifiers
Sets the node that will be returned by methodconstantAlignmentSpecifiers().- Parameters:
specifiers- sequence node of constant alignments
-
copy
VariableDeclarationNode 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- Specified by:
copyin interfaceDeclarationNode- Specified by:
copyin interfaceOrdinaryDeclarationNode- Returns:
- deep copy of this node
-
isRefParameter
boolean isRefParameter()Only used when thisVariableDeclarationNodeis used as a parameter in FORTRAN program. Usually, the type of a parameter in FORTRAN is call by reference. However, for improving the performance, ABC will treat not-modified parameters as call by value.- Returns:
- true
, if this parameter variable is called by reference;false, if it is called by value (or call by reference without being modified).
-
setIsRefParameter
void setIsRefParameter(boolean isRefParameter) Sets the boolean field representing the type of this node.
[Only when this node is used as a parameter in a FORTRAN program]- Parameters:
isRefParameter-
-