-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filterConfObj.foreach遍历顺序不可控 #29
Comments
@RickyHuo 请评估3种方案: 方案一:
另外如果这样修改,如何支持条件判断相关的配置如:if else,考虑通过如下方式支持:
整体感觉,这种配置让人理解起来不够直观和简单,但是实现相对容易。 方案二:寻找其他配置解析库的替代方案,目前只找到了这一个,是否满足需求,还在确认中: 方案三:使用antlr4自定义一套配置文件解析规则,同时满足配置看起来直观、简单的需求和支持条件判 实现有学习成本和难度,但是最能满足需求(kv形式,plugin保持顺序,有条件判断, Field引用)。 |
还有1种方案是修改typesafe config的源码,把它存储配置的数据结构改成 注意:这样还是不满足 |
配置文件parser需求:
|
antlr4 grammer file见: 配置文件示例见:
经antlr4解析后,生成如下AST树: 根据此AST树和antlr4自动生成的代码进行listener/vistor遍历即可实现配置文件解析功能,解析后的配置转换为typesafe config,供各个插件使用。 需求满足情况如下:
|
@RickyHuo antlr4方案 |
filterConfObj.foreach遍历顺序不是按照配置文件中插件顺序从上至下遍历
The text was updated successfully, but these errors were encountered: