Skip to content
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

Rewrite parser using BNF or other grammar grammar #20

Open
brett19 opened this issue Jul 20, 2018 · 3 comments
Open

Rewrite parser using BNF or other grammar grammar #20

brett19 opened this issue Jul 20, 2018 · 3 comments

Comments

@brett19
Copy link
Collaborator

brett19 commented Jul 20, 2018

There was a request that we rewrite the grammer into something more cross-platform so that it can be shared among the various implementations of JSONSM.

@brett19
Copy link
Collaborator Author

brett19 commented Jul 20, 2018

I don't think this is a hard requirement and is considered more a case of code maintainability optimization. It's definitely something to look into, but it shouldn't be taken as a priority at this time.

@brett19
Copy link
Collaborator Author

brett19 commented Jul 24, 2018

I started a bit of an experiment using BNF and gocc's lexer/parser generator:

Brett Lawson: 2018/07/18 04:07:21 Parsing: `name.first == 'Neil' && (isActive == true)`
Brett Lawson: 2018/07/18 04:07:21 Result: (PredicateExpr) (ComparisonExpr) == | (FieldRef)name.first | (Literal)Neil && (ComparisonExpr) == | (FieldRef)isActive | (Literal)true`
Brett Lawson: (made a little demo of an EBNF-based grammer lexer/parser)
Brett Lawson: https://gist.github.com/brett19/9030d72afb6f063259aefda7aaf68ab1

@brett19
Copy link
Collaborator Author

brett19 commented Jul 24, 2018

It appears that @dnault has begun a bit of the work on this using ANTLR4 for Javueh:

David Nault: Here's the Antlr4 grammar used by the Java implementation:
https://github.com/couchbaselabs/java-jsonsm/blob/master/src/main/antlr/com/couchbase/jsonsm/JsonSm.g4
David Nault: Listener and driver are here:
https://github.com/couchbaselabs/java-jsonsm/tree/master/src/main/java/com/couchbase/jsonsm/internal/grammar

@brett19 brett19 changed the title Rewrite grammer parser using BNF tree Rewrite grammer parser using BNF or other grammar grammar Jul 24, 2018
@brett19 brett19 changed the title Rewrite grammer parser using BNF or other grammar grammar Rewrite parser using BNF or other grammar grammar Jul 24, 2018
@nelio2k nelio2k self-assigned this Dec 11, 2018
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 2, 2019
…ration

This commit is the grammar definition and parsing section using participle.
The actual parser to matcher link has not been implemented yet.
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 14, 2019
…ration

This commit is the grammar definition and parsing section using participle.
The actual parser to matcher link has not been implemented yet.
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 18, 2019
…ration

This commit is the grammar definition and parsing section using participle.
The actual parser to matcher link has not been implemented yet.
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 22, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 24, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 25, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 26, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 28, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 29, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Jan 30, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Feb 1, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
nelio2k added a commit to nelio2k/gojsonsm that referenced this issue Feb 1, 2019
This commit uses participle to build a parser that will be used for XDCR's advanced filtering feature.
It is similar to N1QL with a few differences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants