parser

package
v0.0.0-...-0301851 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

list of standard transformation rules

Functions

func NewClassMethodMap

func NewClassMethodMap() *classMethodMap

create a map of class names to objects

func NewInterfaceMethodMap

func NewInterfaceMethodMap() *interfaceMethodMap

create a map of interface names to objects

Types

type Config

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

configuration file

func ReadConfig

func ReadConfig(name string) *Config

read the configuration file

func (*Config) Dump

func (cfg *Config) Dump(out io.Writer)

print the configuration data to the output

func (*Config) String

func (cfg *Config) String() string

print a minimal description of the configuration rules

type FakeVar

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

func NewFakeVar

func NewFakeVar(name string, type_args []*grammar.JTypeArgument, dims int) *FakeVar

func (*FakeVar) Equals

func (fv *FakeVar) Equals(govar GoVar) bool

func (*FakeVar) Expr

func (fv *FakeVar) Expr() ast.Expr

func (*FakeVar) GoName

func (fv *FakeVar) GoName() string

func (*FakeVar) Ident

func (fv *FakeVar) Ident() *ast.Ident

func (*FakeVar) Init

func (fv *FakeVar) Init() ast.Stmt

func (*FakeVar) IsClassField

func (fv *FakeVar) IsClassField() bool

func (*FakeVar) IsFinal

func (fv *FakeVar) IsFinal() bool

func (*FakeVar) IsStatic

func (fv *FakeVar) IsStatic() bool

func (*FakeVar) Name

func (fv *FakeVar) Name() string

func (*FakeVar) Receiver

func (fv *FakeVar) Receiver() string

func (*FakeVar) RunTransform

func (fv *FakeVar) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*FakeVar) SetGoName

func (fv *FakeVar) SetGoName(newname string)

func (*FakeVar) String

func (fv *FakeVar) String() string

func (*FakeVar) Type

func (fv *FakeVar) Type() ast.Expr

func (*FakeVar) VarType

func (fv *FakeVar) VarType() *TypeData

type FileManager

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

func NewFileManager

func NewFileManager(name string) *FileManager

func (*FileManager) FileSet

func (mgr *FileManager) FileSet() *token.FileSet

func (*FileManager) NextPos

func (mgr *FileManager) NextPos() token.Pos

type GoArrayAlloc

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

func (*GoArrayAlloc) Expr

func (aa *GoArrayAlloc) Expr() ast.Expr

func (*GoArrayAlloc) Init

func (aa *GoArrayAlloc) Init() ast.Stmt

func (*GoArrayAlloc) RunTransform

func (aa *GoArrayAlloc) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoArrayAlloc) String

func (aa *GoArrayAlloc) String() string

func (*GoArrayAlloc) VarType

func (aa *GoArrayAlloc) VarType() *TypeData

type GoArrayExpr

type GoArrayExpr interface {
	GoExpr
}

type GoArrayInit

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

func (*GoArrayInit) Expr

func (ai *GoArrayInit) Expr() ast.Expr

func (*GoArrayInit) Init

func (ai *GoArrayInit) Init() ast.Stmt

func (*GoArrayInit) RunTransform

func (ai *GoArrayInit) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoArrayInit) String

func (ai *GoArrayInit) String() string

func (*GoArrayInit) VarType

func (ai *GoArrayInit) VarType() *TypeData

type GoArrayReference

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

func (*GoArrayReference) Equals

func (nae *GoArrayReference) Equals(govar GoVar) bool

func (*GoArrayReference) Expr

func (nae *GoArrayReference) Expr() ast.Expr

func (*GoArrayReference) GoName

func (nae *GoArrayReference) GoName() string

func (*GoArrayReference) Ident

func (nae *GoArrayReference) Ident() *ast.Ident

func (*GoArrayReference) IndexExpr

func (nae *GoArrayReference) IndexExpr() *ast.IndexExpr

func (*GoArrayReference) Init

func (nae *GoArrayReference) Init() ast.Stmt

func (*GoArrayReference) IsClassField

func (nae *GoArrayReference) IsClassField() bool

func (*GoArrayReference) IsFinal

func (nae *GoArrayReference) IsFinal() bool

func (*GoArrayReference) IsStatic

func (nae *GoArrayReference) IsStatic() bool

func (*GoArrayReference) Name

func (nae *GoArrayReference) Name() string

func (*GoArrayReference) Receiver

func (nae *GoArrayReference) Receiver() string

func (*GoArrayReference) RunTransform

func (nae *GoArrayReference) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoArrayReference) SetGoName

func (nae *GoArrayReference) SetGoName(newname string)

func (*GoArrayReference) String

func (nae *GoArrayReference) String() string

func (*GoArrayReference) Type

func (nae *GoArrayReference) Type() ast.Expr

func (*GoArrayReference) VarType

func (nae *GoArrayReference) VarType() *TypeData

type GoAssign

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

func (*GoAssign) Expr

func (asgn *GoAssign) Expr() ast.Expr

func (*GoAssign) Init

func (asgn *GoAssign) Init() ast.Stmt

func (*GoAssign) RunTransform

func (asgn *GoAssign) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoAssign) Stmts

func (asgn *GoAssign) Stmts() []ast.Stmt

func (*GoAssign) String

func (asgn *GoAssign) String() string

func (*GoAssign) VarType

func (asgn *GoAssign) VarType() *TypeData

type GoBinaryExpr

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

func (*GoBinaryExpr) BinaryExpr

func (bex *GoBinaryExpr) BinaryExpr() *ast.BinaryExpr

func (*GoBinaryExpr) Expr

func (bex *GoBinaryExpr) Expr() ast.Expr

func (*GoBinaryExpr) Init

func (bex *GoBinaryExpr) Init() ast.Stmt

func (*GoBinaryExpr) RunTransform

func (bex *GoBinaryExpr) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoBinaryExpr) String

func (bex *GoBinaryExpr) String() string

func (*GoBinaryExpr) VarType

func (bex *GoBinaryExpr) VarType() *TypeData

type GoBlock

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

func (*GoBlock) BlockStmt

func (blk *GoBlock) BlockStmt() *ast.BlockStmt

func (*GoBlock) RunTransform

func (blk *GoBlock) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoBlock) Stmts

func (blk *GoBlock) Stmts() []ast.Stmt

func (*GoBlock) String

func (blk *GoBlock) String() string

func (*GoBlock) VarType

func (blk *GoBlock) VarType() *TypeData

type GoBranchStmt

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

func (*GoBranchStmt) RunTransform

func (bs *GoBranchStmt) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoBranchStmt) Stmts

func (bs *GoBranchStmt) Stmts() []ast.Stmt

func (*GoBranchStmt) String

func (bs *GoBranchStmt) String() string

func (*GoBranchStmt) VarType

func (bs *GoBranchStmt) VarType() *TypeData

type GoCastType

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

func (*GoCastType) Expr

func (cast *GoCastType) Expr() ast.Expr

func (*GoCastType) Init

func (cast *GoCastType) Init() ast.Stmt

