ast

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypesAlreadyDefined = []string{

	"_LIB_VERSION_TYPE",

	"__float2",
	"__double2",
}

Functions

func Render

func Render(ast *Ast, node Node) string

Types

type AlwaysInlineAttr

type AlwaysInlineAttr struct {
	Address  string
	Position string
	Children []Node
}

func (*AlwaysInlineAttr) AddChild

func (n *AlwaysInlineAttr) AddChild(node Node)

type ArraySubscriptExpr

type ArraySubscriptExpr struct {
	Address  string
	Position string
	Type     string
	Kind     string
	Children []Node
}

func (*ArraySubscriptExpr) AddChild

func (n *ArraySubscriptExpr) AddChild(node Node)

type AsmLabelAttr

type AsmLabelAttr struct {
	Address      string
	Position     string
	FunctionName string
	Children     []Node
}

func (*AsmLabelAttr) AddChild

func (n *AsmLabelAttr) AddChild(node Node)

type Ast

type Ast struct {
	// contains filtered or unexported fields
}

func NewAst

func NewAst() *Ast

func (*Ast) Imports

func (a *Ast) Imports() []string

type AvailabilityAttr

type AvailabilityAttr struct {
	Address     string
	Position    string
	OS          string
	Version     string
	Unknown1    float64
	Unknown2    int
	Unavailable bool
	Message1    string
	Message2    string
	Children    []Node
}

func (*AvailabilityAttr) AddChild

func (n *AvailabilityAttr) AddChild(node Node)

type BinaryOperator

type BinaryOperator struct {
	Address  string
	Position string
	Type     string
	Operator string
	Children []Node
}

func (*BinaryOperator) AddChild

func (n *BinaryOperator) AddChild(node Node)

type BreakStmt

type BreakStmt struct {
	Address  string
	Position string
	Children []Node
}

func (*BreakStmt) AddChild

func (n *BreakStmt) AddChild(node Node)

type BuiltinType

type BuiltinType struct {
	Address  string
	Type     string
	Children []Node
}

func (*BuiltinType) AddChild

func (n *BuiltinType) AddChild(node Node)

type CStyleCastExpr

type CStyleCastExpr struct {
	Address  string
	Position string
	Type     string
	Kind     string
	Children []Node
}

func (*CStyleCastExpr) AddChild

func (n *CStyleCastExpr) AddChild(node Node)

type CallExpr

type CallExpr struct {
	Address  string
	Position string
	Type     string
	Children []Node
}

func (*CallExpr) AddChild

func (n *CallExpr) AddChild(node Node)

type CharacterLiteral

type CharacterLiteral struct {
	Address  string
	Position string
	Type     string
	Value    int
	Children []Node
}

func (*CharacterLiteral) AddChild

func (n *CharacterLiteral) AddChild(node Node)

type CompoundStmt

type CompoundStmt struct {
	Address  string
	Position string
	Children []Node
}

func (*CompoundStmt) AddChild

func (n *CompoundStmt) AddChild(node Node)

type ConditionalOperator

type ConditionalOperator struct {
	Address  string
	Position string
	Type     string
	Children []Node
}

func (*ConditionalOperator) AddChild

func (n *ConditionalOperator) AddChild(node Node)

type ConstAttr

type ConstAttr struct {
	Address  string
	Position string
	Tags     string
	Children []Node
}

func (*ConstAttr) AddChild

func (n *ConstAttr) AddChild(node Node)

type ConstantArrayType

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

func (*ConstantArrayType) AddChild

func (n *ConstantArrayType) AddChild(node Node)

type DeclRefExpr

type DeclRefExpr struct {
	Address  string
	Position string
	Type     string
	Lvalue   bool
	For      string
	Address2 string
	Name     string
	Type2    string
	Children []Node
}

func (*DeclRefExpr) AddChild

func (n *DeclRefExpr) AddChild(node Node)

type DeclStmt

type DeclStmt struct {
	Address  string
	Position string
	Children []Node
}

func (*DeclStmt) AddChild

func (n *DeclStmt) AddChild(node Node)

type DeprecatedAttr

