ast

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ast parses the clang AST output into AST structures.

Index

Constants

This section is empty.

Variables

View Source
var PositionBuiltIn = "<built-in>"

PositionBuiltIn - default value for fix position

Functions

func Atos added in v0.16.12

func Atos(node Node) string

Atos - ASTree to string Typically using for debug

func FixPositions added in v0.15.0

func FixPositions(nodes []Node)

Types

type Address added in v0.15.0

type Address uint64

Address contains the memory address (originally outputted as a hexadecimal string) from the clang AST. The address are not predictable between run and are only useful for identifying nodes in a single AST.

The Address is used like a primary key when storing the tree as a flat structure.

func ParseAddress added in v0.15.0

func ParseAddress(address string) Address

ParseAddress returns the integer representation of the hexadecimal address (like 0x7f8a1d8ccfd0). If the address cannot be parsed, 0 is returned.

type AlignedAttr added in v0.11.2

type AlignedAttr struct {
	Addr       Address
	Pos        Position
	IsAligned  bool
	ChildNodes []Node
}

AlignedAttr is a type of attribute that is optionally attached to a variable or struct field definition.

func (*AlignedAttr) AddChild added in v0.11.2

func (n *AlignedAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*AlignedAttr) Address added in v0.11.2

func (n *AlignedAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*AlignedAttr) Children added in v0.11.2

func (n *AlignedAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*AlignedAttr) Position added in v0.11.2

func (n *AlignedAttr) Position() Position

Position returns the position in the original source code.

type AllocSizeAttr added in v0.16.12

type AllocSizeAttr struct {
	Addr       Address
	Pos        Position
	Inherited  bool
	A          int
	B          int
	ChildNodes []Node
}

AllocSizeAttr is a type of attribute that is optionally attached to a variable or struct field definition.

func (*AllocSizeAttr) AddChild added in v0.16.12

func (n *AllocSizeAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*AllocSizeAttr) Address added in v0.16.12

func (n *AllocSizeAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*AllocSizeAttr) Children added in v0.16.12

func (n *AllocSizeAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*AllocSizeAttr) Position added in v0.16.12

func (n *AllocSizeAttr) Position() Position

Position returns the position in the original source code.

type AlwaysInlineAttr

type AlwaysInlineAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

AlwaysInlineAttr is a type of attribute that is optionally attached to a variable or struct field definition.

func (*AlwaysInlineAttr) AddChild

func (n *AlwaysInlineAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*AlwaysInlineAttr) Address

func (n *AlwaysInlineAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*AlwaysInlineAttr) Children

func (n *AlwaysInlineAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*AlwaysInlineAttr) Position

func (n *AlwaysInlineAttr) Position() Position

Position returns the position in the original source code.

type ArrayFiller added in v0.11.2

type ArrayFiller struct {
	ChildNodes []Node
}

func (*ArrayFiller) AddChild added in v0.11.2

func (n *ArrayFiller) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ArrayFiller) Address added in v0.15.0

func (n *ArrayFiller) Address() Address

Address returns the numeric address of the node. For an ArrayFilter this will always be zero. See the documentation for the Address type for more information.

func (*ArrayFiller) Children added in v0.11.2

func (n *ArrayFiller) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ArrayFiller) Position added in v0.15.0

func (n *ArrayFiller) Position() Position

Position returns the position in the original source code.

type ArraySubscriptExpr

type ArraySubscriptExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	Kind       string
	ChildNodes []Node
}

func (*ArraySubscriptExpr) AddChild

func (n *ArraySubscriptExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ArraySubscriptExpr) Address

func (n *ArraySubscriptExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ArraySubscriptExpr) Children

func (n *ArraySubscriptExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ArraySubscriptExpr) Position

func (n *ArraySubscriptExpr) Position() Position

Position returns the position in the original source code.

type AsmLabelAttr

type AsmLabelAttr struct {
	Addr         Address
	Pos          Position
	Inherited    bool
	FunctionName string
	ChildNodes   []Node
}

func (*AsmLabelAttr) AddChild

func (n *AsmLabelAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*AsmLabelAttr) Address

func (n *AsmLabelAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*AsmLabelAttr) Children

func (n *AsmLabelAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*AsmLabelAttr) Position

func (n *AsmLabelAttr) Position() Position

Position returns the position in the original source code.

type AvailabilityAttr

type AvailabilityAttr struct {
	Addr          Address
	Pos           Position
	OS            string
	Version       string
	Unknown1      float64
	Unknown2      int
	IsUnavailable bool
	Message1      string
	Message2      string
	IsInherited   bool
	ChildNodes    []Node
}

func (*AvailabilityAttr) AddChild

func (n *AvailabilityAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*AvailabilityAttr) Address

func (n *AvailabilityAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*AvailabilityAttr) Children

func (n *AvailabilityAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*AvailabilityAttr) Position

func (n *AvailabilityAttr) Position() Position

Position returns the position in the original source code.

type BinaryOperator

type BinaryOperator struct {
	Addr       Address
	Pos        Position
	Type       string
	Type2      string
	Operator   string
	ChildNodes []Node
}

func (*BinaryOperator) AddChild

func (n *BinaryOperator) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*BinaryOperator) Address

func (n *BinaryOperator) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*BinaryOperator) Children

func (n *BinaryOperator) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*BinaryOperator) Position

func (n *BinaryOperator) Position() Position

Position returns the position in the original source code.

type BreakStmt

type BreakStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*BreakStmt) AddChild

func (n *BreakStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*BreakStmt) Address

func (n *BreakStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*BreakStmt) Children

func (n *BreakStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*BreakStmt) Position

func (n *BreakStmt) Position() Position

Position returns the position in the original source code.

type BuiltinType

