Skip to content

Commit 83fb14b

Browse files
Create 2025-11-25-grammar
1 parent dc026af commit 83fb14b

File tree

2 files changed

+758
-0
lines changed

2 files changed

+758
-0
lines changed

docs/2025-11-25-grammar-intro.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 猫头鹰文法
2+
3+
> :fontawesome-regular-face-grin: everything411
4+
>
5+
> :material-clock-edit-outline: 2025年11月26日 21:56:35
6+
7+
写了个好玩的东西:[猫头鹰文法](./2025-11-25-grammar.html)
8+
9+
建议食用年级:大三以上。
10+
11+
---
12+
13+
玩了一下,已经看什么都是猫头鹰了。
14+
15+
---
16+
17+
还有些改进点:
18+
19+
- 支持添加空格打断猫头鹰token
20+
21+
`猫头鹰头猫 头鹰`可以解析成“(猫头鹰 头 猫)头鹰”,而`猫头鹰头猫头鹰`是“猫头鹰 头 猫头鹰”。
22+
23+
这个好实现,在词法分析的时候最前面加一个遇到空格就`continue`就行。
24+
25+
- 实现左右结合的切换
26+
27+
操作符``改成右结合则需要重新写语法分析。

0 commit comments

Comments
 (0)