cleishm / libcypher-parser

Cypher Parser Library
Apache License 2.0
149 stars 39 forks source link

Q: Parser generation #7

Closed ChicagoDave closed 6 years ago

ChicagoDave commented 6 years ago

Can I assume all of the ast_ files are generated from a grammar syntax and if so, is it the grammar from http://www.opencypher.org/resources?

cleishm commented 6 years ago

Hi @chicagodave!

They’re not generated, no. While all based off a common template, each AST node represents the semantic model of that language element.

In theory, you could have a common source for those, or generate from the parse tree. Doing that and keeping a clean API for the library would be somewhat difficult.

As for opencypher: they don’t provide any AST templates. Just parser definitions, that are really only for reference (I know of no implementations that use these).

What’s your interest? Keen to help contribute to this? :)

ChicagoDave commented 6 years ago

I forked it and was thinking of creating a .NET Core implementation, but without generating code, this is probably out of my wheelhouse. I poked around with Antlr4, but the .NET Core implementation is not-ready-for-primetime.

My interest is in my refly repo where I'm building a new Interactive Fiction authoring platform in .NET Core with an embedded graph data store and fluent interfaces. I could probably implement Gremlin easier, but I personally think Cypher is the best graph data store interface. If I could build the parser in .NET Core, it might be possible to wire it into my home grown in-memory graph data store, which in and of itself would be "fancy shmancy".

This is purely hobby stuff for me.

cleishm commented 6 years ago

Sounds awesome! Good luck!