compiler

package
v0.0.0-...-56c415c Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExprToProgramC

func ExprToProgramC(expr, format string, opts []Option) string

func ExprToProgramSi

func ExprToProgramSi(expr, format string, opts []Option) string

func JoinDeclares

func JoinDeclares(opts []Option) string

func JoinHeaders

func JoinHeaders(opts []Option) string

func OverrideBasename

func OverrideBasename(def string, opts ...Option) string

Types

type BinaryRunError

type BinaryRunError struct {
	Err    error
	Source string
	Result string
}

func NewBinaryRunError

func NewBinaryRunError(err error, source string) *BinaryRunError

func (*BinaryRunError) Error

func (bre *BinaryRunError) Error() string

type ClangRunError

type ClangRunError struct {
	Err    error
	Source string
	Result string
}

func NewClangRunError

func NewClangRunError(err error, source, result string) *ClangRunError

func (*ClangRunError) Error

func (cre *ClangRunError) Error() string

type Compiler

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

func NewCompiler

func NewCompiler() *Compiler

func (*Compiler) Destroy

func (c *Compiler) Destroy()

func (*Compiler) RunProgramC

func (c *Compiler) RunProgramC(src string, opts ...Option) (string, error)

func (*Compiler) RunProgramLL

func (c *Compiler) RunProgramLL(m *ir.Module, opts []Option) (string, error)

func (*Compiler) RunProgramSi

func (c *Compiler) RunProgramSi(src string, opts ...Option) (string, error)

type GenerateError

type GenerateError struct {
	Err    error
	Source string
}

func NewGenerateError

func NewGenerateError(err error, source string) *GenerateError

func (*GenerateError) Error

func (te *GenerateError) Error() string

type Option

type Option interface{ Option() }

type OptionBasename

type OptionBasename struct{ File string }

func Basename

func Basename(file string) *OptionBasename

func (*OptionBasename) Option

func (o *OptionBasename) Option()

type OptionDeclare

type OptionDeclare struct{ Declare []string }

func Declare

func Declare(declare string) *OptionDeclare

func DeclareMalloc

func DeclareMalloc() *OptionDeclare

func (*OptionDeclare) Option

func (o *OptionDeclare) Option()

type OptionHeader

type OptionHeader struct{ Header string }
func Header(header string) *OptionHeader

func (*OptionHeader) Option

func (o *OptionHeader) Option()

type ParseError

type ParseError struct {
	Err    error
	Source string
}

func NewParseError

func NewParseError(err error, source string) *ParseError

func (*ParseError) Error

func (pe *ParseError) Error() string

type Suite

type Suite struct {
	suite.Suite
}

func (*Suite) EqualExprC

func (suite *Suite) EqualExprC(expr, format, expected string, opts ...Option)

func (*Suite) EqualExprSi

func (suite *Suite) EqualExprSi(expr, format, expected string, opts ...Option)

func (*Suite) EqualLL

func (suite *Suite) EqualLL(m *ir.Module, expected string, opts ...Option)

func (*Suite) EqualProgramC

func (suite *Suite) EqualProgramC(src, expected string, opts ...Option)

func (*Suite) EqualProgramSi

func (suite *Suite) EqualProgramSi(src, expected string, opts ...Option)

func (*Suite) ErrorClangExprC

func (suite *Suite) ErrorClangExprC(expr, contains string, opts ...Option)

func (*Suite) ErrorClangProgramC

func (suite *Suite) ErrorClangProgramC(src, contains string, opts ...Option)

func (*Suite) ErrorGenerateExprSi

func (suite *Suite) ErrorGenerateExprSi(expr, contains string, opts ...Option)

func (*Suite) ErrorGenerateProgramSi

func (suite *Suite) ErrorGenerateProgramSi(src, contains string, opts ...Option)

func (*Suite) GetLL

func (suite *Suite) GetLL(src string) (string, error)

Jump to

Keyboard shortcuts

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