github.com/Konstantin8105/c4go@v0.0.0-20240505174241-768bb1c65a51/ast/cxx_record_decl.go (about)

     1  package ast
     2  
     3  // CXXRecordDecl is node represents a record declaration.
     4  type CXXRecordDecl struct {
     5  	*RecordDecl
     6  }
     7  
     8  func parseCXXRecordDecl(line string) (res *CXXRecordDecl) {
     9  	res = &CXXRecordDecl{parseRecordDecl(line)}
    10  	return
    11  }
    12  
    13  // AddChild adds a new child node. Child nodes can then be accessed with the
    14  // Children attribute.
    15  func (n *CXXRecordDecl) AddChild(node Node) {
    16  	n.ChildNodes = append(n.ChildNodes, node)
    17  }
    18  
    19  // Address returns the numeric address of the node. See the documentation for
    20  // the Address type for more information.
    21  func (n *CXXRecordDecl) Address() Address {
    22  	return n.Addr
    23  }
    24  
    25  // Children returns the child nodes. If this node does not have any children or
    26  // this node does not support children it will always return an empty slice.
    27  func (n *CXXRecordDecl) Children() []Node {
    28  	return n.ChildNodes
    29  }
    30  
    31  // Position returns the position in the original source code.
    32  func (n *CXXRecordDecl) Position() Position {
    33  	return n.Pos
    34  }