type BuiltinType struct {
	Addr       Address
	Type       string
	ChildNodes []Node
}

func (*BuiltinType) AddChild

func (n *BuiltinType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*BuiltinType) Address

func (n *BuiltinType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*BuiltinType) Children

func (n *BuiltinType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*BuiltinType) Position added in v0.15.0

func (n *BuiltinType) Position() Position

Position returns the position in the original source code.

type CStyleCastExpr

type CStyleCastExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	Type2      string
	Kind       string
	ChildNodes []Node
}

func (*CStyleCastExpr) AddChild

func (n *CStyleCastExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*CStyleCastExpr) Address

func (n *CStyleCastExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*CStyleCastExpr) Children

func (n *CStyleCastExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*CStyleCastExpr) Position

func (n *CStyleCastExpr) Position() Position

Position returns the position in the original source code.

type CallExpr

type CallExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	ChildNodes []Node
}

func (*CallExpr) AddChild

func (n *CallExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*CallExpr) Address

func (n *CallExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*CallExpr) Children

func (n *CallExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*CallExpr) Position

func (n *CallExpr) Position() Position

Position returns the position in the original source code.

type CaseStmt added in v0.9.2

type CaseStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*CaseStmt) AddChild added in v0.9.2

func (n *CaseStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*CaseStmt) Address added in v0.9.2

func (n *CaseStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*CaseStmt) Children added in v0.9.2

func (n *CaseStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*CaseStmt) Position added in v0.9.2

func (n *CaseStmt) Position() Position

Position returns the position in the original source code.

type CharacterLiteral

type CharacterLiteral struct {
	Addr       Address
	Pos        Position
	Type       string
	Value      int
	ChildNodes []Node
}

func (*CharacterLiteral) AddChild

func (n *CharacterLiteral) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*CharacterLiteral) Address

func (n *CharacterLiteral) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*CharacterLiteral) Children

func (n *CharacterLiteral) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*CharacterLiteral) Position

func (n *CharacterLiteral) Position() Position

Position returns the position in the original source code.

type CompoundAssignOperator added in v0.10.4

type CompoundAssignOperator struct {
	Addr                  Address
	Pos                   Position
	Type                  string
	Opcode                string
	ComputationLHSType    string
	ComputationResultType string
	ChildNodes            []Node
}

func (*CompoundAssignOperator) AddChild added in v0.10.4

func (n *CompoundAssignOperator) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*CompoundAssignOperator) Address added in v0.10.4

func (n *CompoundAssignOperator) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*CompoundAssignOperator) Children added in v0.10.4

func (n *CompoundAssignOperator) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*CompoundAssignOperator) Position added in v0.10.4

func (n *CompoundAssignOperator) Position() Position

Position returns the position in the original source code.

type CompoundLiteralExpr added in v0.16.13

type CompoundLiteralExpr struct {
	Addr       Address
	Pos        Position
	Type1      string
	Type2      string
	ChildNodes []Node
}

CompoundLiteralExpr C99 6.5.2.5

func (*CompoundLiteralExpr) AddChild added in v0.16.13

func (n *CompoundLiteralExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*CompoundLiteralExpr) Address added in v0.16.13

func (n *CompoundLiteralExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*CompoundLiteralExpr) Children added in v0.16.13

func (n *CompoundLiteralExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*CompoundLiteralExpr) Position added in v0.16.13

func (n *CompoundLiteralExpr) Position() Position

Position returns the position in the original source code.

type CompoundStmt

type CompoundStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node

	// TODO: remove this
	BelongsToSwitch bool
}

func (*CompoundStmt) AddChild

func (n *CompoundStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*CompoundStmt) Address

func (n *CompoundStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*CompoundStmt) Children

func (n *CompoundStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*CompoundStmt) Position

func (n *CompoundStmt) Position() Position

Position returns the position in the original source code.

type ConditionalOperator

type ConditionalOperator struct {
	Addr       Address
	Pos        Position
	Type       string
	ChildNodes []Node
}

func (*ConditionalOperator) AddChild

func (n *ConditionalOperator) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ConditionalOperator) Address

func (n *ConditionalOperator) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ConditionalOperator) Children

func (n *ConditionalOperator) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ConditionalOperator) Position

func (n *ConditionalOperator) Position() Position

Position returns the position in the original source code.

type ConstAttr

type ConstAttr struct {
	Addr       Address
	Pos        Position
	Tags       string
	ChildNodes []Node
}

func (*ConstAttr) AddChild

func (n *ConstAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ConstAttr) Address

func (n *ConstAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ConstAttr) Children

func (n *ConstAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ConstAttr) Position

func (n *ConstAttr) Position() Position

Position returns the position in the original source code.

type ConstantArrayType

type ConstantArrayType struct {
	Addr       Address
	Type       string
	Size       int
	ChildNodes []Node
}

func (*ConstantArrayType) AddChild

func (n *ConstantArrayType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ConstantArrayType) Address

func (n *ConstantArrayType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ConstantArrayType) Children

func (n *ConstantArrayType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ConstantArrayType) Position added in v0.15.0

func (n *ConstantArrayType) Position() Position

Position returns the position in the original source code.

type ContinueStmt added in v0.10.2

type ContinueStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*ContinueStmt) AddChild added in v0.10.2

func (n *ContinueStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ContinueStmt) Address added in v0.10.2

func (n *ContinueStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ContinueStmt) Children added in v0.10.2

func (n *ContinueStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ContinueStmt) Position added in v0.10.2

func (n *ContinueStmt) Position() Position

Position returns the position in the original source code.

type DeclRefExpr

type DeclRefExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	Type1      string
	Lvalue     bool
	For        string
	Address2   string
	Name       string
	Type2      string
	Type3      string
	ChildNodes []Node
}

