BloodHound Cypher Library
This project contains a golang parser implementation that for the openCypher project. The
primary goal of this implementation is to be lightweight and compatible with cypher dialect used by
Neo4j.
Several features may not be fully supported while this implementation continues to mature. Eventual support for most
legacy openCypher features is planned.
Generating the ANTLR Grammar
openCypher Repository Version Hash: 46223b9e8215814af333b7142850fea99a3949a7
The openCypher repository
contains instructions on how to generate output artifacts from the grammar XML sources. Below is an example on how to
generate the ANTLR grammar from the checked out version hash:
./tools/grammar/src/main/shell/launch.sh Antlr4 --INCLUDE_LEGACY=true cypher.xml > grammar/generated/Cypher.g4
Regenerating the ANTLR Parser Implementation
Download the latest version of ANTLR first and ensure that you have java
installed. The command below can be used to generate a new version of the openCypher parser backend.
java -jar ./antlr-4.13.0-complete.jar -Dlanguage=Go -o parser grammar/Cypher.g4
Language Features
PostgreSQL Translation
The models package contains two implementations: cypher and pgsql. The pgsql package contains a translation
implementation that attempts a best-effort match of cypher semantics using vanilla pgsql syntax.