Expand description
Syntax-faithful, span-rich AST for openCypher queries.
Produced by graphforge-cypher; consumed by graphforge-ir (the binder). No other crate
should depend on this module directly.
Every public type is Clone + Debug + PartialEq + Serialize + Deserialize
so the differential test harness can round-trip ASTs through JSON and
compare parser outputs.
Struct fields carry span: Span to locate source positions — doc comments
on these repetitive span fields are omitted intentionally.
Structs§
- AstQuery
- A fully parsed Cypher query.
- Binary
Op - A binary infix expression:
left op right. - Call
Clause - A
CALL procedure YIELD ...clause. - Case
Expr - A
CASEexpression — simple (CASE expr WHEN … THEN …) or searched (CASE WHEN … THEN …). - Create
Clause - A
CREATEclause. - Delete
Clause - A
DELETEorDETACH DELETEclause. - Existential
Subquery - A simple or full existential subquery.
- Function
Call - A function call:
name(args),name(DISTINCT arg), orname(*). - Label
Predicate - A label predicate:
n:Personused as a boolean expression. - List
Comprehension - A list comprehension:
[x IN list WHERE pred | projection]. - List
Literal - A list literal:
[1, 2, 3]. - MapLiteral
- A map literal:
{key: expr, …}. - Match
Clause - A
MATCHorOPTIONAL MATCHclause. - Merge
Clause - A
MERGEclause (with optional ON CREATE / ON MATCH SET actions). - Node
Pattern - A node pattern:
(var:Label {props}). - Order
ByClause - An
ORDER BYsub-clause carrying one or more sort keys. - Param
Ref - A query parameter reference:
$name. - Path
Pattern - A path pattern: one or more alternating node/relationship patterns.
- Pattern
Comprehension - A pattern comprehension:
[(n)-[r]->(m) WHERE pred | r.weight]. - Pattern
Predicate - A pattern predicate used as a boolean expression, e.g.
(n)-->(). - Property
Access - A property access:
n.prop. - Quantifier
- A quantifier predicate:
all/any/none/single(var IN list WHERE pred). - RelPattern
- A relationship pattern:
-[var:TYPE*min..max {props}]->. - Remove
Clause - A
REMOVEclause. - Return
Clause - A
RETURNclause. - Return
Item - A single item in a
RETURNorWITHprojection. - SetClause
- A
SETclause. - Sort
Item - A single sort key.
- UnaryOp
- A unary prefix expression:
NOT expror-expr. - Union
Clause - A
UNIONorUNION ALLclause joining two query halves. - Unwind
Clause - An
UNWINDclause. - VarRef
- A variable reference:
n. - When
Clause - A single
WHEN condition THEN resultarm inside aCASEexpression. - Where
Clause - A
WHEREclause (also used inline in MATCH/WITH). - With
Clause - A
WITHclause (pipeline stage with optional ORDER/SKIP/LIMIT/WHERE).
Enums§
- AstClause
- A top-level clause in a Cypher query.
- Binary
OpKind - All binary operators in openCypher.
- Dialect
Version - openCypher dialect version.
- Direction
- Edge direction in a relationship pattern.
- Existential
Subquery Body - Expr
- A Cypher expression.
- Literal
- A scalar literal value: integer, float, string, boolean, or null.
- Path
Element - One element in a path pattern.
- Quantifier
Kind - Which quantifier a
Quantifierpredicate applies. - Remove
Item - A single item inside a
REMOVEclause. - SetItem
- A single item inside a SET clause.
- Sort
Order - Sort direction.
- String
OpKind - The operation in a
STARTS WITH/ENDS WITH/CONTAINSstring predicate. - Unary
OpKind - The operator in a unary expression.