syntax

package
v1.0.52 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Kind_Const = info.Kind_Const
View Source
const Kind_Func = info.Kind_Func
View Source
const Kind_Var = info.Kind_Var
View Source
const Kind_VarPtr = info.Kind_VarPtr
View Source
const UNKNOWN_CONST_TYPE = "xgo_unknown_const"
View Source
const XGO_MAIN_MODULE = "XGO_MAIN_MODULE"
View Source
const XGO_NUMBER = "XGO_NUMBER"
View Source
const XGO_REVISION = "XGO_REVISION"
View Source
const XGO_STACK_TRACE = "XGO_STACK_TRACE"

--strace

View Source
const XGO_STACK_TRACE_DIR = "XGO_STACK_TRACE_DIR"
View Source
const XGO_STD_LIB_TRAP_DEFAULT_ALLOW = "XGO_STD_LIB_TRAP_DEFAULT_ALLOW"
View Source
const XGO_STRACE_SNAPSHOT_MAIN_MODULE_DEFAULT = "XGO_STRACE_SNAPSHOT_MAIN_MODULE_DEFAULT"
View Source
const XGO_TOOLCHAIN_REVISION = "XGO_TOOLCHAIN_REVISION"
View Source
const XGO_TOOLCHAIN_VERSION = "XGO_TOOLCHAIN_VERSION"
View Source
const XGO_TOOLCHAIN_VERSION_NUMBER = "XGO_TOOLCHAIN_VERSION_NUMBER"
View Source
const XGO_VERSION = "XGO_VERSION"
View Source
const XgoLinkGeneratedRegisterFunc = "__xgo_link_generated_register_func"

this link function is considered safe as we do not allow user to define such one,there will be no abuse

View Source
const XgoLinkTrapForGenerated = "__xgo_link_trap_for_generated"
View Source
const XgoLocalFuncStub = "__xgo_local_func_stub"
View Source
const XgoLocalPkgName = "__xgo_local_pkg_name"
View Source
const XgoRegisterFuncs = "__xgo_register_funcs"

Variables

View Source
var AbsFilename func(name string) string
View Source
var TrimFilename func(b *syntax.PosBase) string

Functions

func AfterFilesParsed

func AfterFilesParsed(fileList []*syntax.File, addFile func(name string, r io.Reader) *syntax.File)

func ClearDecls

func ClearDecls()

func ClearFiles

func ClearFiles()

func ClearSyntaxDeclMapping

func ClearSyntaxDeclMapping()

func GetFiles

func GetFiles() []*syntax.File

not used anywhere

func GetSyntaxDeclMapping

func GetSyntaxDeclMapping() map[string]map[LineCol]*info.DeclInfo

func HasSkipTrap

func HasSkipTrap() bool

Types

type BlockContext added in v1.0.19

type BlockContext struct {
	Parent *BlockContext
	Block  *syntax.BlockStmt

	Names map[string]bool

	// node appears as RHS of var decl
	ListExprParent       map[syntax.Node]*syntax.ListExpr
	RHSVarDeclParent     map[syntax.Node]*syntax.VarDecl
	OperationParent      map[syntax.Node]*syntax.Operation
	ArgCallExprParent    map[syntax.Node]*syntax.CallExpr
	RHSAssignNoDefParent map[syntax.Node]*syntax.AssignStmt
	CaseClauseParent     map[syntax.Node]*syntax.CaseClause
	ReturnStmtParent     map[syntax.Node]*syntax.ReturnStmt
	ParenParent          map[syntax.Node]*syntax.ParenExpr
	SelectorParent       map[syntax.Node]*syntax.SelectorExpr

	// const info
	ConstInfo map[syntax.Node]*ConstInfo

	// to be inserted
	ChildrenInsertList [][]*NodeStmt

	TrapNames []*NameAndDecl
}

a BlockContext provides a point where stmts can be prepended or inserted

func (*BlockContext) Add added in v1.0.19

func (c *BlockContext) Add(name string)

func (*BlockContext) CancelNodeStmt added in v1.0.39

func (c *BlockContext) CancelNodeStmt(node syntax.Node)

func (*BlockContext) Has added in v1.0.19

func (c *BlockContext) Has(name string) bool

func (*BlockContext) PrependStmtBeforeLastChild added in v1.0.19

func (c *BlockContext) PrependStmtBeforeLastChild(node syntax.Node, stmt []syntax.Stmt)

type ConstInfo added in v1.0.19

type ConstInfo struct {
	Type string
}

type DeclInfo

type DeclInfo = info.DeclInfo

func GetDecls

func GetDecls() []*DeclInfo

type DeclKind added in v1.0.19

type DeclKind = info.DeclKind

type FileDecl

type FileDecl struct {
	File  *syntax.File
	Funcs []*DeclInfo
}

type ISetPos

type ISetPos interface {
	SetPos(p syntax.Pos)
}

type LineCol

type LineCol struct {
	Line uint
	Col  uint
}

type NameAndDecl added in v1.0.19

type NameAndDecl struct {
	TakeAddr bool
	Name     *syntax.Name
	Decl     *DeclInfo
}

type NodeStmt added in v1.0.39

type NodeStmt struct {
	// the node that introduces the
	// list, which can be cancelled
	Node      syntax.Node
	Stmts     []syntax.Stmt
	Cancelled bool
}

type StructDef

type StructDef struct {
	Field string
	Type  string
}

Jump to

Keyboard shortcuts

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