func (*DeclRefExpr) AddChild

func (n *DeclRefExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*DeclRefExpr) Address

func (n *DeclRefExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*DeclRefExpr) Children

func (n *DeclRefExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*DeclRefExpr) Position

func (n *DeclRefExpr) Position() Position

Position returns the position in the original source code.

type DeclStmt

type DeclStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*DeclStmt) AddChild

func (n *DeclStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*DeclStmt) Address

func (n *DeclStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*DeclStmt) Children

func (n *DeclStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*DeclStmt) Position

func (n *DeclStmt) Position() Position

Position returns the position in the original source code.

type DefaultStmt added in v0.9.2

type DefaultStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*DefaultStmt) AddChild added in v0.9.2

func (n *DefaultStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*DefaultStmt) Address added in v0.9.2

func (n *DefaultStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*DefaultStmt) Children added in v0.9.2

func (n *DefaultStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*DefaultStmt) Position added in v0.9.2

func (n *DefaultStmt) Position() Position

Position returns the position in the original source code.

type DeprecatedAttr

type DeprecatedAttr struct {
	Addr        Address
	Pos         Position
	Message1    string
	Message2    string
	IsInherited bool
	ChildNodes  []Node
}

func (*DeprecatedAttr) AddChild

func (n *DeprecatedAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*DeprecatedAttr) Address

func (n *DeprecatedAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*DeprecatedAttr) Children

func (n *DeprecatedAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*DeprecatedAttr) Position

func (n *DeprecatedAttr) Position() Position

Position returns the position in the original source code.

type DisableTailCallsAttr added in v0.16.12

type DisableTailCallsAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

DisableTailCallsAttr is a type of attribute that is optionally attached to a variable or struct field definition.

func (*DisableTailCallsAttr) AddChild added in v0.16.12

func (n *DisableTailCallsAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*DisableTailCallsAttr) Address added in v0.16.12

func (n *DisableTailCallsAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*DisableTailCallsAttr) Children added in v0.16.12

func (n *DisableTailCallsAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*DisableTailCallsAttr) Position added in v0.16.12

func (n *DisableTailCallsAttr) Position() Position

Position returns the position in the original source code.

type DoStmt added in v0.9.0

type DoStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*DoStmt) AddChild added in v0.9.0

func (n *DoStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*DoStmt) Address added in v0.9.0

func (n *DoStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*DoStmt) Children added in v0.9.0

func (n *DoStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*DoStmt) Position added in v0.9.0

func (n *DoStmt) Position() Position

Position returns the position in the original source code.

type ElaboratedType

type ElaboratedType struct {
	Addr       Address
	Type       string
	Tags       string
	ChildNodes []Node
}

func (*ElaboratedType) AddChild

func (n *ElaboratedType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ElaboratedType) Address

func (n *ElaboratedType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ElaboratedType) Children

func (n *ElaboratedType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ElaboratedType) Position added in v0.15.0

func (n *ElaboratedType) Position() Position

Position returns the position in the original source code.

type EmptyDecl added in v0.17.4

type EmptyDecl struct {
	Addr       Address
	Pos        Position
	Position2  Position
	ChildNodes []Node
}

EmptyDecl - element of AST

func (*EmptyDecl) AddChild added in v0.17.4

func (n *EmptyDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*EmptyDecl) Address added in v0.17.4

func (n *EmptyDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*EmptyDecl) Children added in v0.17.4

func (n *EmptyDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*EmptyDecl) Position added in v0.17.4

func (n *EmptyDecl) Position() Position

Position returns the position in the original source code.

type Enum

type Enum struct {
	Addr       Address
	Name       string
	ChildNodes []Node
}

func (*Enum) AddChild

func (n *Enum) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*Enum) Address

func (n *Enum) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*Enum) Children

func (n *Enum) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*Enum) Position added in v0.15.0

func (n *Enum) Position() Position

Position returns the position in the original source code.

type EnumConstantDecl

type EnumConstantDecl struct {
	Addr       Address
	Pos        Position
	Position2  string
	Referenced bool
	Name       string
	Type       string
	ChildNodes []Node
}

func (*EnumConstantDecl) AddChild

func (n *EnumConstantDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*EnumConstantDecl) Address

func (n *EnumConstantDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*EnumConstantDecl) Children

func (n *EnumConstantDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*EnumConstantDecl) Position

func (n *EnumConstantDecl) Position() Position

Position returns the position in the original source code.

type EnumDecl

type EnumDecl struct {
	Addr       Address
	Pos        Position
	Position2  string
	Name       string
	ChildNodes []Node
}

func (*EnumDecl) AddChild

func (n *EnumDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*EnumDecl) Address

func (n *EnumDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*EnumDecl) Children

func (n *EnumDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*EnumDecl) Position

func (n *EnumDecl) Position() Position

Position returns the position in the original source code.

type EnumType

type EnumType struct {
	Addr       Address
	Name       string
	ChildNodes []Node
}

func (*EnumType) AddChild

func (n *EnumType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*EnumType) Address

func (n *EnumType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*EnumType) Children

func (n *EnumType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*EnumType) Position added in v0.15.0

func (n *EnumType) Position() Position

Position returns the position in the original source code.

type Field added in v0.15.1

type Field struct {
	Addr       Address
	String1    string
	String2    string
	ChildNodes []Node
}

func (*Field) AddChild added in v0.15.1

func (n *Field) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*Field) Address added in v0.15.1

func (n *Field) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*Field) Children added in v0.15.1

func (n *Field) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*Field) Position added in v0.15.1

func (n *Field) Position() Position

Position returns the position in the original source code.

type FieldDecl

type FieldDecl struct {
	Addr       Address
	Pos        Position
	Position2  string
	Name       string
	Type       string
	Type2      string
	Implicit   bool
	Referenced bool
	ChildNodes []Node
}

func (*FieldDecl) AddChild

func (n *FieldDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*FieldDecl) Address

func (n *FieldDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*FieldDecl) Children

func (n *FieldDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*FieldDecl) Position

func (n *FieldDecl) Position() Position

Position returns the position in the original source code.

type FloatingLiteral

type FloatingLiteral struct {
	Addr       Address
	Pos        Position
	Type       string
	Value      float64
	ChildNodes []Node
}

func (*FloatingLiteral) AddChild

func (n *FloatingLiteral) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*FloatingLiteral) Address

func (n *FloatingLiteral) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*FloatingLiteral) Children

func (n *FloatingLiteral) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*FloatingLiteral) Position

func (n *FloatingLiteral) Position() Position

Position returns the position in the original source code.

type FloatingLiteralError added in v0.15.1

type FloatingLiteralError struct {
	Node *FloatingLiteral
	Err  error
}

FloatingLiteralError represents one instance of an error where the exact floating point value of a FloatingLiteral could not be determined from the original source. See RepairFloatingLiteralsFromSource for a full explanation.

func RepairFloatingLiteralsFromSource added in v0.15.1

func RepairFloatingLiteralsFromSource(rootNode Node, preprocessedFile string) []FloatingLiteralError

RepairFloatingLiteralsFromSource finds the exact values of floating literals by reading their values directly from the preprocessed source.

The clang AST only serializes floating point values in scientific notation with 7 significant digits. This is not enough when dealing with precise numbers.

The only solution is to read the original floating literal from the source code. We can do this by using the positional information on the node.

If the floating literal cannot be resolved for any reason the original value will remain. This function will return all errors encountered.

type ForStmt

type ForStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*ForStmt) AddChild

func (n *ForStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ForStmt) Address

func (n *ForStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ForStmt) Children

func (n *ForStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ForStmt) Position

func (n *ForStmt) Position() Position

Position returns the position in the original source code.

type FormatAttr

type FormatAttr struct {
	Addr         Address
	Pos          Position
	Implicit     bool
	Inherited    bool
	FunctionName string
	Unknown1     int
	Unknown2     int
	ChildNodes   []Node
}

func (*FormatAttr) AddChild

func (n *FormatAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*FormatAttr) Address

func (n *FormatAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*FormatAttr) Children

func (n *FormatAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*FormatAttr) Position

func (n *FormatAttr) Position() Position

Position returns the position in the original source code.

type FunctionDecl

type FunctionDecl struct {
	Addr         Address
	Pos          Position
	Prev         string
	Position2    string
	Name         string
	Type         string
	Type2        string
	IsExtern     bool
	IsImplicit   bool
	IsUsed       bool
	IsReferenced bool
	IsStatic     bool
	IsInline     bool
	ChildNodes   []Node
}

func (*FunctionDecl) AddChild

func (n *FunctionDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*FunctionDecl) Address

func (n *FunctionDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*FunctionDecl) Children

func (n *FunctionDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*FunctionDecl) Position

func (n *FunctionDecl) Position() Position

Position returns the position in the original source code.

type FunctionProtoType

type FunctionProtoType struct {
	Addr       Address
	Type       string
	Kind       string
	ChildNodes []Node
}

func (*FunctionProtoType) AddChild

func (n *FunctionProtoType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*FunctionProtoType) Address

func (n *FunctionProtoType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*FunctionProtoType) Children

func (n *FunctionProtoType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*FunctionProtoType) Position added in v0.15.0

func (n *FunctionProtoType) Position() Position

Position returns the position in the original source code.

type GCCAsmStmt added in v0.16.1

type GCCAsmStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*GCCAsmStmt) AddChild added in v0.16.1

func (n *GCCAsmStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*GCCAsmStmt) Address added in v0.16.1

func (n *GCCAsmStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*GCCAsmStmt) Children added in v0.16.1

func (n *GCCAsmStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*GCCAsmStmt) Position added in v0.16.1

func (n *GCCAsmStmt) Position() Position

Position returns the position in the original source code.

type GotoStmt added in v0.11.2

type GotoStmt struct {
	Addr       Address
	Pos        Position
	Name       string
	Position2  string
	ChildNodes []Node
}

func (*GotoStmt) AddChild added in v0.11.2

func (n *GotoStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*GotoStmt) Address added in v0.11.2

func (n *GotoStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*GotoStmt) Children added in v0.11.2

func (n *GotoStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*GotoStmt) Position added in v0.11.2

func (n *GotoStmt) Position() Position

Position returns the position in the original source code.

type IfStmt

type IfStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*IfStmt) AddChild

func (n *IfStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*IfStmt) Address

func (n *IfStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*IfStmt) Children

func (n *IfStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*IfStmt) Position

func (n *IfStmt) Position() Position

Position returns the position in the original source code.

type ImplicitCastExpr

type ImplicitCastExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	Type2      string
	Kind       string
	ChildNodes []Node
}

func (*ImplicitCastExpr) AddChild

func (n *ImplicitCastExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ImplicitCastExpr) Address

func (n *ImplicitCastExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ImplicitCastExpr) Children

func (n *ImplicitCastExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ImplicitCastExpr) Position

func (n *ImplicitCastExpr) Position() Position

Position returns the position in the original source code.

type ImplicitValueInitExpr added in v0.11.2

type ImplicitValueInitExpr struct {
	Addr       Address
	Pos        Position
	Type1      string
	Type2      string
	ChildNodes []Node
}

func (*ImplicitValueInitExpr) AddChild added in v0.11.2

