sql解析器
用Python和C ++编写SQL解析器的简单版本,结果保存在树中。 目前,仅实现SELECT查询。
### Python先决条件:
PLY(Python Lex-Yacc)
用法
python yacc.py
-> SELECT a, b FROM c
+ QUERY
+ [SELECT]
+ [FIELDS]
+ [FIELD]
+ a
+ [FIELD]
+ b
+ [FROM]
+ [TABLE]
+ c
-> SELECT a . b , c . d FROM aaa AS a , ccc AS c
+ QUERY
+ [SELECT]
+ [FIELDS]
+ [FIELD]
+ a.b
+ [FI
2021-10-25 18:09:20
6KB
Python
1