type DeprecatedAttr struct {
	Address  string
	Position string
	Message1 string
	Message2 string
	Children []Node
}

func (*DeprecatedAttr) AddChild

func (n *DeprecatedAttr) AddChild(node Node)

type ElaboratedType

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

func (*ElaboratedType) AddChild

func (n *ElaboratedType) AddChild(node Node)

type Enum

type Enum struct {
	Address  string
	Name     string
	Children []Node
}

func (*Enum) AddChild

func (n *Enum) AddChild(node Node)

type EnumConstantDecl

type EnumConstantDecl struct {
	Address   string
	Position  string
	Position2 string
	Name      string
	Type      string
	Children  []Node
}

func (*EnumConstantDecl) AddChild

func (n *EnumConstantDecl) AddChild(node Node)

type EnumDecl

type EnumDecl struct {
	Address   string
	Position  string
	Position2 string
	Name      string
	Children  []Node
}

func (*EnumDecl) AddChild

func (n *EnumDecl) AddChild(node Node)

type EnumType

type EnumType struct {
	Address  string
	Name     string
	Children []Node
}

func (*EnumType) AddChild

func (n *EnumType) AddChild(node Node)

type FieldDecl

type FieldDecl struct {
	Address    string
	Position   string
	Position2  string
	Name       string
	Type       string
	Referenced bool
	Children   []Node
}

func (*FieldDecl) AddChild

func (n *FieldDecl) AddChild(node Node)

type FloatingLiteral

type FloatingLiteral struct {
	Address  string
	Position string
	Type     string
	Value    float64
	Children []Node
}

func (*FloatingLiteral) AddChild

func (n *FloatingLiteral) AddChild(node Node)

type ForStmt

type ForStmt struct {
	Address  string
	Position string
	Children []Node
}

func (*ForStmt) AddChild

func (n *ForStmt) AddChild(node Node)

type FormatAttr

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

func (*FormatAttr) AddChild

func (n *FormatAttr) AddChild(node Node)

type FunctionDecl

type FunctionDecl struct {
	Address    string
	Position   string
	Prev       string
	Position2  string
	Name       string
	Type       string
	IsExtern   bool
	IsImplicit bool
	IsUsed     bool
	Children   []Node
}

func (*FunctionDecl) AddChild

func (n *FunctionDecl) AddChild(node Node)

type FunctionDefinition

type FunctionDefinition struct {
	// The name of the function, like "printf".
	Name string

	// The C return type, like "int".
	ReturnType string

	// The C argument types, like ["bool", "int"]. There is currently no way
	// to represent a varargs.
	ArgumentTypes []string

	// If this is not empty then this function name should be used instead
	// of the Name. Many low level functions have an exact match with a Go
	// function. For example, "sin()".
	Substitution string
}

FunctionDefinition contains the prototype definition for a function.

type FunctionProtoType

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

func (*FunctionProtoType) AddChild

func (n *FunctionProtoType) AddChild(node Node)

type IfStmt

type IfStmt struct {
	Address  string
	Position string
	Children []Node
}

func (*IfStmt) AddChild

func (n *IfStmt) AddChild(node Node)

type ImplicitCastExpr

type ImplicitCastExpr struct {
	Address  string
	Position string
	Type     string
	Kind     string
	Children []Node
}

func (*ImplicitCastExpr) AddChild

func (n *ImplicitCastExpr) AddChild(node Node)

type IntegerLiteral

type IntegerLiteral struct {
	Address  string
	Position string
	Type     string
	Value    int
	Children []Node
}

func (*IntegerLiteral) AddChild

func (n *IntegerLiteral) AddChild(node Node)

type MallocAttr

type MallocAttr struct {
	Address  string
	Position string
	Children []Node
}

func (*MallocAttr) AddChild

func (n *MallocAttr) AddChild(node Node)

type MemberExpr

type MemberExpr struct {
	Address  string
	Position string
	Type     string
	Lvalue   bool
	Name     string
	Address2 string
	Children []Node
}

func (*MemberExpr) AddChild

func (n *MemberExpr) AddChild(node Node)

type ModeAttr