func (*GoCastType) RunTransform

func (cast *GoCastType) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoCastType) String

func (cast *GoCastType) String() string

func (*GoCastType) TypeExpr

func (cast *GoCastType) TypeExpr() *ast.TypeAssertExpr

func (*GoCastType) VarType

func (cast *GoCastType) VarType() *TypeData

type GoClass

type GoClass interface {
	GoObject
	AddConstant(con *GoConstant)
	AddMethod(mthd GoMethod)
	Constants() []ast.Decl
	Decls() []ast.Decl

	FindMethod(name string, args *GoMethodArguments) GoMethod

	IsNil() bool
	IsReference() bool
	Name() string
	Parent() GoMethodOwner
	Statics() []ast.Decl
	Super() GoMethodOwner
	String() string
	WriteString(out io.Writer, verbose bool)
	// contains filtered or unexported methods
}

type GoClassAlloc

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

func (*GoClassAlloc) Expr

func (gca *GoClassAlloc) Expr() ast.Expr

func (*GoClassAlloc) Init

func (gca *GoClassAlloc) Init() ast.Stmt

func (*GoClassAlloc) RunTransform

func (gca *GoClassAlloc) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoClassAlloc) String

func (gca *GoClassAlloc) String() string

func (*GoClassAlloc) VarType

func (gca *GoClassAlloc) VarType() *TypeData

type GoClassAttribute

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

func (*GoClassAttribute) Equals

func (gvr *GoClassAttribute) Equals(govar GoVar) bool

func (*GoClassAttribute) Expr

func (gvr *GoClassAttribute) Expr() ast.Expr

func (*GoClassAttribute) GoName

func (gvr *GoClassAttribute) GoName() string

func (*GoClassAttribute) Ident

func (gvr *GoClassAttribute) Ident() *ast.Ident

func (*GoClassAttribute) Init

func (gvr *GoClassAttribute) Init() ast.Stmt

func (*GoClassAttribute) IsClassField

func (gvr *GoClassAttribute) IsClassField() bool

func (*GoClassAttribute) IsFinal

func (gvr *GoClassAttribute) IsFinal() bool

func (*GoClassAttribute) IsStatic

func (gvr *GoClassAttribute) IsStatic() bool

func (*GoClassAttribute) Name

func (gvr *GoClassAttribute) Name() string

func (*GoClassAttribute) Receiver

func (gvr *GoClassAttribute) Receiver() string

func (*GoClassAttribute) RunTransform

func (gvr *GoClassAttribute) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoClassAttribute) SetGoName

func (gvr *GoClassAttribute) SetGoName(newname string)

func (*GoClassAttribute) String

func (gvr *GoClassAttribute) String() string

func (*GoClassAttribute) Suffix

func (gvr *GoClassAttribute) Suffix() string

func (*GoClassAttribute) Type

func (gvr *GoClassAttribute) Type() ast.Expr

func (*GoClassAttribute) VarType

func (gvr *GoClassAttribute) VarType() *TypeData

type GoClassDefinition

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

func NewGoClassDefinition

func NewGoClassDefinition(program *GoProgram, parent GoMethodOwner,
	name string) *GoClassDefinition

func (*GoClassDefinition) AddConstant

func (cls *GoClassDefinition) AddConstant(con *GoConstant)

func (*GoClassDefinition) AddMethod

func (cls *GoClassDefinition) AddMethod(newmthd GoMethod)

func (*GoClassDefinition) AddNewMethod

func (cls *GoClassDefinition) AddNewMethod(gs *GoState, mth *grammar.JMethodDecl)

func (*GoClassDefinition) Constants

func (cls *GoClassDefinition) Constants() []ast.Decl

func (*GoClassDefinition) Decls

func (cls *GoClassDefinition) Decls() []ast.Decl

func (*GoClassDefinition) FindMethod

func (cls *GoClassDefinition) FindMethod(name string,
	args *GoMethodArguments) GoMethod

func (*GoClassDefinition) IsNil

func (cls *GoClassDefinition) IsNil() bool

func (*GoClassDefinition) IsReference

func (cls *GoClassDefinition) IsReference() bool

func (*GoClassDefinition) Name

func (cls *GoClassDefinition) Name() string

func (*GoClassDefinition) Parent

func (cls *GoClassDefinition) Parent() GoMethodOwner

func (*GoClassDefinition) RunTransform

func (cd *GoClassDefinition) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoClassDefinition) Statics

func (cls *GoClassDefinition) Statics() []ast.Decl

func (*GoClassDefinition) String

func (cls *GoClassDefinition) String() string

func (*GoClassDefinition) Super

func (cls *GoClassDefinition) Super() GoMethodOwner

func (*GoClassDefinition) WriteString

func (cls *GoClassDefinition) WriteString(out io.Writer, verbose bool)

type GoClassMethod

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

func NewGoClassMethod

func NewGoClassMethod(class GoMethodOwner, gs *GoState, jmth *grammar.JMethodDecl) *GoClassMethod

func (*GoClassMethod) Arguments

func (mthd *GoClassMethod) Arguments() []GoVar

func (*GoClassMethod) Body

func (mthd *GoClassMethod) Body() *GoBlock

func (*GoClassMethod) Class

func (mthd *GoClassMethod) Class() GoMethodOwner

func (*GoClassMethod) Decl

func (mthd *GoClassMethod) Decl() ast.Decl

func (*GoClassMethod) Field

func (mthd *GoClassMethod) Field() *ast.Field

func (*GoClassMethod) GoName

func (mthd *GoClassMethod) GoName() string

func (*GoClassMethod) HasArguments

func (mthd *GoClassMethod) HasArguments(args *GoMethodArguments) bool

func (*GoClassMethod) IsMethod

func (gcm *GoClassMethod) IsMethod(mthd GoMethod) bool

func (*GoClassMethod) MethodType

func (mthd *GoClassMethod) MethodType() methodType

func (*GoClassMethod) Name

func (mthd *GoClassMethod) Name() string

func (*GoClassMethod) NumParameters

func (mthd *GoClassMethod) NumParameters() int

func (*GoClassMethod) Receiver

func (mthd *GoClassMethod) Receiver() GoVar

func (*GoClassMethod) RunTransform

func (mthd *GoClassMethod) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoClassMethod) SetGoName

func (gcm *GoClassMethod) SetGoName(newname string)

func (*GoClassMethod) SetOriginal

func (gcm *GoClassMethod) SetOriginal(gcm2 *GoClassMethod)

func (*GoClassMethod) String

func (mthd *GoClassMethod) String() string

func (*GoClassMethod) VarType

func (mthd *GoClassMethod) VarType() *TypeData

func (*GoClassMethod) WriteString

func (mthd *GoClassMethod) WriteString(out io.Writer)

type GoClassReference

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

func (*GoClassReference) AddConstant

func (cref *GoClassReference) AddConstant(con *GoConstant)

func (*GoClassReference) AddMethod

func (cref *GoClassReference) AddMethod(mthd GoMethod)

