parser

package
v0.0.0-...-237b7d6 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

parser @author LanguageY++2013 2023/4/3 18:00 @company soulgame

parser @author LanguageY++2013 2023/3/31 09:39 @company soulgame

parser @author LanguageY++2013 2023/4/3 22:19 @company soulgame

Index

Constants

View Source
const (
	Token_EOF = iota
	Token_Unknown
	Token_Numeral //数字
	Token_Identifier
	Token_ParenL   // (
	Token_ParenR   // )
	Token_BracketL // [
	Token_BracketR // ]
	Token_Wildcard // * 通配符
	Token_Dot      // .
	Token_Comma    // ,
	Token_XMax     // max 函数
	Token_XMin     // min 函数
	Token_XFlatten // flatten 函数
	Token_XAvg     //  avg 平均
	//Token_XAnd		  // and 函数
	//Token_XOr		  // or 函数
	Token_XCount      // count 函数
	Token_ERules      // rules 实体
	Token_ETeams      // teams 实体
	Token_EPlayers    // players 实体
	Token_EAttributes // attributes 实体
)

自定义token id

Variables

This section is empty.

Functions

func AvgFloat64

func AvgFloat64(values []float64) (avg float64)

AvgFloat64 float64 切片求平均值

func AvgHandlerWrapper

func AvgHandlerWrapper(ctx context.Context, handler chain.UserHandler)

func CountHandlerWrapper

func CountHandlerWrapper(ctx context.Context, handler chain.UserHandler)

CountHandlerWrapper 计数

func FilterPlayerAttribute

func FilterPlayerAttribute(p *open.MatchPlayer, attrName string) float64

FilterPlayerAttribute 过滤玩家属性

func FilterRuleClosure

func FilterRuleClosure(rules []*open.MatchmakingRule, ruleNames []string) (out []*open.MatchmakingRule)

FilterRuleClosure 规则过滤闭包

func FilterTeamClosure

func FilterTeamClosure(teams []*open.MatchTeam, names []string) (out []*open.MatchTeam)

FilterTeamClosure 团队过滤闭包

func FlattenFloat2DArray

func FlattenFloat2DArray(array2d [][]float64) (out []float64)

FlattenFloat2DArray 扁平化二维float数组

func FlattenFloat2DArrayWithPtr

func FlattenFloat2DArrayWithPtr(array2d []*[]float64) (out []float64)

FlattenFloat2DArrayWithPtr 扁平化二维float数组

func FlattenHandlerWrapper

func FlattenHandlerWrapper(ctx context.Context, handler chain.UserHandler)

FlattenHandlerWrapper 多维数组扁平化(降维)

func MaxFloat64

func MaxFloat64(values []float64) float64

MaxFloat64 获取float数组最大值

func MaxHandlerWrapper

func MaxHandlerWrapper(ctx context.Context, handler chain.UserHandler)

MaxHandlerWrapper 最大值

func MinFloat64

func MinFloat64(values []float64) float64

MinFloat64 获取float数组最小值

func MinHandlerWrapper

func MinHandlerWrapper(ctx context.Context, handler chain.UserHandler)

MinHandlerWrapper 最小值处理

func RuleConfValue

func RuleConfValue(rule *open.MatchmakingRule, fieldName string) (ret float64)

RuleConfValue 读取rule配置值

func SumFloat64

func SumFloat64(values []float64) (sum float64)

SumFloat64 float64求和

func TeamConfValue

func TeamConfValue(team *open.MatchTeam, fieldName string) (ret float64)

TeamConfValue 读取team配置值

Types

type PropertyExprParser

type PropertyExprParser struct {
	*golexer.Parser
	// contains filtered or unexported fields
}

func NewPropertyExprParser

func NewPropertyExprParser(expr string) *PropertyExprParser

NewPropertyExprParser 建立属性表达式

func (*PropertyExprParser) BuildChain

func (p *PropertyExprParser) BuildChain()

构建调用链

func (*PropertyExprParser) Do

func (p *PropertyExprParser) Do(ctx context.Context, userHandler chain.UserHandler)

func (*PropertyExprParser) IsEntity

func (p *PropertyExprParser) IsEntity() bool

IsEntity Kind是否为实体

func (*PropertyExprParser) IsFunc

func (p *PropertyExprParser) IsFunc() bool

IsFunc Kind是否为函数

func (*PropertyExprParser) Parse

func (p *PropertyExprParser) Parse()

parseFunc 解析函数

Directories

Path Synopsis
parser @author LanguageY++2013 2023/4/3 20:44 @company soulgame
parser @author LanguageY++2013 2023/4/3 20:44 @company soulgame

Jump to

Keyboard shortcuts

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