Skip to content

Commit

Permalink
doc: add parser context doc
Browse files Browse the repository at this point in the history
  • Loading branch information
acekingke committed Dec 9, 2022
1 parent 56dda32 commit 930842e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ look ahead $, use Reduce:PROG -> PROG E NL , go to state 1
Shift PROG, push state 1
0
```
# parser with context
if you want build several parser in one app, you should use generate parser with context. Now it is just supported in Go
add `-o` option in generate command, for example:
```
bin/yaccgo generate go -o examples/e.y out/e.go
```
then, you should make context before using the parser, for example like this:
```
func main() {
c := MakeParserContext()
v := c.Parser("nnn")
fmt.Println(v)
}
```

# Web Debuger
If you want to debug the parser visually, you can use yaccgo debuger in browser.
![debuger](debugtool.gif)
Expand Down

0 comments on commit 930842e

Please sign in to comment.