func (*GoClassReference) Constants

func (cref *GoClassReference) Constants() []ast.Decl

func (*GoClassReference) Decls

func (cref *GoClassReference) Decls() []ast.Decl

func (*GoClassReference) FindMethod

func (cref *GoClassReference) FindMethod(name string,
	args *GoMethodArguments) GoMethod

func (*GoClassReference) IsNil

func (cref *GoClassReference) IsNil() bool

func (*GoClassReference) IsReference

func (cref *GoClassReference) IsReference() bool

func (*GoClassReference) Name

func (cref *GoClassReference) Name() string

func (*GoClassReference) Parent

func (cref *GoClassReference) Parent() GoMethodOwner

func (*GoClassReference) RunTransform

func (cref *GoClassReference) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoClassReference) Statics

func (cref *GoClassReference) Statics() []ast.Decl

func (*GoClassReference) String

func (cref *GoClassReference) String() string

func (*GoClassReference) Super

func (cref *GoClassReference) Super() GoMethodOwner

func (*GoClassReference) WriteString

func (cref *GoClassReference) WriteString(out io.Writer, verbose bool)

type GoConstant

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

func (*GoConstant) Decl

func (con *GoConstant) Decl() ast.Decl

func (*GoConstant) Equals

func (con *GoConstant) Equals(govar GoVar) bool

func (*GoConstant) Expr

func (con *GoConstant) Expr() ast.Expr

func (*GoConstant) GoName

func (con *GoConstant) GoName() string

func (*GoConstant) Ident

func (con *GoConstant) Ident() *ast.Ident

func (*GoConstant) Init

func (con *GoConstant) Init() ast.Stmt

func (*GoConstant) IsClassField

func (con *GoConstant) IsClassField() bool

func (*GoConstant) IsFinal

func (con *GoConstant) IsFinal() bool

func (*GoConstant) IsStatic

func (con *GoConstant) IsStatic() bool

func (*GoConstant) Name

func (con *GoConstant) Name() string

func (*GoConstant) Receiver

func (con *GoConstant) Receiver() string

func (*GoConstant) RunTransform

func (con *GoConstant) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoConstant) SetGoName

func (con *GoConstant) SetGoName(newname string)

func (*GoConstant) String

func (con *GoConstant) String() string

func (*GoConstant) Type

func (con *GoConstant) Type() ast.Expr

func (*GoConstant) VarType

func (con *GoConstant) VarType() *TypeData

func (*GoConstant) WriteString

func (con *GoConstant) WriteString(out io.Writer)

type GoEmpty

type GoEmpty struct {
}

func NewGoEmpty

func NewGoEmpty() *GoEmpty

type GoEnumConstant

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

func (*GoEnumConstant) ValueSpec

func (ec *GoEnumConstant) ValueSpec(num int, typeident *ast.Ident) *ast.ValueSpec

func (*GoEnumConstant) WriteString

func (ec *GoEnumConstant) WriteString(out io.Writer)

type GoEnumDefinition

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

func (*GoEnumDefinition) Decls

func (enum *GoEnumDefinition) Decls(gp *GoProgram) []ast.Decl

func (*GoEnumDefinition) WriteString

func (enum *GoEnumDefinition) WriteString(out io.Writer)

type GoExpr

type GoExpr interface {
	GoObject
	Expr() ast.Expr

	Init() ast.Stmt
	String() string
	VarType() *TypeData
	// contains filtered or unexported methods
}

type GoExprStmt

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

func (*GoExprStmt) RunTransform

func (exst *GoExprStmt) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoExprStmt) Stmts

func (exst *GoExprStmt) Stmts() []ast.Stmt

func (*GoExprStmt) String

func (exst *GoExprStmt) String() string

func (*GoExprStmt) VarType

func (exst *GoExprStmt) VarType() *TypeData

type GoFakeClass

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

func NewGoFakeClass

func NewGoFakeClass(name string) *GoFakeClass

func (*GoFakeClass) AddConstant

func (gfc *GoFakeClass) AddConstant(con *GoConstant)

func (*GoFakeClass) AddMethod

func (gfc *GoFakeClass) AddMethod(mthd GoMethod)

func (*GoFakeClass) Constants

func (gfc *GoFakeClass) Constants() []ast.Decl

func (*GoFakeClass) Decls

func (gfc *GoFakeClass) Decls() []ast.Decl

func (*GoFakeClass) FindMethod

func (gfc *GoFakeClass) FindMethod(name string,
	args *GoMethodArguments) GoMethod

func (*GoFakeClass) IsNil

func (gfc *GoFakeClass) IsNil() bool

func (*GoFakeClass) IsReference

func (gfc *GoFakeClass) IsReference() bool

func (*GoFakeClass) Name

func (gfc *GoFakeClass) Name() string

func (*GoFakeClass) Parent

func (gfc *GoFakeClass) Parent() GoMethodOwner

func (*GoFakeClass) RunTransform

func (gfc *GoFakeClass) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoFakeClass) SetPackage

func (gfc *GoFakeClass) SetPackage(pkg string)

func (*GoFakeClass) Statics

func (gfc *GoFakeClass) Statics() []ast.Decl

func (*GoFakeClass) String

func (gfc *GoFakeClass) String() string

func (*GoFakeClass) Super

func (gfc *GoFakeClass) Super() GoMethodOwner

func (*GoFakeClass) WriteString

func (gfc *GoFakeClass) WriteString(out io.Writer, verbose bool)

type GoFakeMethod

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

func NewGoFakeMethod

func NewGoFakeMethod(cls GoMethodOwner, name string, rtntype *TypeData) *GoFakeMethod

func (*GoFakeMethod) Arguments

func (gfm *GoFakeMethod) Arguments() []GoVar

func (*GoFakeMethod) Body

func (gfm *GoFakeMethod) Body() *GoBlock

func (*GoFakeMethod) Class

func (gfm *GoFakeMethod) Class() GoMethodOwner

func (*GoFakeMethod) Decl

func (gfm *GoFakeMethod) Decl() ast.Decl

func (*GoFakeMethod) Field

func (gfm *GoFakeMethod) Field() *ast.Field

func (*GoFakeMethod) GoName

func (gfm *GoFakeMethod) GoName() string

func (*GoFakeMethod) HasArguments

func (gfm *GoFakeMethod) HasArguments(args *GoMethodArguments) bool

func (*GoFakeMethod) IsMethod

func (gfm *GoFakeMethod) IsMethod(mthd GoMethod) bool

func (*GoFakeMethod) MethodType

func (gfm *GoFakeMethod) MethodType() methodType

func (*GoFakeMethod) Name

func (gfm *GoFakeMethod) Name() string

func (*GoFakeMethod) NumParameters

func (mthd *GoFakeMethod) NumParameters() int

func (*GoFakeMethod) Receiver

func (gfm *GoFakeMethod) Receiver() GoVar

func (*GoFakeMethod) RunTransform

func (gfm *GoFakeMethod) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoFakeMethod) SetGoName

func (gfm *GoFakeMethod) SetGoName(newname string)

func (*GoFakeMethod) SetOriginal

func (gfm *GoFakeMethod) SetOriginal(gcm *GoClassMethod)

func (*GoFakeMethod) VarType

func (gfm *GoFakeMethod) VarType() *TypeData

func (*GoFakeMethod) WriteString

func (gfm *GoFakeMethod) WriteString(out io.Writer)

type GoForColon

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

func (*GoForColon) RunTransform

func (fc *GoForColon) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoForColon) Stmts

func (fc *GoForColon) Stmts() []ast.Stmt

func (*GoForColon) String

func (fc *GoForColon) String() string

type GoForExpr

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

func (*GoForExpr) RunTransform

func (fe *GoForExpr) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoForExpr) Stmts

func (fe *GoForExpr) Stmts() []ast.Stmt

func (*GoForExpr) String

func (fe *GoForExpr) String() string

type GoForVar

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

func (*GoForVar) RunTransform

func (gfv *GoForVar) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoForVar) Stmts

func (gfv *GoForVar) Stmts() []ast.Stmt

func (*GoForVar) String

func (gfv *GoForVar) String() string

type GoFunc

type GoFunc interface {
	Create() ast.Stmt
	//Expr(gs *GoState) *ast.FuncDecl
	GoName() string
	Receiver() string
}

type GoFuncData

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

func (*GoFuncData) Create

func (gf *GoFuncData) Create() ast.Stmt

func (*GoFuncData) GoName

func (gf *GoFuncData) GoName() string

func (*GoFuncData) Receiver

func (gf *GoFuncData) Receiver() string

type GoFuncRef

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

func (*GoFuncRef) Create

func (gfr *GoFuncRef) Create() ast.Stmt

func (*GoFuncRef) GoName

func (gfr *GoFuncRef) GoName() string

func (*GoFuncRef) Receiver

func (gfr *GoFuncRef) Receiver() string

type GoIfElse

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

func (*GoIfElse) IfStmt

func (gie *GoIfElse) IfStmt() *ast.IfStmt

func (*GoIfElse) RunTransform

func (gie *GoIfElse) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoIfElse) Stmts

func (gie *GoIfElse) Stmts() []ast.Stmt

func (*GoIfElse) String

func (gie *GoIfElse) String() string

type GoIfaceMethod

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

func NewGoInterfaceMethod

func NewGoInterfaceMethod(gp *GoProgram, iface_name string,
	imth *grammar.JInterfaceMethodDecl) *GoIfaceMethod

func (*GoIfaceMethod) Arguments

func (gm *GoIfaceMethod) Arguments() []GoVar

func (*GoIfaceMethod) Body

func (gm *GoIfaceMethod) Body() *GoBlock

func (*GoIfaceMethod) Class

func (gm *GoIfaceMethod) Class() GoMethodOwner

func (*GoIfaceMethod) Decl

func (gm *GoIfaceMethod) Decl() ast.Decl

func (*GoIfaceMethod) Field

func (gm *GoIfaceMethod) Field() *ast.Field

func (*GoIfaceMethod) GoName

func (gm *GoIfaceMethod) GoName() string

func (*GoIfaceMethod) HasArguments

func (gm *GoIfaceMethod) HasArguments(args *GoMethodArguments) bool

func (*GoIfaceMethod) IsMethod

func (gm *GoIfaceMethod) IsMethod(mthd GoMethod) bool

func (*GoIfaceMethod) MethodType

func (gm *GoIfaceMethod) MethodType() methodType

func (*GoIfaceMethod) Name

func (gm *GoIfaceMethod) Name() string

func (*GoIfaceMethod) NumParameters

func (gm *GoIfaceMethod) NumParameters() int

func (*GoIfaceMethod) Receiver

func (gm *GoIfaceMethod) Receiver() GoVar

func (*GoIfaceMethod) RunTransform

func (gm *GoIfaceMethod) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoIfaceMethod) SetGoName

func (gm *GoIfaceMethod) SetGoName(newname string)

func (*GoIfaceMethod) SetOriginal

func (gm *GoIfaceMethod) SetOriginal(gcm *GoClassMethod)

func (*GoIfaceMethod) VarType

func (gm *GoIfaceMethod) VarType() *TypeData

func (*GoIfaceMethod) WriteString

func (gm *GoIfaceMethod) WriteString(out io.Writer)

type GoImportClass

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

func (*GoImportClass) FullName

func (gic *GoImportClass) FullName() string

type GoImportPackage

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

func NewGoImportPackage

func NewGoImportPackage(pkgname string) *GoImportPackage

func (*GoImportPackage) ImportSpec

func (gip *GoImportPackage) ImportSpec() *ast.ImportSpec

type GoInstanceOf

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

func (*GoInstanceOf) Expr

func (gio *GoInstanceOf) Expr() ast.Expr

func (*GoInstanceOf) Init

func (gio *GoInstanceOf) Init() ast.Stmt

func (*GoInstanceOf) RunTransform

func (gio *GoInstanceOf) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoInstanceOf) String

func (gio *GoInstanceOf) String() string

func (*GoInstanceOf) VarType

func (gio *GoInstanceOf) VarType() *TypeData

type GoInterface

type GoInterface interface {
	Constants() []ast.Decl
	Decl() ast.Decl

	IsInterface() bool
	Matches(*grammar.JTypeName) bool
	Name() string
	String() string
	WriteString(io.Writer, bool)
	// contains filtered or unexported methods
}

type GoInterfaceDefinition

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

func NewGoInterfaceDefinition

func NewGoInterfaceDefinition(name string) *GoInterfaceDefinition

func (*GoInterfaceDefinition) AddConstant

func (gi *GoInterfaceDefinition) AddConstant(con *GoConstant)

func (*GoInterfaceDefinition) AddMethod

func (gi *GoInterfaceDefinition) AddMethod(newmthd GoMethod)

func (*GoInterfaceDefinition) Constants

func (gi *GoInterfaceDefinition) Constants() []ast.Decl

func (*GoInterfaceDefinition) Decl

func (gi *GoInterfaceDefinition) Decl() ast.Decl

func (*GoInterfaceDefinition) FindMethod

func (gi *GoInterfaceDefinition) FindMethod(name string,
	args *GoMethodArguments) GoMethod

func (*GoInterfaceDefinition) IsInterface

func (gi *GoInterfaceDefinition) IsInterface() bool

func (*GoInterfaceDefinition) IsNil

func (gi *GoInterfaceDefinition) IsNil() bool

func (*GoInterfaceDefinition) Matches

func (gi *GoInterfaceDefinition) Matches(name *grammar.JTypeName) bool

func (*GoInterfaceDefinition) Name

func (gi *GoInterfaceDefinition) Name() string

func (*GoInterfaceDefinition) Statics

func (gi *GoInterfaceDefinition) Statics() []ast.Decl

func (*GoInterfaceDefinition) String

func (gi *GoInterfaceDefinition) String() string

