gf_lang

package
v0.0.0-...-a1b0e2b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GFentityOutput

type GFentityOutput struct {
	IDstr   gf_core.GF_ID  `json:"id_str"`
	TypeStr string         `json:"type_str"`
	Props   *GFentityProps `json:"props_map"`
}

type GFentityProps

type GFentityProps struct {
	Xf          float64 `json:"x_f"`
	Yf          float64 `json:"y_f"`
	Zf          float64 `json:"z_f"`
	RotationXf  float64 `json:"rotation_x_f"`
	RotationYf  float64 `json:"rotation_y_f"`
	RotationZf  float64 `json:"rotation_z_f"`
	ScaleXf     float64 `json:"scale_x_f"`
	ScaleYf     float64 `json:"scale_y_f"`
	ScaleZf     float64 `json:"scale_z_f"`
	ColorRedF   float64 `json:"color_red_f"`
	ColorGreenF float64 `json:"color_green_f"`
	ColorBlueF  float64 `json:"color_blue_f"`
}

type GFexpr

type GFexpr []interface{}

-------------------------------------------------

func CastToExpr

func CastToExpr(pExprLst []interface{}) GFexpr

type GFexternAPI

type GFexternAPI struct {
	InitEngineFun   func(map[string]*GFshaderDef)
	SetStateFun     func(GFstateChange) []interface{}
	CreateCubeFun   GFgeometryFunc
	CreateSphereFun GFgeometryFunc
	CreateLineFun   GFgeometryFunc
	AnimateFun      func([]map[string]interface{}, float64, bool)

	//------------------------------------
	// RPC
	// RPC_CALL
	RPCcall GFrpcCallFun

	// RPC_SERVE
	RPCserve GFrpcServeFun
}

func GetTestExternAPI

func GetTestExternAPI() GFexternAPI

type GFprogramDebug

type GFprogramDebug struct {
	RulesCallsCounterMap map[string]int
	StateHistoryLst      []*GFstate

	OutputEntitiesMap map[gf_core.GF_ID]*GFentityOutput

	// this is the full output built up over program execution
	// that stores all extern API calls.
	// this includes both the entities and state operations
	OutputLst []interface{}
}

func Run

func Run(pProgramASTlst GFexpr,
	pExternAPI GFexternAPI) ([]interface{}, []*GFprogramDebug, error)

type GFrpcCallFun

type GFrpcCallFun func(string,
	string,
	string,

	[]interface{}) map[string]interface{} // args list

type GFrpcServeFun

type GFrpcServeFun func(string,
	[]*GFrpcServerHandler,

	GFexternAPI) // extern_api

type GFrpcServerHandler

type GFrpcServerHandler struct {
	URLpathStr  string        // URL path
	ModuleStr   string        // module
	FunctionStr string        // function
	ArgsSpecLst []interface{} // args_spec
	CodeASTlst  []interface{} // code
}

type GFruleDef

type GFruleDef struct {
	NameStr        string
	ModifiersMap   map[string]interface{}
	ExpressionsLst GFexpr
}

type GFruleDefs

type GFruleDefs map[string][]*GFruleDef

type GFshaderDef

type GFshaderDef struct {
	NameStr         string
	UniformsDefsLst []GFshaderUniformDef
	VertexCodeStr   string
	FragmentCodeStr string
}

type GFshaderUniformDef

type GFshaderUniformDef struct {
	NameStr    string
	TypeStr    string
	DefaultVal interface{}
}

type GFstate

type GFstate struct {
	CreationUNIXtimeF float64 `json:"creation_unix_time_f"`

	Xf          float64 `json:"x_f"`
	Yf          float64 `json:"y_f"`
	Zf          float64 `json:"z_f"`
	RotationXf  float64 `json:"rotation_f"`
	RotationYf  float64 `json:"rotation_f"`
	RotationZf  float64 `json:"rotation_f"`
	ScaleXf     float64 `json:"scale_x_f"`
	ScaleYf     float64 `json:"scale_y_f"`
	ScaleZf     float64 `json:"scale_z_f"`
	ColorRedF   float64 `json:"color_red_f"`
	ColorGreenF float64 `json:"color_green_f"`
	ColorBlueF  float64 `json:"color_blue_f"`

	// global max number of iterations for any rule
	ItersMaxInt int `json:"iters_max_int"`

	// list of all rules that are executing
	RulesNamesStackLst []string `json:"rules_names_stack_lst"`

	// VARIABLES
	VarsMap map[string]*GFvariableVal `json:"vars_map"`

	// global iterations number for a particular root expression
	ItersNumGlobalInt int `json:"iters_num_global_int"`

	// stack of iteration numbers for each rule as its entered
	RulesItersNumStackLst []int `json:"rules_iters_num_stack_lst"`

	// ANIMATIONS - map of animations that are currently active
	//              in a subexpression or its children
	AnimationsActiveMap map[string]interface{} `json:"animations_active_map"`
}

type GFstateChange

type GFstateChange struct {
	PropertyNameStr string `json:"property_name_str"`
	SetterTypeStr   string `json:"setter_type_str"`

	ColorRGBlst           []float64 `json:"color_rgb_lst"`
	ColorRGBhexStr        string    `json:"color_rgb_hex_str"`
	ColorBackgroundRGBlst []float64 `json:"color_background_rgb_lst"`
	ColorBackgroundHexStr string    `json:"color_background_hex_str"`

	MaterialTypeStr              string      `json:"material_type_str"`
	MaterialValueBool            bool        `json:"material_value_bool"`
	MaterialValueStr             string      `json:"material_value_str"`
	MaterialShaderNameStr        string      `json:"material_shader_name_str"`
	MaterialShaderUniformNameStr string      `json:"material_shader_uniform_name_str"`
	MaterialShaderUniformVal     interface{} `json:"material_shader_uniform_val"`

	LineCmdStr string `json:"line_cmd_str"`

	AxisTypeStr   string  `json:"axis_type_str"`
	OriginTypeStr string  `json:"origin_type_str"`
	Xf            float64 `json:"x_f"`
	Yf            float64 `json:"y_f"`
	Zf            float64 `json:"z_f"`
	RotationXf    float64 `json:"rotation_x_f"`
	RotationYf    float64 `json:"rotation_y_f"`
	RotationZf    float64 `json:"rotation_x_f"`
}

type GFstateChangeOutput

type GFstateChangeOutput struct {
	IDstr  gf_core.GF_ID  `json:"id_str"`
	Change *GFstateChange `json:"change_map"`
}

type GFsymbols

type GFsymbols struct {
	RuleLevelMaxInt         int
	SystemRulesLst          []string
	PredefinedPropertiesLst []string
	LogicOperatorsMap       map[string]func(float64, float64) bool
	ArithmeticOpsMap        map[string]func(float64, float64) float64
	SystemVarsLst           []string
	SystemFunctionsLst      []string
}

type GFvariableVal

type GFvariableVal struct {
	NameStr string
	TypeStr string // "string"|"number"|"list"
	Val     interface{}
}

Jump to

Keyboard shortcuts

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