func (n *ImplicitValueInitExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ImplicitValueInitExpr) Address added in v0.11.2

func (n *ImplicitValueInitExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ImplicitValueInitExpr) Children added in v0.11.2

func (n *ImplicitValueInitExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ImplicitValueInitExpr) Position added in v0.11.2

func (n *ImplicitValueInitExpr) Position() Position

Position returns the position in the original source code.

type IncompleteArrayType added in v0.11.2

type IncompleteArrayType struct {
	Addr       Address
	Type       string
	ChildNodes []Node
}

func (*IncompleteArrayType) AddChild added in v0.11.2

func (n *IncompleteArrayType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*IncompleteArrayType) Address added in v0.11.2

func (n *IncompleteArrayType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*IncompleteArrayType) Children added in v0.11.2

func (n *IncompleteArrayType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*IncompleteArrayType) Position added in v0.15.0

func (n *IncompleteArrayType) Position() Position

Position returns the position in the original source code.

type IndirectFieldDecl added in v0.13.7

type IndirectFieldDecl struct {
	Addr       Address
	Pos        Position
	Position2  string
	Implicit   bool
	Name       string
	Type       string
	ChildNodes []Node
}

func (*IndirectFieldDecl) AddChild added in v0.13.7

func (n *IndirectFieldDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*IndirectFieldDecl) Address added in v0.13.7

func (n *IndirectFieldDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*IndirectFieldDecl) Children added in v0.13.7

func (n *IndirectFieldDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*IndirectFieldDecl) Position added in v0.13.7

func (n *IndirectFieldDecl) Position() Position

Position returns the position in the original source code.

type InitListExpr added in v0.11.2

type InitListExpr struct {
	Addr       Address
	Pos        Position
	Type1      string
	Type2      string
	ChildNodes []Node
}

func (*InitListExpr) AddChild added in v0.11.2

func (n *InitListExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*InitListExpr) Address added in v0.11.2

func (n *InitListExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*InitListExpr) Children added in v0.11.2

func (n *InitListExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*InitListExpr) Position added in v0.11.2

func (n *InitListExpr) Position() Position

Position returns the position in the original source code.

type IntegerLiteral

type IntegerLiteral struct {
	Addr       Address
	Pos        Position
	Type       string
	Value      string
	ChildNodes []Node
}

func (*IntegerLiteral) AddChild

func (n *IntegerLiteral) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*IntegerLiteral) Address

func (n *IntegerLiteral) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*IntegerLiteral) Children

func (n *IntegerLiteral) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*IntegerLiteral) Position

func (n *IntegerLiteral) Position() Position

Position returns the position in the original source code.

type LabelStmt added in v0.11.2

type LabelStmt struct {
	Addr       Address
	Pos        Position
	Name       string
	ChildNodes []Node
}

func (*LabelStmt) AddChild added in v0.11.2

func (n *LabelStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*LabelStmt) Address added in v0.11.2

func (n *LabelStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*LabelStmt) Children added in v0.11.2

func (n *LabelStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*LabelStmt) Position added in v0.11.2

func (n *LabelStmt) Position() Position

Position returns the position in the original source code.

type MallocAttr

type MallocAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*MallocAttr) AddChild

func (n *MallocAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*MallocAttr) Address

func (n *MallocAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*MallocAttr) Children

func (n *MallocAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*MallocAttr) Position

func (n *MallocAttr) Position() Position

Position returns the position in the original source code.

type MaxFieldAlignmentAttr added in v0.11.2

type MaxFieldAlignmentAttr struct {
	Addr       Address
	Pos        Position
	Size       int
	ChildNodes []Node
}

func (*MaxFieldAlignmentAttr) AddChild added in v0.11.2

func (n *MaxFieldAlignmentAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*MaxFieldAlignmentAttr) Address added in v0.11.2

func (n *MaxFieldAlignmentAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*MaxFieldAlignmentAttr) Children added in v0.11.2

func (n *MaxFieldAlignmentAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*MaxFieldAlignmentAttr) Position added in v0.11.2

func (n *MaxFieldAlignmentAttr) Position() Position

Position returns the position in the original source code.

type MemberExpr

type MemberExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	Type2      string
	Name       string
	IsLvalue   bool
	IsBitfield bool
	Address2   string
	IsPointer  bool
	ChildNodes []Node
}

func (*MemberExpr) AddChild

func (n *MemberExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*MemberExpr) Address

func (n *MemberExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*MemberExpr) Children

func (n *MemberExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*MemberExpr) GetDeclRefExpr added in v0.13.3

func (n *MemberExpr) GetDeclRefExpr() *DeclRefExpr

GetDeclRefExpr gets DeclRefExpr from MemberExpr, or nil if there is no DeclRefExpr

func (*MemberExpr) Position

func (n *MemberExpr) Position() Position

Position returns the position in the original source code.

type ModeAttr

type ModeAttr struct {
	Addr       Address
	Pos        Position
	Name       string
	ChildNodes []Node
}

func (*ModeAttr) AddChild

func (n *ModeAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ModeAttr) Address

func (n *ModeAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ModeAttr) Children

func (n *ModeAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ModeAttr) Position

func (n *ModeAttr) Position() Position

Position returns the position in the original source code.

type NoInlineAttr added in v0.11.2

type NoInlineAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*NoInlineAttr) AddChild added in v0.11.2

func (n *NoInlineAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*NoInlineAttr) Address added in v0.11.2

func (n *NoInlineAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*NoInlineAttr) Children added in v0.11.2

func (n *NoInlineAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*NoInlineAttr) Position added in v0.11.2

func (n *NoInlineAttr) Position() Position

Position returns the position in the original source code.

type NoThrowAttr

type NoThrowAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
	Implicit   bool
	Inherited  bool
}

func (*NoThrowAttr) AddChild

func (n *NoThrowAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*NoThrowAttr) Address

func (n *NoThrowAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*NoThrowAttr) Children

func (n *NoThrowAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*NoThrowAttr) Position

func (n *NoThrowAttr) Position() Position

Position returns the position in the original source code.

type Node

type Node interface {
	Address() Address
	Children() []Node
	AddChild(node Node)
	Position() Position
}

Node represents any node in the AST.

func GetAllNodesOfType added in v0.13.7

func GetAllNodesOfType(root Node, t reflect.Type) []Node

GetAllNodesOfType returns all of the nodes of the tree that match the type provided. The type should be a pointer to an object in the ast package.

The nodes returned may reference each other and there is no guaranteed order in which the nodes are returned.

func Parse

func Parse(fullline string) Node

Parse takes the coloured output of the clang AST command and returns a root node for the AST.

type NonNullAttr

type NonNullAttr struct {
	Addr       Address
	Pos        Position
	A          int
	B          int
	C          int
	D          int
	ChildNodes []Node
}

func (*NonNullAttr) AddChild

func (n *NonNullAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*NonNullAttr) Address

func (n *NonNullAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*NonNullAttr) Children

func (n *NonNullAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*NonNullAttr) Position

func (n *NonNullAttr) Position() Position

Position returns the position in the original source code.

type OffsetOfExpr added in v0.11.2

type OffsetOfExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	ChildNodes []Node
}

func (*OffsetOfExpr) AddChild added in v0.11.2

func (n *OffsetOfExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*OffsetOfExpr) Address added in v0.11.2

func (n *OffsetOfExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*OffsetOfExpr) Children added in v0.11.2

func (n *OffsetOfExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*OffsetOfExpr) Position added in v0.11.2

func (n *OffsetOfExpr) Position() Position

Position returns the position in the original source code.

type PackedAttr added in v0.11.2

type PackedAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*PackedAttr) AddChild added in v0.11.2

func (n *PackedAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*PackedAttr) Address added in v0.11.2

func (n *PackedAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*PackedAttr) Children added in v0.11.2

func (n *PackedAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*PackedAttr) Position added in v0.11.2

func (n *PackedAttr) Position() Position

Position returns the position in the original source code.

type ParenExpr

type ParenExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	Type2      string
	Lvalue     bool
	IsBitfield bool
	ChildNodes []Node
}

func (*ParenExpr) AddChild

func (n *ParenExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ParenExpr) Address

func (n *ParenExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ParenExpr) Children

func (n *ParenExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ParenExpr) Position

func (n *ParenExpr) Position() Position

Position returns the position in the original source code.

type ParenType added in v0.9.0

type ParenType struct {
	Addr       Address
	Type       string
	Sugar      bool
	ChildNodes []Node
}

func (*ParenType) AddChild added in v0.9.0

func (n *ParenType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ParenType) Address added in v0.9.0

func (n *ParenType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ParenType) Children added in v0.9.0

func (n *ParenType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ParenType) Position added in v0.15.0

func (n *ParenType) Position() Position

Position returns the position in the original source code.

type ParmVarDecl

type ParmVarDecl struct {
	Addr         Address
	Pos          Position
	Position2    string
	Name         string
	Type         string
	Type2        string
	IsUsed       bool
	IsReferenced bool
	ChildNodes   []Node
}

func (*ParmVarDecl) AddChild

func (n *ParmVarDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ParmVarDecl) Address

func (n *ParmVarDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ParmVarDecl) Children

func (n *ParmVarDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ParmVarDecl) Position

func (n *ParmVarDecl) Position() Position

Position returns the position in the original source code.

type PointerType

type PointerType struct {
	Addr       Address
	Type       string
	ChildNodes []Node
}

func (*PointerType) AddChild

func (n *PointerType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*PointerType) Address

func (n *PointerType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*PointerType) Children

func (n *PointerType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*PointerType) Position added in v0.15.0

func (n *PointerType) Position() Position

Position returns the position in the original source code.

type Position added in v0.11.3

type Position struct {
	File      string // The relative or absolute file path.
	Line      int    // Start line
	LineEnd   int    // End line
	Column    int    // Start column
	ColumnEnd int    // End column

	// This is the original string that was converted. This is used for
	// debugging. We could derive this value from the other properties to save
	// on a bit of memory, but let worry about that later.
	StringValue string
}

func NewPositionFromString added in v0.15.0

func NewPositionFromString(s string) Position

type PredefinedExpr

type PredefinedExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	Name       string
	Lvalue     bool
	ChildNodes []Node
}

func (*PredefinedExpr) AddChild

func (n *PredefinedExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*PredefinedExpr) Address

func (n *PredefinedExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*PredefinedExpr) Children

func (n *PredefinedExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*PredefinedExpr) Position

func (n *PredefinedExpr) Position() Position

Position returns the position in the original source code.

type PureAttr added in v0.9.0

type PureAttr struct {
	Addr       Address
	Pos        Position
	Implicit   bool
	Inherited  bool
	ChildNodes []Node
}

func (*PureAttr) AddChild added in v0.9.0

func (n *PureAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*PureAttr) Address added in v0.9.0

func (n *PureAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*PureAttr) Children added in v0.9.0

func (n *PureAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*PureAttr) Position added in v0.9.0

func (n *PureAttr) Position() Position

Position returns the position in the original source code.

type QualType

type QualType struct {
	Addr       Address
	Type       string
	Kind       string
	ChildNodes []Node
}

func (*QualType) AddChild

func (n *QualType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*QualType) Address

func (n *QualType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*QualType) Children