func (*GoInterfaceDefinition) Super

func (*GoInterfaceDefinition) WriteString

func (gi *GoInterfaceDefinition) WriteString(out io.Writer, verbose bool)

type GoInterfaceReference

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

func (*GoInterfaceReference) Constants

func (ref *GoInterfaceReference) Constants() []ast.Decl

func (*GoInterfaceReference) Decl

func (ref *GoInterfaceReference) Decl() ast.Decl

func (*GoInterfaceReference) IsInterface

func (ref *GoInterfaceReference) IsInterface() bool

func (*GoInterfaceReference) Matches

func (ref *GoInterfaceReference) Matches(name *grammar.JTypeName) bool

func (*GoInterfaceReference) Name

func (ref *GoInterfaceReference) Name() string

func (*GoInterfaceReference) String

func (ref *GoInterfaceReference) String() string

func (*GoInterfaceReference) WriteString

func (ref *GoInterfaceReference) WriteString(out io.Writer, verbose bool)

type GoJumpToLabel

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

func NewGoJumpToLabel

func NewGoJumpToLabel(label string, is_continue bool) *GoJumpToLabel

func (*GoJumpToLabel) RunTransform

func (j2l *GoJumpToLabel) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoJumpToLabel) Stmts

func (j2l *GoJumpToLabel) Stmts() []ast.Stmt

func (*GoJumpToLabel) String

func (j2l *GoJumpToLabel) String() string

type GoKeyword

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

func NewGoKeyword

func NewGoKeyword(token int, name string) *GoKeyword

func (*GoKeyword) Expr

func (key *GoKeyword) Expr() ast.Expr

func (*GoKeyword) Ident

func (key *GoKeyword) Ident() *ast.Ident

func (*GoKeyword) Init

func (key *GoKeyword) Init() ast.Stmt

func (*GoKeyword) RunTransform

func (key *GoKeyword) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoKeyword) String

func (key *GoKeyword) String() string

func (*GoKeyword) VarType

func (key *GoKeyword) VarType() *TypeData

type GoLabeledStmt

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

func (*GoLabeledStmt) Init

func (gl *GoLabeledStmt) Init() ast.Stmt

func (*GoLabeledStmt) RunTransform

func (gl *GoLabeledStmt) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoLabeledStmt) Stmts

func (gl *GoLabeledStmt) Stmts() []ast.Stmt

func (*GoLabeledStmt) String

func (gl *GoLabeledStmt) String() string

type GoLiteral

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

func NewGoLiteral

func NewGoLiteral(text string) *GoLiteral

func (*GoLiteral) Expr

func (gl *GoLiteral) Expr() ast.Expr

func (*GoLiteral) Init

func (gl *GoLiteral) Init() ast.Stmt

func (*GoLiteral) RunTransform

func (gl *GoLiteral) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoLiteral) String

func (gl *GoLiteral) String() string

func (*GoLiteral) VarType

func (gl *GoLiteral) VarType() *TypeData

type GoLocalVarCast

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

func NewGoLocalVarCast

func NewGoLocalVarCast(govar GoVar, cast GoExpr) *GoLocalVarCast

func (*GoLocalVarCast) RunTransform

func (glv *GoLocalVarCast) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoLocalVarCast) Stmts

func (glv *GoLocalVarCast) Stmts() []ast.Stmt

func (*GoLocalVarCast) String

func (glc *GoLocalVarCast) String() string

type GoLocalVarInit

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

func NewGoLocalVarInit

func NewGoLocalVarInit(govar GoVar, init GoExpr) *GoLocalVarInit

func (*GoLocalVarInit) RunTransform

func (glv *GoLocalVarInit) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoLocalVarInit) Stmts

func (glv *GoLocalVarInit) Stmts() []ast.Stmt

func (*GoLocalVarInit) String

func (glv *GoLocalVarInit) String() string

type GoLocalVarNoInit

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

func NewGoLocalVarNoInit

func NewGoLocalVarNoInit(govar GoVar) *GoLocalVarNoInit

func (*GoLocalVarNoInit) RunTransform

func (glv *GoLocalVarNoInit) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoLocalVarNoInit) Stmts

func (glv *GoLocalVarNoInit) Stmts() []ast.Stmt

func (*GoLocalVarNoInit) String

func (glv *GoLocalVarNoInit) String() string

type GoMethod

type GoMethod interface {
	GoObject
	Arguments() []GoVar
	Body() *GoBlock
	Class() GoMethodOwner
	Decl() ast.Decl
	Field() *ast.Field
	GoName() string
	HasArguments(args *GoMethodArguments) bool
	IsMethod(mthd GoMethod) bool
	MethodType() methodType
	Name() string
	NumParameters() int
	Receiver() GoVar
	SetGoName(name string)
	SetOriginal(gcm *GoClassMethod)
	VarType() *TypeData
	WriteString(out io.Writer)
}

type GoMethodAccess

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

func (*GoMethodAccess) Expr

func (ma *GoMethodAccess) Expr() ast.Expr

func (*GoMethodAccess) Init

func (ma *GoMethodAccess) Init() ast.Stmt

func (*GoMethodAccess) RunTransform

func (ma *GoMethodAccess) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoMethodAccess) String

func (ma *GoMethodAccess) String() string

func (*GoMethodAccess) VarType

func (ma *GoMethodAccess) VarType() *TypeData

type GoMethodAccessExpr

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

func (*GoMethodAccessExpr) Expr

func (ma *GoMethodAccessExpr) Expr() ast.Expr

func (*GoMethodAccessExpr) Init

func (ma *GoMethodAccessExpr) Init() ast.Stmt

func (*GoMethodAccessExpr) RunTransform

func (ma *GoMethodAccessExpr) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoMethodAccessExpr) String

func (ma *GoMethodAccessExpr) String() string

func (*GoMethodAccessExpr) VarType

func (ma *GoMethodAccessExpr) VarType() *TypeData

type GoMethodAccessKeyword

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

func (*GoMethodAccessKeyword) Expr

func (ma *GoMethodAccessKeyword) Expr() ast.Expr

func (*GoMethodAccessKeyword) Init

func (ma *GoMethodAccessKeyword) Init() ast.Stmt

func (*GoMethodAccessKeyword) RunTransform

func (ma *GoMethodAccessKeyword) RunTransform(xform TransformFunc,
	prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoMethodAccessKeyword) String

func (ma *GoMethodAccessKeyword) String() string

func (*GoMethodAccessKeyword) VarType

func (ma *GoMethodAccessKeyword) VarType() *TypeData

type GoMethodAccessVar

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

func (*GoMethodAccessVar) Expr

func (ma *GoMethodAccessVar) Expr() ast.Expr

func (*GoMethodAccessVar) Init

func (ma *GoMethodAccessVar) Init() ast.Stmt

func (*GoMethodAccessVar) RunTransform

func (ma *GoMethodAccessVar) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoMethodAccessVar) String

func (ma *GoMethodAccessVar) String() string

func (*GoMethodAccessVar) VarType

func (ma *GoMethodAccessVar) VarType() *TypeData

type GoMethodArguments

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

func NewGoMethodArguments

func NewGoMethodArguments(gs *GoState, owner GoMethodOwner,
	args []grammar.JObject) *GoMethodArguments

func (*GoMethodArguments) ExprList

func (ma *GoMethodArguments) ExprList() []ast.Expr

func (*GoMethodArguments) Length

func (ma *GoMethodArguments) Length() int

func (*GoMethodArguments) RunTransform

func (ma *GoMethodArguments) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoMethodArguments) String

func (ma *GoMethodArguments) String() string

func (*GoMethodArguments) WriteString

func (ma *GoMethodArguments) WriteString(out io.Writer)

type GoMethodOwner

type GoMethodOwner interface {
	AddConstant(con *GoConstant)
	AddMethod(mthd GoMethod)
	Constants() []ast.Decl
	FindMethod(name string, args *GoMethodArguments) GoMethod
	IsNil() bool
	Name() string
	Statics() []ast.Decl
	String() string
	Super() GoMethodOwner
	WriteString(out io.Writer, verbose bool)
}

type GoMethodReference

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

func NewGoMethodReference

func NewGoMethodReference(class GoMethodOwner, name string,
	args *GoMethodArguments, verbose bool) *GoMethodReference

func (*GoMethodReference) Arguments

func (mref *GoMethodReference) Arguments() []GoVar

func (*GoMethodReference) Body

func (mref *GoMethodReference) Body() *GoBlock

func (*GoMethodReference) Class

func (mref *GoMethodReference) Class() GoMethodOwner

func (*GoMethodReference) Decl

func (mref *GoMethodReference) Decl() ast.Decl

func (*GoMethodReference) Field

func (mref *GoMethodReference) Field() *ast.Field

func (*GoMethodReference) GoName

func (mref *GoMethodReference) GoName() string

func (*GoMethodReference) HasArguments

func (mref *GoMethodReference) HasArguments(args *GoMethodArguments) bool

func (*GoMethodReference) IsMethod

func (mref *GoMethodReference) IsMethod(mthd GoMethod) bool

func (*GoMethodReference) MethodType

func (mref *GoMethodReference) MethodType() methodType

func (*GoMethodReference) Name

func (mref *GoMethodReference) Name() string

func (*GoMethodReference) NumParameters

func (mref *GoMethodReference) NumParameters() int

func (*GoMethodReference) Receiver

func (mref *GoMethodReference) Receiver() GoVar

func (*GoMethodReference) RunTransform

func (mref *GoMethodReference) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoMethodReference) SetGoName

func (mref *GoMethodReference) SetGoName(newname string)

func (*GoMethodReference) SetOriginal

func (mref *GoMethodReference) SetOriginal(mthd *GoClassMethod)

func (*GoMethodReference) String

func (mref *GoMethodReference) String() string

func (*GoMethodReference) VarType

func (mref *GoMethodReference) VarType() *TypeData

func (*GoMethodReference) WriteString

func (mref *GoMethodReference) WriteString(out io.Writer)

type GoNewStruct

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

func NewGoNewStruct

func NewGoNewStruct(rcvr GoVar, cls GoMethodOwner, is_super bool,
	args *GoMethodArguments) *GoNewStruct

func (*GoNewStruct) RunTransform

func (gsc *GoNewStruct) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoNewStruct) Stmts

func (gsc *GoNewStruct) Stmts() []ast.Stmt

func (*GoNewStruct) String

func (gsc *GoNewStruct) String() string

type GoObject

type GoObject interface {
	RunTransform(xform TransformFunc, gp *GoProgram, cls GoClass,
		parent GoObject) (GoObject, bool)
}

func TransformArrayLen

func TransformArrayLen(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform "array.length" to "len(array)"

func TransformListMethods

func TransformListMethods(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform method calls for List variants to appropriate array operations

func TransformMainArgs

func TransformMainArgs(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform "func main(String[] xxx)" to "func main()" and all "xxx" references to "os.Args"

func TransformStringAddition

func TransformStringAddition(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform string addition into fmt.Sprintf

func TransformStringFormat

func TransformStringFormat(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform String.format method call into fmt.Sprintf

func TransformSysfile

func TransformSysfile(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform "System.out.print*(...)" to "fmt.Print*(...)" and "System.err.print*(...)" to "fmt.Fprintf(os.Stderr, ...)"

func TransformThisArg

func TransformThisArg(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform "foo(this)" to "foo(rcvr)"

func TransformToString

func TransformToString(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

transform various toString() calls into fmt.Sprintf

type GoObjectDotName

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

func NewObjectDotName

func NewObjectDotName(odn *grammar.JObjectDotName, obj GoExpr, gs *GoState) *GoObjectDotName

func (*GoObjectDotName) Equals

func (odn *GoObjectDotName) Equals(govar GoVar) bool

func (*GoObjectDotName) Expr

func (odn *GoObjectDotName) Expr() ast.Expr

func (*GoObjectDotName) GoName

func (odn *GoObjectDotName) GoName() string

func (*GoObjectDotName) Ident

func (odn *GoObjectDotName) Ident() *ast.Ident

func (*GoObjectDotName) Init

func (odn *GoObjectDotName) Init() ast.Stmt

func (*GoObjectDotName) IsClassField

func (odn *GoObjectDotName) IsClassField() bool

func (*GoObjectDotName) IsFinal

func (odn *GoObjectDotName) IsFinal() bool

func (*GoObjectDotName) IsStatic

func (odn *GoObjectDotName) IsStatic() bool

func (*GoObjectDotName) Name

func (odn *GoObjectDotName) Name() string

func (*GoObjectDotName) Receiver

func (odn *GoObjectDotName) Receiver() string

func (*GoObjectDotName) RunTransform

func (odn *GoObjectDotName) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoObjectDotName) SetGoName

func (odn *GoObjectDotName) SetGoName(newname string)

func (*GoObjectDotName) String

func (odn *GoObjectDotName) String() string

func (*GoObjectDotName) Type

func (odn *GoObjectDotName) Type() ast.Expr

func (*GoObjectDotName) VarType

func (odn *GoObjectDotName) VarType() *TypeData

type GoPkgName

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

func (*GoPkgName) Expr

func (gpn *GoPkgName) Expr() ast.Expr

func (*GoPkgName) Init

func (gpn *GoPkgName) Init() ast.Stmt

func (*GoPkgName) RunTransform

func (gpn *GoPkgName) RunTransform(xform TransformFunc, prog *GoProgram,
	cls GoClass, parent GoObject) (GoObject, bool)

func (*GoPkgName) String

func (gpn *GoPkgName) String() string

func (*GoPkgName) VarType

func (gpn *GoPkgName) VarType() *TypeData

type GoPrimitiveType

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

func NewGoPrimitiveType

func NewGoPrimitiveType(name string, dims int) *GoPrimitiveType

func (*GoPrimitiveType) Expr

func (pt *GoPrimitiveType) Expr() ast.Expr

func (*GoPrimitiveType) Init

func (pt *GoPrimitiveType) Init() ast.Stmt

func (*GoPrimitiveType) RunTransform

func (pt *GoPrimitiveType) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoPrimitiveType) String

func (pt *GoPrimitiveType) String() string

func (*GoPrimitiveType) VarType

func (pt *GoPrimitiveType) VarType() *TypeData

type GoProgram

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

func NewGoProgram

func NewGoProgram(name string, config *Config, verbose bool) *GoProgram

func (*GoProgram) Analyze

func (gp *GoProgram) Analyze(pgm *grammar.JProgramFile)

func (*GoProgram) Decls

func (gp *GoProgram) Decls() []ast.Decl

func (*GoProgram) Dump

func (gp *GoProgram) Dump(out io.Writer)

func (*GoProgram) DumpTree

func (gp *GoProgram) DumpTree()

func (*GoProgram) File

func (gp *GoProgram) File() *ast.File

func (*GoProgram) FileSet

func (gp *GoProgram) FileSet() *token.FileSet

func (*GoProgram) ImportedType

func (gp *GoProgram) ImportedType(name string) string

func (*GoProgram) Imports

func (gp *GoProgram) Imports() []*ast.ImportSpec

func (*GoProgram) IsInterface

func (gp *GoProgram) IsInterface(name string) bool

func (*GoProgram) Name

func (gp *GoProgram) Name() string

func (*GoProgram) Receiver

func (gp *GoProgram) Receiver(class string) string

func (*GoProgram) RunTransform

func (gp *GoProgram) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoProgram) Write

func (gp *GoProgram) Write(topdir string) error

func (*GoProgram) WriteString

func (gp *GoProgram) WriteString(out io.Writer)

type GoReference

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

func (*GoReference) Expr

func (ref *GoReference) Expr() ast.Expr

func (*GoReference) Init

func (ref *GoReference) Init() ast.Stmt

func (*GoReference) RunTransform

func (ref *GoReference) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoReference) String

func (ref *GoReference) String() string

func (*GoReference) VarType

func (ref *GoReference) VarType() *TypeData

type GoReturn

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

func (*GoReturn) RunTransform

func (rtn *GoReturn) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoReturn) Stmts

func (rtn *GoReturn) Stmts() []ast.Stmt

func (*GoReturn) String

func (rtn *GoReturn) String() string

type GoSelector

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

func NewGoSelector

func NewGoSelector(expr GoExpr, sel GoVar) *GoSelector

func (*GoSelector) Equals

func (sel *GoSelector) Equals(govar GoVar) bool

func (*GoSelector) Expr

func (sel *GoSelector) Expr() ast.Expr

func (*GoSelector) GoName

func (sel *GoSelector) GoName() string

func (*GoSelector) Ident

func (fv *GoSelector) Ident() *ast.Ident

func (*GoSelector) Init

func (sel *GoSelector) Init() ast.Stmt

func (*GoSelector) IsClassField

func (sel *GoSelector) IsClassField() bool

func (*GoSelector) IsFinal

func (sel *GoSelector) IsFinal() bool

func (*GoSelector) IsStatic

func (sel *GoSelector) IsStatic() bool

func (*GoSelector) Name

func (sel *GoSelector) Name() string

func (*GoSelector) Receiver

func (sel *GoSelector) Receiver() string

func (*GoSelector) RunTransform

func (sel *GoSelector) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoSelector) SetGoName

func (sel *GoSelector) SetGoName(newname string)

func (*GoSelector) String

func (sel *GoSelector) String() string

func (*GoSelector) Type

func (sel *GoSelector) Type() ast.Expr

func (*GoSelector) VarType

func (sel *GoSelector) VarType() *TypeData

type GoState

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

func NewGoState

func NewGoState(parent *GoState) *GoState

func (*GoState) Class

func (gs *GoState) Class() *GoClassDefinition

func (*GoState) ClassName

func (gs *GoState) ClassName() string

func (*GoState) Program

func (gs *GoState) Program() *GoProgram

func (*GoState) Receiver

func (gs *GoState) Receiver() string

type GoStatement

type GoStatement interface {
	GoObject

	Stmts() []ast.Stmt
	String() string
	// contains filtered or unexported methods
}

type GoStatic

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

func (*GoStatic) Decl

func (stat *GoStatic) Decl() ast.Decl

func (*GoStatic) RunTransform

func (stat *GoStatic) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoStatic) String

func (stat *GoStatic) String() string

type GoSwitch

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

func (*GoSwitch) RunTransform

func (gsw *GoSwitch) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoSwitch) Stmts

func (gsw *GoSwitch) Stmts() []ast.Stmt

func (*GoSwitch) String

func (gsw *GoSwitch) String() string

type GoSwitchCase

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

func (*GoSwitchCase) RunTransform

func (gsc *GoSwitchCase) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoSwitchCase) String

func (gsc *GoSwitchCase) String() string

type GoSwitchLabel

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

func (*GoSwitchLabel) List

func (gsl *GoSwitchLabel) List() []ast.Expr

func (*GoSwitchLabel) RunTransform

func (gsl *GoSwitchLabel) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoSwitchLabel) String

func (gsl *GoSwitchLabel) String() string

type GoSynchronized

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

func (*GoSynchronized) RunTransform

func (sync *GoSynchronized) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoSynchronized) Stmts

func (sync *GoSynchronized) Stmts() []ast.Stmt

func (*GoSynchronized) String

func (sync *GoSynchronized) String() string

type GoThrow

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

func (*GoThrow) RunTransform

func (thr *GoThrow) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoThrow) Stmts

func (thr *GoThrow) Stmts() []ast.Stmt

func (*GoThrow) String

func (thr *GoThrow) String() string

type GoTry

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

func (*GoTry) RunTransform

func (try *GoTry) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoTry) Stmts

func (try *GoTry) Stmts() []ast.Stmt

func (*GoTry) String

func (try *GoTry) String() string

type GoTryCatch

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

func (*GoTryCatch) RunTransform

func (gtc *GoTryCatch) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoTryCatch) String

func (gtc *GoTryCatch) String() string

type GoTypedObject

type GoTypedObject interface {
	GoObject
	VarType() *TypeData
}

type GoUnaryExpr

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

func (*GoUnaryExpr) Expr

func (uex *GoUnaryExpr) Expr() ast.Expr

func (*GoUnaryExpr) Init

func (uex *GoUnaryExpr) Init() ast.Stmt

func (*GoUnaryExpr) RunTransform

func (uex *GoUnaryExpr) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoUnaryExpr) Stmts

func (uex *GoUnaryExpr) Stmts() []ast.Stmt

func (*GoUnaryExpr) String

func (uex *GoUnaryExpr) String() string

func (*GoUnaryExpr) UnaryExpr

func (uex *GoUnaryExpr) UnaryExpr() *ast.UnaryExpr

func (*GoUnaryExpr) VarType

func (uex *GoUnaryExpr) VarType() *TypeData

