admin管理员组文章数量:1331849
I am developing an html/javascript app which allows users to search in a local database. I would like to support very advanced search queries like: abc | "def ghi" !jkl
I need to parse this kind of plex expressions in order to build the corresponding SQL query.
So, what I am looking for is a flexible parser written in javascript and it should let me define my expression grammar.
I am developing an html/javascript app which allows users to search in a local database. I would like to support very advanced search queries like: abc | "def ghi" !jkl
I need to parse this kind of plex expressions in order to build the corresponding SQL query.
So, what I am looking for is a flexible parser written in javascript and it should let me define my expression grammar.
Share Improve this question asked Mar 8, 2011 at 16:36 aartilesaartiles 1,4894 gold badges16 silver badges31 bronze badges 3- Check out the Sizzle source sizzlejs., might find some useful stuff in there. – Loktar Commented Mar 8, 2011 at 16:38
- 1 Are your users going to be technically savvy enough to understand this syntax? or would you be better off with "regular" keywords or a specialized form/wizard? – scunliffe Commented Mar 8, 2011 at 16:40
- I need to support the sphinx extended syntax since this is what I support on the online version sphinxsearch./docs/current.html#extended-syntax – aartiles Commented Mar 8, 2011 at 23:49
2 Answers
Reset to default 7pegJS : http://pegjs.majda.cz/ should also do the trick.
Jison is a JavaScript parser generator, written in JavaScript.
And yes, it is really flexible and lets you define your own grammar.
本文标签: parsingSearch expressions parser written in javascriptStack Overflow
版权声明:本文标题:parsing - Search expressions parser written in javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742217254a2434797.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论