func (n *QualType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*QualType) Position added in v0.15.0

func (n *QualType) Position() Position

Position returns the position in the original source code.

type Record

type Record struct {
	Addr       Address
	Type       string
	ChildNodes []Node
}

func (*Record) AddChild

func (n *Record) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*Record) Address

func (n *Record) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*Record) Children

func (n *Record) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*Record) Position added in v0.15.0

func (n *Record) Position() Position

Position returns the position in the original source code.

type RecordDecl

type RecordDecl struct {
	Addr       Address
	Pos        Position
	Prev       string
	Position2  string
	Kind       string
	Name       string
	Definition bool
	ChildNodes []Node
}

func (*RecordDecl) AddChild

func (n *RecordDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*RecordDecl) Address

func (n *RecordDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*RecordDecl) Children

func (n *RecordDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*RecordDecl) Position

func (n *RecordDecl) Position() Position

Position returns the position in the original source code.

type RecordType

type RecordType struct {
	Addr       Address
	Type       string
	ChildNodes []Node
}

func (*RecordType) AddChild

func (n *RecordType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*RecordType) Address

func (n *RecordType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*RecordType) Children

func (n *RecordType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*RecordType) Position added in v0.15.0

func (n *RecordType) Position() Position

Position returns the position in the original source code.

type RestrictAttr

type RestrictAttr struct {
	Addr       Address
	Pos        Position
	Name       string
	ChildNodes []Node
}

func (*RestrictAttr) AddChild

func (n *RestrictAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*RestrictAttr) Address

func (n *RestrictAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*RestrictAttr) Children

func (n *RestrictAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*RestrictAttr) Position

func (n *RestrictAttr) Position() Position

Position returns the position in the original source code.

type ReturnStmt

type ReturnStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*ReturnStmt) AddChild

func (n *ReturnStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ReturnStmt) Address

func (n *ReturnStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ReturnStmt) Children

func (n *ReturnStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ReturnStmt) Position

func (n *ReturnStmt) Position() Position

Position returns the position in the original source code.

type ReturnsTwiceAttr added in v0.11.2

type ReturnsTwiceAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
	Inherited  bool
	Implicit   bool
}

func (*ReturnsTwiceAttr) AddChild added in v0.11.2

func (n *ReturnsTwiceAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*ReturnsTwiceAttr) Address added in v0.11.2

func (n *ReturnsTwiceAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*ReturnsTwiceAttr) Children added in v0.11.2

func (n *ReturnsTwiceAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*ReturnsTwiceAttr) Position added in v0.11.2

func (n *ReturnsTwiceAttr) Position() Position

Position returns the position in the original source code.

type StmtExpr added in v0.16.2

type StmtExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	ChildNodes []Node
}

func (*StmtExpr) AddChild added in v0.16.2

func (n *StmtExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*StmtExpr) Address added in v0.16.2

func (n *StmtExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*StmtExpr) Children added in v0.16.2

func (n *StmtExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*StmtExpr) Position added in v0.16.2

func (n *StmtExpr) Position() Position

Position returns the position in the original source code.

type StringLiteral

type StringLiteral struct {
	Addr       Address
	Pos        Position
	Type       string
	Value      string
	Lvalue     bool
	ChildNodes []Node
}

func (*StringLiteral) AddChild

func (n *StringLiteral) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*StringLiteral) Address

func (n *StringLiteral) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*StringLiteral) Children

func (n *StringLiteral) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*StringLiteral) Position

func (n *StringLiteral) Position() Position

Position returns the position in the original source code.

type SwitchStmt added in v0.9.2

type SwitchStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*SwitchStmt) AddChild added in v0.9.2

func (n *SwitchStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*SwitchStmt) Address added in v0.9.2

func (n *SwitchStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*SwitchStmt) Children added in v0.9.2

func (n *SwitchStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*SwitchStmt) Position added in v0.9.2

func (n *SwitchStmt) Position() Position

Position returns the position in the original source code.

type TranslationUnitDecl

type TranslationUnitDecl struct {
	Addr       Address
	ChildNodes []Node
}

func (*TranslationUnitDecl) AddChild

func (n *TranslationUnitDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*TranslationUnitDecl) Address

func (n *TranslationUnitDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*TranslationUnitDecl) Children

func (n *TranslationUnitDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*TranslationUnitDecl) Position added in v0.15.0

func (n *TranslationUnitDecl) Position() Position

Position returns the position in the original source code.

type TransparentUnionAttr added in v0.9.0

type TransparentUnionAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*TransparentUnionAttr) AddChild added in v0.9.0

func (n *TransparentUnionAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*TransparentUnionAttr) Address added in v0.9.0

func (n *TransparentUnionAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*TransparentUnionAttr) Children added in v0.9.0

func (n *TransparentUnionAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*TransparentUnionAttr) Position added in v0.9.0

func (n *TransparentUnionAttr) Position() Position

Position returns the position in the original source code.

type Typedef

type Typedef struct {
	Addr       Address
	Type       string
	ChildNodes []Node
}

func (*Typedef) AddChild

func (n *Typedef) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*Typedef) Address

func (n *Typedef) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*Typedef) Children

func (n *Typedef) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*Typedef) Position added in v0.15.0

func (n *Typedef) Position() Position

Position returns the position in the original source code.

type TypedefDecl

type TypedefDecl struct {
	Addr         Address
	Pos          Position
	Position2    string
	Name         string
	Type         string
	Type2        string
	IsImplicit   bool
	IsReferenced bool
	ChildNodes   []Node
}

func (*TypedefDecl) AddChild

func (n *TypedefDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*TypedefDecl) Address

func (n *TypedefDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*TypedefDecl) Children

func (n *TypedefDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*TypedefDecl) Position