type GoUnimplemented

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

func (*GoUnimplemented) Expr

func (un *GoUnimplemented) Expr() ast.Expr

func (*GoUnimplemented) GoName

func (un *GoUnimplemented) GoName() string

func (*GoUnimplemented) Init

func (un *GoUnimplemented) Init() ast.Stmt

func (*GoUnimplemented) IsClassField

func (un *GoUnimplemented) IsClassField() bool

func (*GoUnimplemented) IsFinal

func (un *GoUnimplemented) IsFinal() bool

func (*GoUnimplemented) IsStatic

func (un *GoUnimplemented) IsStatic() bool

func (*GoUnimplemented) Name

func (un *GoUnimplemented) Name() string

func (*GoUnimplemented) RunTransform

func (un *GoUnimplemented) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoUnimplemented) Stmts

func (un *GoUnimplemented) Stmts() []ast.Stmt

func (*GoUnimplemented) String

func (un *GoUnimplemented) String() string

func (*GoUnimplemented) Type

func (un *GoUnimplemented) Type() ast.Expr

func (*GoUnimplemented) VarType

func (un *GoUnimplemented) VarType() *TypeData

type GoVar

type GoVar interface {
	GoObject
	Expr() ast.Expr
	GoName() string
	Equals(govar GoVar) bool

	Ident() *ast.Ident
	Init() ast.Stmt
	IsClassField() bool
	IsFinal() bool
	IsStatic() bool
	Name() string
	Receiver() string
	SetGoName(newname string)
	String() string
	Type() ast.Expr
	VarType() *TypeData
	// contains filtered or unexported methods
}

type GoVarData

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

func (*GoVarData) Equals

func (gvd *GoVarData) Equals(govar GoVar) bool

func (*GoVarData) Expr

func (gvd *GoVarData) Expr() ast.Expr

func (*GoVarData) GoName

func (gvd *GoVarData) GoName() string

func (*GoVarData) Ident

func (gvd *GoVarData) Ident() *ast.Ident

func (*GoVarData) Init

func (gvd *GoVarData) Init() ast.Stmt

func (*GoVarData) IsClassField

func (gvd *GoVarData) IsClassField() bool

func (*GoVarData) IsFinal

func (gvd *GoVarData) IsFinal() bool

func (*GoVarData) IsStatic

func (gvd *GoVarData) IsStatic() bool

func (*GoVarData) Name

func (gvd *GoVarData) Name() string

func (*GoVarData) Receiver

func (gvd *GoVarData) Receiver() string

func (*GoVarData) RunTransform

func (gvd *GoVarData) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoVarData) SetGoName

func (gvd *GoVarData) SetGoName(newname string)

func (*GoVarData) String

func (gvd *GoVarData) String() string

func (*GoVarData) Type

func (gvd *GoVarData) Type() ast.Expr

func (*GoVarData) VarType

func (gvd *GoVarData) VarType() *TypeData

type GoVarInit

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

func (*GoVarInit) Expr

func (gvi *GoVarInit) Expr() ast.Expr

func (*GoVarInit) Init

func (gvi *GoVarInit) Init() ast.Stmt

func (*GoVarInit) RunTransform

func (gvi *GoVarInit) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoVarInit) String

func (gvi *GoVarInit) String() string

func (*GoVarInit) VarType

func (gvi *GoVarInit) VarType() *TypeData

type GoWhile

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

func (*GoWhile) RunTransform

func (while *GoWhile) RunTransform(xform TransformFunc, prog *GoProgram, cls GoClass, parent GoObject) (GoObject, bool)

func (*GoWhile) Stmts

func (while *GoWhile) Stmts() []ast.Stmt

func (*GoWhile) String

func (while *GoWhile) String() string

type InterfaceSlice

type InterfaceSlice []GoInterface

InterfaceSlice is a GoInterface wrapper for sort.Sort()

func (InterfaceSlice) Len

func (p InterfaceSlice) Len() int

func (InterfaceSlice) Less

func (p InterfaceSlice) Less(i, j int) bool

func (InterfaceSlice) Swap

func (p InterfaceSlice) Swap(i, j int)

type NilMethodOwner

type NilMethodOwner struct {
}

func (*NilMethodOwner) AddConstant

func (nm *NilMethodOwner) AddConstant(con *GoConstant)

func (*NilMethodOwner) AddMethod

func (nm *NilMethodOwner) AddMethod(mthd GoMethod)

func (*NilMethodOwner) Constants

func (nm *NilMethodOwner) Constants() []ast.Decl

func (*NilMethodOwner) FindMethod

func (nm *NilMethodOwner) FindMethod(name string,
	args *GoMethodArguments) GoMethod

func (*NilMethodOwner) IsNil

func (nm *NilMethodOwner) IsNil() bool

func (*NilMethodOwner) Name

func (nm *NilMethodOwner) Name() string

func (*NilMethodOwner) Statics

func (nm *NilMethodOwner) Statics() []ast.Decl

func (*NilMethodOwner) String

func (nm *NilMethodOwner) String() string

func (*NilMethodOwner) Super

func (nm *NilMethodOwner) Super() GoMethodOwner

func (*NilMethodOwner) WriteString

func (nm *NilMethodOwner) WriteString(out io.Writer, verbose bool)

type TransformFunc

type TransformFunc func(parent GoObject, prog *GoProgram, cls GoClass,
	object GoObject) (GoObject, bool)

type TypeData

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

func NewTypeDataObject

func NewTypeDataObject(tdict TypeDictionary, typename string, dims int) *TypeData

func NewTypeDataPrimitive

func NewTypeDataPrimitive(typename string, dims int) *TypeData

func (*TypeData) Decl

func (vdata *TypeData) Decl() ast.Expr

func (*TypeData) Equals

func (vdata *TypeData) Equals(odata *TypeData) bool

func (*TypeData) Expr

func (vdata *TypeData) Expr() ast.Expr

func (*TypeData) IsClass

func (vdata *TypeData) IsClass(name string) bool

func (*TypeData) Name

func (vdata *TypeData) Name() string

func (*TypeData) String

func (vdata *TypeData) String() string

func (*TypeData) TypeName

func (vdata *TypeData) TypeName() (ast.Expr, bool)

type TypeDictionary

type TypeDictionary interface {
	ImportedType(string) string
	IsInterface(string) bool
}

type VarType

type VarType int
const (
	VT_ILLEGAL VarType = iota
	VT_VOID
	VT_BOOL
	VT_BYTE
	VT_CHAR
	VT_INT16
	VT_INT
	VT_INT64
	VT_FLOAT32
	VT_FLOAT64
	VT_STRING
	VT_GENERIC_OBJECT
	VT_ARRAY
	VT_MAP
	VT_INTERFACE
	VT_CLASS
)

bool byte rune char uint8 uint16 uint32 uint64 int8 int16 int32 int64 uintptr float32 float64 complex64 complex128 string

func (VarType) String

func (vt VarType) String() string

Jump to

Keyboard shortcuts

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