From ec1110078362989fe8ac7a7572fa4f3b91f44dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 4 Jul 2022 18:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E5=88=92=E8=AF=8D=E6=B3=95=E5=88=86?= =?UTF-8?q?=E6=9E=90/=E8=AF=AD=E6=B3=95=E5=88=86=E6=9E=90/=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lexical.go | 8 ++++++++ syntax.go | 8 ++++++++ token.go | 28 ++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 lexical.go create mode 100644 syntax.go create mode 100644 token.go diff --git a/lexical.go b/lexical.go new file mode 100644 index 0000000..3d61dfa --- /dev/null +++ b/lexical.go @@ -0,0 +1,8 @@ +// Package filter ... +// +// Description : JSON 词法分析 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2022-07-04 17:52 +package filter diff --git a/syntax.go b/syntax.go new file mode 100644 index 0000000..c98c5bf --- /dev/null +++ b/syntax.go @@ -0,0 +1,8 @@ +// Package filter ... +// +// Description : 语法分析 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2022-07-04 17:53 +package filter diff --git a/token.go b/token.go new file mode 100644 index 0000000..154b807 --- /dev/null +++ b/token.go @@ -0,0 +1,28 @@ +// Package filter ... +// +// Description : 关键词定义 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2022-07-04 17:53 +package filter + +const ( + // list 类型起始 + listLeftToken = "[" + // listRight list 类型结束 + listRightToken = "]" + // 对象起始 + objectLeftToken = "{" + // 对象结束 + objectRightToken = "}" + // key 值的起始 + keyLeftToken = "\"" + // key 值的结束 + keyRightToken = "\"" + // kvPairSplit kv 的分隔符 + kvPairSplitToken = ":" + // 转义符 + escapeCharacterToken = "\\" +) +