func (n *TypedefDecl) Position() Position

Position returns the position in the original source code.

type TypedefType

type TypedefType struct {
	Addr       Address
	Type       string
	Tags       string
	ChildNodes []Node
}

func (*TypedefType) AddChild

func (n *TypedefType) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*TypedefType) Address

func (n *TypedefType) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*TypedefType) Children

func (n *TypedefType) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*TypedefType) Position added in v0.15.0

func (n *TypedefType) Position() Position

Position returns the position in the original source code.

type UnaryExprOrTypeTraitExpr added in v0.11.0

type UnaryExprOrTypeTraitExpr struct {
	Addr       Address
	Pos        Position
	Type1      string
	Function   string
	Type2      string
	Type3      string
	ChildNodes []Node
}

func (*UnaryExprOrTypeTraitExpr) AddChild added in v0.11.0

func (n *UnaryExprOrTypeTraitExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*UnaryExprOrTypeTraitExpr) Address added in v0.11.0

func (n *UnaryExprOrTypeTraitExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*UnaryExprOrTypeTraitExpr) Children added in v0.11.0

func (n *UnaryExprOrTypeTraitExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*UnaryExprOrTypeTraitExpr) Position added in v0.11.0

func (n *UnaryExprOrTypeTraitExpr) Position() Position

Position returns the position in the original source code.

type UnaryOperator

type UnaryOperator struct {
	Addr       Address
	Pos        Position
	Type       string
	IsLvalue   bool
	IsPrefix   bool
	Operator   string
	ChildNodes []Node
}

func (*UnaryOperator) AddChild

func (n *UnaryOperator) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*UnaryOperator) Address

func (n *UnaryOperator) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*UnaryOperator) Children

func (n *UnaryOperator) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*UnaryOperator) Position

func (n *UnaryOperator) Position() Position

Position returns the position in the original source code.

type UnusedAttr added in v0.14.0

type UnusedAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*UnusedAttr) AddChild added in v0.14.0

func (n *UnusedAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*UnusedAttr) Address added in v0.14.0

func (n *UnusedAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*UnusedAttr) Children added in v0.14.0

func (n *UnusedAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*UnusedAttr) Position added in v0.14.0

func (n *UnusedAttr) Position() Position

Position returns the position in the original source code.

type VAArgExpr added in v0.11.2

type VAArgExpr struct {
	Addr       Address
	Pos        Position
	Type       string
	ChildNodes []Node
}

func (*VAArgExpr) AddChild added in v0.11.2

func (n *VAArgExpr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*VAArgExpr) Address added in v0.11.2

func (n *VAArgExpr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*VAArgExpr) Children added in v0.11.2

func (n *VAArgExpr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*VAArgExpr) Position added in v0.11.2

func (n *VAArgExpr) Position() Position

Position returns the position in the original source code.

type VarDecl

type VarDecl struct {
	Addr         Address
	Pos          Position
	Position2    string
	Name         string
	Type         string
	Type2        string
	IsExtern     bool
	IsUsed       bool
	IsCInit      bool
	IsReferenced bool
	IsStatic     bool
	IsRegister   bool
	ChildNodes   []Node
}

func (*VarDecl) AddChild

func (n *VarDecl) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*VarDecl) Address

func (n *VarDecl) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*VarDecl) Children

func (n *VarDecl) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*VarDecl) Position

func (n *VarDecl) Position() Position

Position returns the position in the original source code.

type VisibilityAttr added in v0.17.5

type VisibilityAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
	IsDefault  bool
}

VisibilityAttr contains information for a VisibilityAttr AST line.

func (*VisibilityAttr) AddChild added in v0.17.5

func (n *VisibilityAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*VisibilityAttr) Address added in v0.17.5

func (n *VisibilityAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*VisibilityAttr) Children added in v0.17.5

func (n *VisibilityAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*VisibilityAttr) Position added in v0.17.5

func (n *VisibilityAttr) Position() Position

Position returns the position in the original source code.

type WarnUnusedResultAttr added in v0.9.0

type WarnUnusedResultAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*WarnUnusedResultAttr) AddChild added in v0.9.0

func (n *WarnUnusedResultAttr) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*WarnUnusedResultAttr) Address added in v0.9.0

func (n *WarnUnusedResultAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*WarnUnusedResultAttr) Children added in v0.9.0

func (n *WarnUnusedResultAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*WarnUnusedResultAttr) Position added in v0.9.0

func (n *WarnUnusedResultAttr) Position() Position

Position returns the position in the original source code.

type WeakAttr added in v0.13.3

type WeakAttr struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

WeakAttr for the WeakAttr node

func (*WeakAttr) AddChild added in v0.13.3

func (n *WeakAttr) AddChild(node Node)

AddChild method to implements Node interface

func (*WeakAttr) Address added in v0.13.3

func (n *WeakAttr) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*WeakAttr) Children added in v0.13.3

func (n *WeakAttr) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*WeakAttr) Position added in v0.13.3

func (n *WeakAttr) Position() Position

Position returns the position in the original source code.

type WhileStmt

type WhileStmt struct {
	Addr       Address
	Pos        Position
	ChildNodes []Node
}

func (*WhileStmt) AddChild

func (n *WhileStmt) AddChild(node Node)

AddChild adds a new child node. Child nodes can then be accessed with the Children attribute.

func (*WhileStmt) Address

func (n *WhileStmt) Address() Address

Address returns the numeric address of the node. See the documentation for the Address type for more information.

func (*WhileStmt) Children

func (n *WhileStmt) Children() []Node

Children returns the child nodes. If this node does not have any children or this node does not support children it will always return an empty slice.

func (*WhileStmt) Position

func (n *WhileStmt) Position() Position

Position returns the position in the original source code.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL