Skip to content

Commit

Permalink
Updating the examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
walter-weinmann committed Apr 23, 2017
1 parent a07cad2 commit b836f6f
Showing 1 changed file with 126 additions and 111 deletions.
237 changes: 126 additions & 111 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,36 @@ RETURN m

```erlang
1> {ok, {ParseTree, Tokens}} = ocparse:source_to_pt("MATCH (m:Movie) WHERE m.title = 'The Matrix' RETURN m").

{ok,
{{cypher,
{statement,
{query,
{regularQuery,
{singleQuery,
[{clause,
{match,[],
{pattern,
[{patternPart,[],
{anonymousPatternPart,{patternElement,{...},...}}}]},
{where,
{expression,
{orExpression,{xorExpression,{andExpression,...},[]},[]}}}}},
{clause,
{return,[],
{returnBody,
{returnItems,[],[],[{returnItem,{...},...}]},
[],[],[]}}}]},
[]}}},
{regularQuery,
{singleQuery,
[{clause,
{match,[],
{pattern,
[{patternPart,[],
{patternElement,
{nodePattern,{symbolicName,"m"},{nodeLabels,[{...}]},[]},
[]}}]},
{where,
{orExpression,
{xorExpression,
{andExpression,
{notExpression,
{comparisonExpression,{addOrSubtractExpression,...},[...]},
[]},
[]},
[]},
[]}}}},
{clause,
{return,[],
{returnBody,
{returnItems,[],[],
[{returnItem,
{orExpression,{xorExpression,{...},...},[]},
[]}]},
[],[],[]}}}]},
[]},
[]},
[{'MATCH',1},
{'(',1},
Expand All @@ -62,32 +71,43 @@ RETURN m
2> ParseTree.

{cypher,
{statement,
{query,
{regularQuery,
{singleQuery,
[{clause,
{match,[],
{pattern,
[{patternPart,[],
{anonymousPatternPart,
{patternElement,
{nodePattern,{variable,...},{...},...},
[]}}}]},
{where,
{expression,
{regularQuery,
{singleQuery,
[{clause,
{match,[],
{pattern,
[{patternPart,[],
{patternElement,
{nodePattern,
{symbolicName,"m"},
{nodeLabels,[{nodeLabel,{symbolicName,...}}]},
[]},
[]}}]},
{where,
{orExpression,
{xorExpression,
{andExpression,
{notExpression,
{comparisonExpression,
{addOrSubtractExpression,
{multiplyDivideModuloExpression,{...},...},
[]},
[{partialComparisonExpression,{...},...}]},
[]},
[]},
[]},
[]}}}},
{clause,
{return,[],
{returnBody,
{returnItems,[],[],
[{returnItem,
{orExpression,
{xorExpression,
{andExpression,{notExpression,{...},...},[]},
[]},
[]}}}}},
{clause,
{return,[],
{returnBody,
{returnItems,[],[],
[{returnItem,{expression,{orExpression,...}},[]}]},
[],[],[]}}}]},
[]}}},
{xorExpression,{andExpression,{notExpression,...},[]},[]},
[]},
[]}]},
[],[],[]}}}]},
[]},
[]}
```

Expand Down Expand Up @@ -132,23 +152,62 @@ The output of the parse tree in the Erlang shell is shortened (cause not known).

```erlang
{cypher,
{statement,
{query,
{regularQuery,
{singleQuery,
[{clause,
{match,[],
{pattern,
[{patternPart,[],
{anonymousPatternPart,
{patternElement,
{nodePattern,
{variable,{symbolicName,"m"}},
{nodeLabels,[{nodeLabel,{labelName,{symbolicName,"Movie"}}}]},
{regularQuery,
{singleQuery,
[{clause,
{match,[],
{pattern,
[{patternPart,[],
{patternElement,
{nodePattern,
{symbolicName,"m"},
{nodeLabels,[{nodeLabel,{symbolicName,"Movie"}}]},
[]},
[]}}]},
{where,
{orExpression,
{xorExpression,
{andExpression,
{notExpression,
{comparisonExpression,
{addOrSubtractExpression,
{multiplyDivideModuloExpression,
{powerOfExpression,
{unaryAddOrSubtractExpression,
{stringListNullOperatorExpression,
{propertyOrLabelsExpression,
{atom,{symbolicName,"m"}},
[{propertyLookup,{symbolicName,"title"}}]},
[]},
[]},
[]},
[]},
[]}}}]},
{where,
{expression,
[]},
[{partialComparisonExpression,
{addOrSubtractExpression,
{multiplyDivideModuloExpression,
{powerOfExpression,
{unaryAddOrSubtractExpression,
{stringListNullOperatorExpression,
{propertyOrLabelsExpression,
{atom,
{literal,{stringLiteral,"'The Matrix'"}}},
[]},
[]},
[]},
[]},
[]},
[]},
"="}]},
[]},
[]},
[]},
[]}}}},
{clause,
{return,[],
{returnBody,
{returnItems,[],[],
[{returnItem,
{orExpression,
{xorExpression,
{andExpression,
Expand All @@ -160,65 +219,21 @@ The output of the parse tree in the Erlang shell is shortened (cause not known).
{unaryAddOrSubtractExpression,
{stringListNullOperatorExpression,
{propertyOrLabelsExpression,
{atom,{variable,{symbolicName,"m"}}},
[{propertyLookup,
{propertyKeyName,{symbolicName,"title"}}}]},
{atom,{symbolicName,"m"}},
[]},
[]},
[]},
[]},
[]},
[]},
[{partialComparisonExpression,
{addOrSubtractExpression,
{multiplyDivideModuloExpression,
{powerOfExpression,
{unaryAddOrSubtractExpression,
{stringListNullOperatorExpression,
{propertyOrLabelsExpression,
{atom,{literal,{stringLiteral,"'The Matrix'"}}},
[]},
[]},
[]},
[]},
[]},
[]},
"="}]},
[]},
[]},
[]},
[]},
[]}}}}},
{clause,
{return,[],
{returnBody,
{returnItems,[],[],
[{returnItem,
{expression,
{orExpression,
{xorExpression,
{andExpression,
{notExpression,
{comparisonExpression,
{addOrSubtractExpression,
{multiplyDivideModuloExpression,
{powerOfExpression,
{unaryAddOrSubtractExpression,
{stringListNullOperatorExpression,
{propertyOrLabelsExpression,
{atom,{variable,{symbolicName,"m"}}},
[]},
[]},
[]},
[]},
[]},
[]},
[]},
[]},
[]},
[]},
[]}},
[]}]},
[],[],[]}}}]},
[]}}},
[]},
[]}]},
[],[],[]}}}]},
[]},
[]}
```

Expand Down

0 comments on commit b836f6f

Please sign in to comment.