rule

package
v0.0.0-...-7198e0a Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package rule 规则集 处理产生式

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formula

type Formula struct {
	Left  string
	Right string
}

表达式 分为左右两边

type Rule

type Rule struct {
	Rules map[string][]string
}

规则合集

func NewRules

func NewRules() *Rule

新建一个空的 规则

func (*Rule) AddRules

func (r *Rule) AddRules(s string) error

添加规则到规则集和中

func (*Rule) GetProcessMethod

func (r *Rule) GetProcessMethod(first, end string) *Formula

GetProcessMethod 获取处理方法 如果遇到了

func (*Rule) HaveEmptySet

func (r *Rule) HaveEmptySet(first string) bool

是否有空产生式

func (*Rule) TheFirstItemIs

func (r *Rule) TheFirstItemIs(first, item string) string

Jump to

Keyboard shortcuts

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