Skip to content

shiyang1026/pratt-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pratt Parser 四则运算解析器

Example

package main

import (
	"fmt"
	"ppc/lexer"
	"ppc/parser"
)

func main() {
    // 此处输入运算式
	input := "1 + 9 * (3 - 2)+ (9 * 6)"
	l := lexer.New(input)
	p := parser.New(l)
	res := p.ParseExpression(0)
	fmt.Println(res)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Languages