type ModeAttr struct {
	Address  string
	Position string
	Name     string
	Children []Node
}

func (*ModeAttr) AddChild

func (n *ModeAttr) AddChild(node Node)

type NoThrowAttr

type NoThrowAttr struct {
	Address  string
	Position string
	Children []Node
}

func (*NoThrowAttr) AddChild

func (n *NoThrowAttr) AddChild(node Node)

type Node

type Node interface {
	AddChild(node Node)
	// contains filtered or unexported methods
}

func Parse

func Parse(line string) Node

type NonNullAttr

type NonNullAttr struct {
	Address  string
	Position string
	Children []Node
}

func (*NonNullAttr) AddChild

func (n *NonNullAttr) AddChild(node Node)

type ParenExpr

type ParenExpr struct {
	Address  string
	Position string
	Type     string
	Children []Node
}

func (*ParenExpr) AddChild

func (n *ParenExpr) AddChild(node Node)

type ParmVarDecl

type ParmVarDecl struct {
	Address   string
	Position  string
	Position2 string
	Name      string
	Type      string
	Type2     string
	IsUsed    bool
	Children  []Node
}

func (*ParmVarDecl) AddChild

func (n *ParmVarDecl) AddChild(node Node)

type PointerType

type PointerType struct {
	Address  string
	Type     string
	Children []Node
}

func (*PointerType) AddChild

func (n *PointerType) AddChild(node Node)

type PredefinedExpr

type PredefinedExpr struct {
	Address  string
	Position string
	Type     string
	Name     string
	Lvalue   bool
	Children []Node
}

func (*PredefinedExpr) AddChild

func (n *PredefinedExpr) AddChild(node Node)

type QualType

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

func (*QualType) AddChild

func (n *QualType) AddChild(node Node)

type Record

type Record struct {
	Address  string
	Type     string
	Children []Node
}

func (*Record) AddChild

func (n *Record) AddChild(node Node)

type RecordDecl

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

func (*RecordDecl) AddChild

func (n *RecordDecl) AddChild(node Node)

type RecordType

type RecordType struct {
	Address  string
	Type     string
	Children []Node
}

func (*RecordType) AddChild

func (n *RecordType) AddChild(node Node)

type RestrictAttr

type RestrictAttr struct {
	Address  string
	Position string
	Name     string
	Children []Node
}

func (*RestrictAttr) AddChild

func (n *RestrictAttr) AddChild(node Node)

type ReturnStmt

type ReturnStmt struct {
	Address  string
	Position string
	Children []Node
}

func (*ReturnStmt) AddChild

func (n *ReturnStmt) AddChild(node Node)

type StringLiteral

type StringLiteral struct {
	Address  string
	Position string
	Type     string
	Value    string
	Lvalue   bool
	Children []Node
}

func (*StringLiteral) AddChild

func (n *StringLiteral) AddChild(node Node)

type TranslationUnitDecl

type TranslationUnitDecl struct {
	Address  string
	Children []Node
}

func (*TranslationUnitDecl) AddChild

func (n *TranslationUnitDecl) AddChild(node Node)

type Typedef

type Typedef struct {
	Address  string
	Type     string
	Children []Node
}

func (*Typedef) AddChild

func (n *Typedef) AddChild(node Node)

type TypedefDecl

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

func (*TypedefDecl) AddChild

func (n *TypedefDecl) AddChild(node Node)

type TypedefType

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

func (*TypedefType) AddChild

func (n *TypedefType) AddChild(node Node)

type UnaryOperator

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

func (*UnaryOperator) AddChild

func (n *UnaryOperator) AddChild(node Node)

type VarDecl

type VarDecl struct {
	Address   string
	Position  string
	Position2 string
	Name      string
	Type      string
	Type2     string
	IsExtern  bool
	IsUsed    bool
	IsCInit   bool
	Children  []Node
}

func (*VarDecl) AddChild

func (n *VarDecl) AddChild(node Node)

type WhileStmt

type WhileStmt struct {
	Address  string
	Position string
	Children []Node
}

func (*WhileStmt) AddChild

func (n *WhileStmt) AddChild(node Node)

Jump to

Keyboard shortcuts

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