grammarLL1

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: 11 Imported by: 0

Documentation

Overview

Package grammarLL1 一个 LL(1) 语法分析器包

Index

Constants

View Source
const EndToken = "#"

EndToken 句子结束符号

Variables

This section is empty.

Functions

This section is empty.

Types

type Grammar

type Grammar struct {
	Stream *util.Stream
	// contains filtered or unexported fields
}

Grammar 分析器

func NewGrammar

func NewGrammar(token []*lexer.Token, r io.Reader, et string, rule analysisTable.SymbolTable) *Grammar

NewGrammar 创建一个新的分析器

func (*Grammar) Analyze

func (g *Grammar) Analyze() (res []*Production)

Analyze 分析

type Production

type Production struct {
	Type   string
	Target string
	Origin string
	Next   string
}

Production 产生式子

func Analyze

func Analyze(raw []*lexer.Token, rules string, start string) ([]*Production, bool)

Analyze 分析器结果

Directories

Path Synopsis
Package analysisTable 分析表构造和处理包
Package analysisTable 分析表构造和处理包
Package first FIRST 集构造处理包
Package first FIRST 集构造处理包
Package follow FOLLOW 集构造处理包
Package follow FOLLOW 集构造处理包
Package rule 规则集 处理产生式
Package rule 规则集 处理产生式
Package util 专属通用函数库
Package util 专属通用函数库

Jump to

Keyboard shortcuts

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