Codebase list libcypher-parser / d95abb6
Imported dist 0.5.5 Chris Leishman 6 years ago
16 changed file(s) with 6253 addition(s) and 53 deletion(s). Raw diff Collapse all Expand all
133133 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_doxygen.m4 \
134134 $(top_srcdir)/m4/ax_pthread.m4 \
135135 $(top_srcdir)/m4/ax_thread_local.m4 \
136 $(top_srcdir)/m4/declare_versions.m4 \
136137 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
137138 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
138 $(top_srcdir)/m4/lt~obsolete.m4 \
139 $(top_srcdir)/m4/macro_static_assert.m4 \
140 $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/prog_cc_c11.m4 \
139 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
140 $(top_srcdir)/m4/prog_cc_c11.m4 \
141 $(top_srcdir)/m4/static_assert.m4 \
141142 $(top_srcdir)/m4/with_libs.m4 $(top_srcdir)/configure.ac
142143 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
143144 $(ACLOCAL_M4)
364365 OTOOL64 = @OTOOL64@
365366 PACKAGE = @PACKAGE@
366367 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
368 PACKAGE_DEVELOPMENT_VERSION = @PACKAGE_DEVELOPMENT_VERSION@
369 PACKAGE_MAJOR_VERSION = @PACKAGE_MAJOR_VERSION@
370 PACKAGE_MINOR_VERSION = @PACKAGE_MINOR_VERSION@
367371 PACKAGE_NAME = @PACKAGE_NAME@
372 PACKAGE_PATCH_VERSION = @PACKAGE_PATCH_VERSION@
373 PACKAGE_STATUS_VERSION = @PACKAGE_STATUS_VERSION@
368374 PACKAGE_STRING = @PACKAGE_STRING@
369375 PACKAGE_TARNAME = @PACKAGE_TARNAME@
370376 PACKAGE_URL = @PACKAGE_URL@
11881188 m4_include([m4/ax_prog_doxygen.m4])
11891189 m4_include([m4/ax_pthread.m4])
11901190 m4_include([m4/ax_thread_local.m4])
1191 m4_include([m4/declare_versions.m4])
11911192 m4_include([m4/libtool.m4])
11921193 m4_include([m4/ltoptions.m4])
11931194 m4_include([m4/ltsugar.m4])
11941195 m4_include([m4/ltversion.m4])
11951196 m4_include([m4/lt~obsolete.m4])
1196 m4_include([m4/macro_static_assert.m4])
11971197 m4_include([m4/pkg.m4])
11981198 m4_include([m4/prog_cc_c11.m4])
1199 m4_include([m4/static_assert.m4])
11991200 m4_include([m4/with_libs.m4])
7575 /* Define to the address where bug reports for this package should be sent. */
7676 #undef PACKAGE_BUGREPORT
7777
78 /* Define to the development version of this package */
79 #undef PACKAGE_DEVELOPMENT_VERSION
80
81 /* Define to the major version of this package */
82 #undef PACKAGE_MAJOR_VERSION
83
84 /* Define to the minor version of this package */
85 #undef PACKAGE_MINOR_VERSION
86
7887 /* Define to the full name of this package. */
7988 #undef PACKAGE_NAME
89
90 /* Define to the patch version of this package */
91 #undef PACKAGE_PATCH_VERSION
8092
8193 /* Define to the full name and version of this package. */
8294 #undef PACKAGE_STRING
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for libcypher-parser 0.5.4.
2 # Generated by GNU Autoconf 2.69 for libcypher-parser 0.5.5.
33 #
44 #
55 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
586586 # Identity of this package.
587587 PACKAGE_NAME='libcypher-parser'
588588 PACKAGE_TARNAME='libcypher-parser'
589 PACKAGE_VERSION='0.5.4'
590 PACKAGE_STRING='libcypher-parser 0.5.4'
589 PACKAGE_VERSION='0.5.5'
590 PACKAGE_STRING='libcypher-parser 0.5.5'
591591 PACKAGE_BUGREPORT=''
592592 PACKAGE_URL=''
593593
594 ac_unique_file="src/lib/cypher-parser.h"
594 ac_unique_file="src/lib/cypher-parser.h.in"
595595 # Factoring default headers for most tests.
596596 ac_includes_default="\
597597 #include <stdio.h>
744744 build_cpu
745745 build
746746 LIBTOOL
747 PACKAGE_STATUS_VERSION
748 PACKAGE_DEVELOPMENT_VERSION
749 PACKAGE_PATCH_VERSION
750 PACKAGE_MINOR_VERSION
751 PACKAGE_MAJOR_VERSION
747752 MAINT
748753 MAINTAINER_MODE_FALSE
749754 MAINTAINER_MODE_TRUE
13981403 # Omit some internal or obsolete options to make the list less imposing.
13991404 # This message is too long to be a string in the A/UX 3.1 sh.
14001405 cat <<_ACEOF
1401 \`configure' configures libcypher-parser 0.5.4 to adapt to many kinds of systems.
1406 \`configure' configures libcypher-parser 0.5.5 to adapt to many kinds of systems.
14021407
14031408 Usage: $0 [OPTION]... [VAR=VALUE]...
14041409
14691474
14701475 if test -n "$ac_init_help"; then
14711476 case $ac_init_help in
1472 short | recursive ) echo "Configuration of libcypher-parser 0.5.4:";;
1477 short | recursive ) echo "Configuration of libcypher-parser 0.5.5:";;
14731478 esac
14741479 cat <<\_ACEOF
14751480
16091614 test -n "$ac_init_help" && exit $ac_status
16101615 if $ac_init_version; then
16111616 cat <<\_ACEOF
1612 libcypher-parser configure 0.5.4
1617 libcypher-parser configure 0.5.5
16131618 generated by GNU Autoconf 2.69
16141619
16151620 Copyright (C) 2012 Free Software Foundation, Inc.
20742079 This file contains any messages produced by compilers while
20752080 running configure, to aid debugging if configure makes a mistake.
20762081
2077 It was created by libcypher-parser $as_me 0.5.4, which was
2082 It was created by libcypher-parser $as_me 0.5.5, which was
20782083 generated by GNU Autoconf 2.69. Invocation command line was
20792084
20802085 $ $0 $@
29392944
29402945 # Define the identity of the package.
29412946 PACKAGE='libcypher-parser'
2942 VERSION='0.5.4'
2947 VERSION='0.5.5'
29432948
29442949
29452950 cat >>confdefs.h <<_ACEOF
30563061
30573062 MAINT=$MAINTAINER_MODE_TRUE
30583063
3064
3065
3066
3067 if ! echo $VERSION | grep -Eq '^[0-9]+\.[0-9]+\.[0-9](~[a-zA-Z0-9_]+)?$'; then
3068 as_fn_error $? "Invalid version \"$VERSION\" specified in configure.ac. Must follow <major>.<minor>.<patch>[~<devel>] format." "$LINENO" 5
3069 fi
3070
3071 PACKAGE_MAJOR_VERSION=$(echo $VERSION | awk -F. '{print $1}')
3072
3073 cat >>confdefs.h <<_ACEOF
3074 #define PACKAGE_MAJOR_VERSION $PACKAGE_MAJOR_VERSION
3075 _ACEOF
3076
3077
3078
3079 PACKAGE_MINOR_VERSION=$(echo $VERSION | awk -F. '{print $2}')
3080
3081 cat >>confdefs.h <<_ACEOF
3082 #define PACKAGE_MINOR_VERSION $PACKAGE_MINOR_VERSION
3083 _ACEOF
3084
3085
3086
3087 PACKAGE_PATCH_VERSION=$(echo $VERSION | awk -F'[.~]' '{print $3}')
3088
3089 cat >>confdefs.h <<_ACEOF
3090 #define PACKAGE_PATCH_VERSION $PACKAGE_PATCH_VERSION
3091 _ACEOF
3092
3093
3094
3095 PACKAGE_DEVELOPMENT_VERSION=$(echo $VERSION | awk -F~ '{print $2}')
3096
3097 cat >>confdefs.h <<_ACEOF
3098 #define PACKAGE_DEVELOPMENT_VERSION "$PACKAGE_DEVELOPMENT_VERSION"
3099 _ACEOF
3100
3101
3102
3103 if "X$PACKAGE_DEVELOPMENT_VERSION" = "X" ; then
3104 PACKAGE_STATUS_VERSION=0
3105 else
3106 PACKAGE_STATUS_VERSION=1
3107 fi
30593108
30603109
30613110
1648216531 REQUIRES=`echo "$REQUIRES" | cut -c3-`
1648316532
1648416533
16485 ac_config_files="$ac_config_files cypher-lint.1 cypher-parser.pc Makefile m4/Makefile src/Makefile src/bin/Makefile src/lib/Makefile tests/Makefile"
16534 ac_config_files="$ac_config_files cypher-lint.1 cypher-parser.pc Makefile m4/Makefile src/Makefile src/bin/Makefile src/lib/cypher-parser.h src/lib/Makefile tests/Makefile"
1648616535
1648716536 cat >confcache <<\_ACEOF
1648816537 # This file is a shell script that caches the results of configure
1707817127 # report actual input values of CONFIG_FILES etc. instead of their
1707917128 # values after options handling.
1708017129 ac_log="
17081 This file was extended by libcypher-parser $as_me 0.5.4, which was
17130 This file was extended by libcypher-parser $as_me 0.5.5, which was
1708217131 generated by GNU Autoconf 2.69. Invocation command line was
1708317132
1708417133 CONFIG_FILES = $CONFIG_FILES
1714417193 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1714517194 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1714617195 ac_cs_version="\\
17147 libcypher-parser config.status 0.5.4
17196 libcypher-parser config.status 0.5.5
1714817197 configured by $0, generated by GNU Autoconf 2.69,
1714917198 with options \\"\$ac_cs_config\\"
1715017199
1756517614 "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
1756617615 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
1756717616 "src/bin/Makefile") CONFIG_FILES="$CONFIG_FILES src/bin/Makefile" ;;
17617 "src/lib/cypher-parser.h") CONFIG_FILES="$CONFIG_FILES src/lib/cypher-parser.h" ;;
1756817618 "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
1756917619 "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
1757017620
1313 #
1414 dnl Process this file with autoconf to produce a configure script
1515 AC_PREREQ([2.69])
16 AC_INIT([libcypher-parser],[0.5.4])
17 AC_CONFIG_SRCDIR([src/lib/cypher-parser.h])
16 AC_INIT([libcypher-parser],[0.5.5])
17 AC_CONFIG_SRCDIR([src/lib/cypher-parser.h.in])
1818 AC_CONFIG_MACRO_DIR([m4])
1919 AM_INIT_AUTOMAKE([foreign])
2020 AC_CONFIG_HEADER([config.h])
2121 AM_MAINTAINER_MODE([enable])
2222
23 DECLARE_VERSIONS
2324 WITH_LIBS
2425
2526 GCC_CFLAGS="-fvisibility=hidden -pipe -Wall -W -Werror \
5657 AC_TYPE_SIZE_T
5758 AC_TYPE_SSIZE_T
5859 AC_FUNC_STRERROR_R
59 MACRO_STATIC_ASSERT
60 STATIC_ASSERT
6061 LT_LIB_M
6162
6263
112113 m4/Makefile \
113114 src/Makefile \
114115 src/bin/Makefile \
116 src/lib/cypher-parser.h \
115117 src/lib/Makefile \
116118 tests/Makefile
117119 ])
9191 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_doxygen.m4 \
9292 $(top_srcdir)/m4/ax_pthread.m4 \
9393 $(top_srcdir)/m4/ax_thread_local.m4 \
94 $(top_srcdir)/m4/declare_versions.m4 \
9495 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
9596 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
96 $(top_srcdir)/m4/lt~obsolete.m4 \
97 $(top_srcdir)/m4/macro_static_assert.m4 \
98 $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/prog_cc_c11.m4 \
97 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
98 $(top_srcdir)/m4/prog_cc_c11.m4 \
99 $(top_srcdir)/m4/static_assert.m4 \
99100 $(top_srcdir)/m4/with_libs.m4 $(top_srcdir)/configure.ac
100101 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
101102 $(ACLOCAL_M4)
206207 OTOOL64 = @OTOOL64@
207208 PACKAGE = @PACKAGE@
208209 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
210 PACKAGE_DEVELOPMENT_VERSION = @PACKAGE_DEVELOPMENT_VERSION@
211 PACKAGE_MAJOR_VERSION = @PACKAGE_MAJOR_VERSION@
212 PACKAGE_MINOR_VERSION = @PACKAGE_MINOR_VERSION@
209213 PACKAGE_NAME = @PACKAGE_NAME@
214 PACKAGE_PATCH_VERSION = @PACKAGE_PATCH_VERSION@
215 PACKAGE_STATUS_VERSION = @PACKAGE_STATUS_VERSION@
210216 PACKAGE_STRING = @PACKAGE_STRING@
211217 PACKAGE_TARNAME = @PACKAGE_TARNAME@
212218 PACKAGE_URL = @PACKAGE_URL@
0 AC_DEFUN([DECLARE_VERSIONS],
1 [
2 if ! echo $VERSION | grep -Eq '^[[0-9]]+\.[[0-9]]+\.[[0-9]](~[[a-zA-Z0-9_]]+)?$'; then
3 AC_MSG_ERROR([[Invalid version "$VERSION" specified in configure.ac. Must follow <major>.<minor>.<patch>[~<devel>] format.]])
4 fi
5
6 PACKAGE_MAJOR_VERSION=$(echo $VERSION | awk -F. '{print $[1]}')
7 AC_DEFINE_UNQUOTED([PACKAGE_MAJOR_VERSION], $PACKAGE_MAJOR_VERSION,
8 [Define to the major version of this package])
9 AC_SUBST([PACKAGE_MAJOR_VERSION])
10
11 PACKAGE_MINOR_VERSION=$(echo $VERSION | awk -F. '{print $[2]}')
12 AC_DEFINE_UNQUOTED([PACKAGE_MINOR_VERSION], $PACKAGE_MINOR_VERSION,
13 [Define to the minor version of this package])
14 AC_SUBST([PACKAGE_MINOR_VERSION])
15
16 PACKAGE_PATCH_VERSION=$(echo $VERSION | awk -F'[[.~]]' '{print $[3]}')
17 AC_DEFINE_UNQUOTED([PACKAGE_PATCH_VERSION], $PACKAGE_PATCH_VERSION,
18 [Define to the patch version of this package])
19 AC_SUBST([PACKAGE_PATCH_VERSION])
20
21 PACKAGE_DEVELOPMENT_VERSION=$(echo $VERSION | awk -F~ '{print $[2]}')
22 AC_DEFINE_UNQUOTED([PACKAGE_DEVELOPMENT_VERSION], ["]$PACKAGE_DEVELOPMENT_VERSION["],
23 [Define to the development version of this package])
24 AC_SUBST([PACKAGE_DEVELOPMENT_VERSION])
25
26 if [ "X$PACKAGE_DEVELOPMENT_VERSION" = "X" ]; then
27 PACKAGE_STATUS_VERSION=0
28 else
29 PACKAGE_STATUS_VERSION=1
30 fi
31 AC_SUBST([PACKAGE_STATUS_VERSION])
32 ])
+0
-15
m4/macro_static_assert.m4 less more
0 AC_DEFUN([MACRO_STATIC_ASSERT],
1 [AC_CACHE_CHECK([for static_assert],
2 [neo4j_cv_macro_static_assert],
3 [AC_COMPILE_IFELSE(
4 [AC_LANG_PROGRAM([[
5 #include <assert.h>
6 static_assert(1, "impossible");
7 ]],[[return 0;]])],
8 [neo4j_cv_macro_static_assert=yes],
9 [neo4j_cv_macro_static_assert=no])])
10
11 if test "X$neo4j_cv_macro_static_assert" = "Xno"; then
12 AC_DEFINE([static_assert(c,m)],[typedef void _no_static_assert], [Substitute for static_assert])
13 fi
14 ])
0 AC_DEFUN([STATIC_ASSERT],
1 [AC_CACHE_CHECK([for static_assert],
2 [neo4j_cv_macro_static_assert],
3 [AC_COMPILE_IFELSE(
4 [AC_LANG_PROGRAM([[
5 #include <assert.h>
6 static_assert(1, "impossible");
7 ]],[[return 0;]])],
8 [neo4j_cv_macro_static_assert=yes],
9 [neo4j_cv_macro_static_assert=no])])
10
11 if test "X$neo4j_cv_macro_static_assert" = "Xno"; then
12 AC_DEFINE([static_assert(c,m)],[typedef void _no_static_assert], [Substitute for static_assert])
13 fi
14 ])
9292 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_doxygen.m4 \
9393 $(top_srcdir)/m4/ax_pthread.m4 \
9494 $(top_srcdir)/m4/ax_thread_local.m4 \
95 $(top_srcdir)/m4/declare_versions.m4 \
9596 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
9697 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
97 $(top_srcdir)/m4/lt~obsolete.m4 \
98 $(top_srcdir)/m4/macro_static_assert.m4 \
99 $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/prog_cc_c11.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
99 $(top_srcdir)/m4/prog_cc_c11.m4 \
100 $(top_srcdir)/m4/static_assert.m4 \
100101 $(top_srcdir)/m4/with_libs.m4 $(top_srcdir)/configure.ac
101102 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
102103 $(ACLOCAL_M4)
267268 OTOOL64 = @OTOOL64@
268269 PACKAGE = @PACKAGE@
269270 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
271 PACKAGE_DEVELOPMENT_VERSION = @PACKAGE_DEVELOPMENT_VERSION@
272 PACKAGE_MAJOR_VERSION = @PACKAGE_MAJOR_VERSION@
273 PACKAGE_MINOR_VERSION = @PACKAGE_MINOR_VERSION@
270274 PACKAGE_NAME = @PACKAGE_NAME@
275 PACKAGE_PATCH_VERSION = @PACKAGE_PATCH_VERSION@
276 PACKAGE_STATUS_VERSION = @PACKAGE_STATUS_VERSION@
271277 PACKAGE_STRING = @PACKAGE_STRING@
272278 PACKAGE_TARNAME = @PACKAGE_TARNAME@
273279 PACKAGE_URL = @PACKAGE_URL@
9393 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_doxygen.m4 \
9494 $(top_srcdir)/m4/ax_pthread.m4 \
9595 $(top_srcdir)/m4/ax_thread_local.m4 \
96 $(top_srcdir)/m4/declare_versions.m4 \
9697 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
9798 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 \
99 $(top_srcdir)/m4/macro_static_assert.m4 \
100 $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/prog_cc_c11.m4 \
99 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
100 $(top_srcdir)/m4/prog_cc_c11.m4 \
101 $(top_srcdir)/m4/static_assert.m4 \
101102 $(top_srcdir)/m4/with_libs.m4 $(top_srcdir)/configure.ac
102103 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
103104 $(ACLOCAL_M4)
258259 OTOOL64 = @OTOOL64@
259260 PACKAGE = @PACKAGE@
260261 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
262 PACKAGE_DEVELOPMENT_VERSION = @PACKAGE_DEVELOPMENT_VERSION@
263 PACKAGE_MAJOR_VERSION = @PACKAGE_MAJOR_VERSION@
264 PACKAGE_MINOR_VERSION = @PACKAGE_MINOR_VERSION@
261265 PACKAGE_NAME = @PACKAGE_NAME@
266 PACKAGE_PATCH_VERSION = @PACKAGE_PATCH_VERSION@
267 PACKAGE_STATUS_VERSION = @PACKAGE_STATUS_VERSION@
262268 PACKAGE_STRING = @PACKAGE_STRING@
263269 PACKAGE_TARNAME = @PACKAGE_TARNAME@
264270 PACKAGE_URL = @PACKAGE_URL@
149149 # increment age.
150150 # 4. If any interfaces have been removed or changed since the last public
151151 # release, then set age to 0.
152 libcypher_parser_la_LDFLAGS = -version-info 10:0:2
152 libcypher_parser_la_LDFLAGS = -version-info 10:1:2
153153
154154 parser.c: parser_leg.c
155155 quick_parser.c: quick_parser_leg.c
9393 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_doxygen.m4 \
9494 $(top_srcdir)/m4/ax_pthread.m4 \
9595 $(top_srcdir)/m4/ax_thread_local.m4 \
96 $(top_srcdir)/m4/declare_versions.m4 \
9697 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
9798 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 \
99 $(top_srcdir)/m4/macro_static_assert.m4 \
100 $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/prog_cc_c11.m4 \
99 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
100 $(top_srcdir)/m4/prog_cc_c11.m4 \
101 $(top_srcdir)/m4/static_assert.m4 \
101102 $(top_srcdir)/m4/with_libs.m4 $(top_srcdir)/configure.ac
102103 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
103104 $(ACLOCAL_M4)
105106 $(am__DIST_COMMON)
106107 mkinstalldirs = $(install_sh) -d
107108 CONFIG_HEADER = $(top_builddir)/config.h
108 CONFIG_CLEAN_FILES =
109 CONFIG_CLEAN_FILES = cypher-parser.h
109110 CONFIG_CLEAN_VPATH_FILES =
110111 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
111112 am__vpath_adj = case $$p in \
329330 done | $(am__uniquify_input)`
330331 ETAGS = etags
331332 CTAGS = ctags
332 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
333 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/cypher-parser.h.in \
334 $(top_srcdir)/depcomp
333335 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
334336 ACLOCAL = @ACLOCAL@
335337 AMTAR = @AMTAR@
411413 OTOOL64 = @OTOOL64@
412414 PACKAGE = @PACKAGE@
413415 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
416 PACKAGE_DEVELOPMENT_VERSION = @PACKAGE_DEVELOPMENT_VERSION@
417 PACKAGE_MAJOR_VERSION = @PACKAGE_MAJOR_VERSION@
418 PACKAGE_MINOR_VERSION = @PACKAGE_MINOR_VERSION@
414419 PACKAGE_NAME = @PACKAGE_NAME@
420 PACKAGE_PATCH_VERSION = @PACKAGE_PATCH_VERSION@
421 PACKAGE_STATUS_VERSION = @PACKAGE_STATUS_VERSION@
415422 PACKAGE_STRING = @PACKAGE_STRING@
416423 PACKAGE_TARNAME = @PACKAGE_TARNAME@
417424 PACKAGE_URL = @PACKAGE_URL@
634641 # increment age.
635642 # 4. If any interfaces have been removed or changed since the last public
636643 # release, then set age to 0.
637 libcypher_parser_la_LDFLAGS = -version-info 10:0:2
644 libcypher_parser_la_LDFLAGS = -version-info 10:1:2
638645 EXTRA_DIST = parser_leg.c quick_parser_leg.c
639646 MAINTAINERCLEANFILES = parser_leg.c quick_parser_leg.c
640647 all: all-am
670677 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
671678 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
672679 $(am__aclocal_m4_deps):
680 cypher-parser.h: $(top_builddir)/config.status $(srcdir)/cypher-parser.h.in
681 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
673682
674683 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
675684 @$(NORMAL_INSTALL)
00 /* vi:set ts=4 sw=4 expandtab:
1 *
2 * src/lib/cypher-parser.h. Generated from cypher-parser.h.in by configure.
13 *
24 * Copyright 2016, Chris Leishman (http://github.com/cleishm)
35 *
4143 #define __cypherlang_format(string_index, first) /*format*/
4244 #endif
4345
46
4447 #ifdef __cplusplus
4548 extern "C" {
4649 #endif
5356 * version
5457 * =====================================
5558 */
59
60 /* Compile time version details.
61 * For runtime version inspection, use libcypher_parser_version() instead.
62 */
63 #define CYPHER_PARSER_VERSION "0.5.5"
64 #define CYPHER_PARSER_MAJOR_VERSION 0
65 #define CYPHER_PARSER_MINOR_VERSION 5
66 #define CYPHER_PARSER_PATCH_VERSION 5
67 #define CYPHER_PARSER_DEVELOPMENT_VERSION ""
68
69 #define CYPHER_PARSER_VERSION_NUMBER \
70 ((CYPHER_PARSER_MAJOR_VERSION << 20) | \
71 (CYPHER_PARSER_MINOR_VERSION << 12) | \
72 (CYPHER_PARSER_PATCH_VERSION << 4) | 1)
5673
5774 /**
5875 * The version string for libcypher-parser.
0 /* vi:set ts=4 sw=4 expandtab:
1 *
2 * @configure_input@
3 *
4 * Copyright 2016, Chris Leishman (http://github.com/cleishm)
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 /**
19 * @file cypher-parser.h
20 */
21 #ifndef CYPHER_PARSER_H
22 #define CYPHER_PARSER_H
23
24 #include <stdlib.h>
25 #include <stdint.h>
26 #include <stdarg.h>
27 #include <stdbool.h>
28 #include <stdio.h>
29 #include <string.h>
30 #include <sys/types.h>
31 #include <sys/uio.h>
32
33 #if __GNUC__ > 3
34 #define __cypherlang_pure __attribute__((pure))
35 #define __cypherlang_malloc __attribute__((malloc))
36 #define __cypherlang_must_check __attribute__((warn_unused_result))
37 #define __cypherlang_format(string_index, first) \
38 __attribute__((format (printf, string_index, first)))
39 #else
40 #define __cypherlang_pure /*pure*/
41 #define __cypherlang_malloc /*malloc*/
42 #define __cypherlang_must_check /*must check*/
43 #define __cypherlang_format(string_index, first) /*format*/
44 #endif
45
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 #pragma GCC visibility push(default)
52
53
54 /*
55 * =====================================
56 * version
57 * =====================================
58 */
59
60 /* Compile time version details.
61 * For runtime version inspection, use libcypher_parser_version() instead.
62 */
63 #define CYPHER_PARSER_VERSION "@PACKAGE_VERSION@"
64 #define CYPHER_PARSER_MAJOR_VERSION @PACKAGE_MAJOR_VERSION@
65 #define CYPHER_PARSER_MINOR_VERSION @PACKAGE_MINOR_VERSION@
66 #define CYPHER_PARSER_PATCH_VERSION @PACKAGE_PATCH_VERSION@
67 #define CYPHER_PARSER_DEVELOPMENT_VERSION "@PACKAGE_DEVELOPMENT_VERSION@"
68
69 #define CYPHER_PARSER_VERSION_NUMBER \
70 ((CYPHER_PARSER_MAJOR_VERSION << 20) | \
71 (CYPHER_PARSER_MINOR_VERSION << 12) | \
72 (CYPHER_PARSER_PATCH_VERSION << 4) | @PACKAGE_STATUS_VERSION@)
73
74 /**
75 * The version string for libcypher-parser.
76 */
77 __cypherlang_pure
78 const char *libcypher_parser_version(void);
79
80
81 /*
82 * =====================================
83 * colorization
84 * =====================================
85 */
86
87 struct cypher_parser_colorization
88 {
89 const char *normal[2];
90 const char *error[2];
91 const char *error_token[2];
92 const char *error_message[2];
93 const char *ast_ordinal[2];
94 const char *ast_range[2];
95 const char *ast_indent[2];
96 const char *ast_type[2];
97 const char *ast_desc[2];
98 };
99
100 /** Colorization rules for uncolorized output. */
101 extern const struct cypher_parser_colorization *cypher_parser_no_colorization;
102 /** Colorization rules for ANSI terminal output. */
103 extern const struct cypher_parser_colorization *cypher_parser_ansi_colorization;
104
105
106 /*
107 * =====================================
108 * abstract syntax tree
109 * =====================================
110 */
111
112 /**
113 * An abstract syntax tree node.
114 */
115 typedef struct cypher_astnode cypher_astnode_t;
116
117 /**
118 * A cypher AST node type.
119 */
120 typedef uint8_t cypher_astnode_type_t;
121
122 /** Type for an AST statement node. */
123 extern const cypher_astnode_type_t CYPHER_AST_STATEMENT;
124 /** Type for an AST statement option node. */
125 extern const cypher_astnode_type_t CYPHER_AST_STATEMENT_OPTION;
126 /** Type for an AST `CYPHER` option node. */
127 extern const cypher_astnode_type_t CYPHER_AST_CYPHER_OPTION;
128 /** Type for an AST `CYPHER` option parameter node. */
129 extern const cypher_astnode_type_t CYPHER_AST_CYPHER_OPTION_PARAM;
130 /** Type for an AST `EXPLAIN` option node. */
131 extern const cypher_astnode_type_t CYPHER_AST_EXPLAIN_OPTION;
132 /** Type for an AST `PROFILE` option node. */
133 extern const cypher_astnode_type_t CYPHER_AST_PROFILE_OPTION;
134 /** Type for an AST schema command node. */
135 extern const cypher_astnode_type_t CYPHER_AST_SCHEMA_COMMAND;
136 /** Type for an AST `CREATE INDEX` node. */
137 extern const cypher_astnode_type_t CYPHER_AST_CREATE_NODE_PROP_INDEX;
138 /** Type for an AST `DROP INDEX` node. */
139 extern const cypher_astnode_type_t CYPHER_AST_DROP_NODE_PROP_INDEX;
140 /** Type for an AST create node property constraint node. */
141 extern const cypher_astnode_type_t CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT;
142 /** Type for an AST drop node property constraint node. */
143 extern const cypher_astnode_type_t CYPHER_AST_DROP_NODE_PROP_CONSTRAINT;
144 /** Type for an AST create rel property constraint node. */
145 extern const cypher_astnode_type_t CYPHER_AST_CREATE_REL_PROP_CONSTRAINT;
146 /** Type for an AST drop rel property constraint node. */
147 extern const cypher_astnode_type_t CYPHER_AST_DROP_REL_PROP_CONSTRAINT;
148 /** Type for an AST query node. */
149 extern const cypher_astnode_type_t CYPHER_AST_QUERY;
150 /** Type for an AST query option node. */
151 extern const cypher_astnode_type_t CYPHER_AST_QUERY_OPTION;
152 /** Type for an AST `USING PERIODIC COMMIT` clause node. */
153 extern const cypher_astnode_type_t CYPHER_AST_USING_PERIODIC_COMMIT;
154 /** Type for an AST query clause node. */
155 extern const cypher_astnode_type_t CYPHER_AST_QUERY_CLAUSE;
156 /** Type for an AST `LOAD CSV` clause node. */
157 extern const cypher_astnode_type_t CYPHER_AST_LOAD_CSV;
158 /** Type for an AST `START` clause node. */
159 extern const cypher_astnode_type_t CYPHER_AST_START;
160 /** Type for an AST start point node. */
161 extern const cypher_astnode_type_t CYPHER_AST_START_POINT;
162 /** Type for an AST node-index lookup node. */
163 extern const cypher_astnode_type_t CYPHER_AST_NODE_INDEX_LOOKUP;
164 /** Type for an AST node-index query node. */
165 extern const cypher_astnode_type_t CYPHER_AST_NODE_INDEX_QUERY;
166 /** Type for an AST node-by-id-lookup node. */
167 extern const cypher_astnode_type_t CYPHER_AST_NODE_ID_LOOKUP;
168 /** Type for an AST all-nodes-scan node. */
169 extern const cypher_astnode_type_t CYPHER_AST_ALL_NODES_SCAN;
170 /** Type for an AST rel-index lookup node. */
171 extern const cypher_astnode_type_t CYPHER_AST_REL_INDEX_LOOKUP;
172 /** Type for an AST rel-index query node. */
173 extern const cypher_astnode_type_t CYPHER_AST_REL_INDEX_QUERY;
174 /** Type for an AST rel-by-id-lookup node. */
175 extern const cypher_astnode_type_t CYPHER_AST_REL_ID_LOOKUP;
176 /** Type for an AST all-rels-scan node. */
177 extern const cypher_astnode_type_t CYPHER_AST_ALL_RELS_SCAN;
178 /** Type for an AST `MATCH` clause node. */
179 extern const cypher_astnode_type_t CYPHER_AST_MATCH;
180 /** Type for an AST match hint node. */
181 extern const cypher_astnode_type_t CYPHER_AST_MATCH_HINT;
182 /** Type for an AST `USING INDEX` hint node. */
183 extern const cypher_astnode_type_t CYPHER_AST_USING_INDEX;
184 /** Type for an AST `USING JOIN ON` hint node. */
185 extern const cypher_astnode_type_t CYPHER_AST_USING_JOIN;
186 /** Type for an AST `USING SCAN` hint node. */
187 extern const cypher_astnode_type_t CYPHER_AST_USING_SCAN;
188 /** Type for an AST `MERGE` clause node. */
189 extern const cypher_astnode_type_t CYPHER_AST_MERGE;
190 /** Type for an AST merge action node. */
191 extern const cypher_astnode_type_t CYPHER_AST_MERGE_ACTION;
192 /** Type for an AST `ON MATCH` action node. */
193 extern const cypher_astnode_type_t CYPHER_AST_ON_MATCH;
194 /** Type for an AST `ON CREATE` action node. */
195 extern const cypher_astnode_type_t CYPHER_AST_ON_CREATE;
196 /** Type for an AST `CREATE` clause node. */
197 extern const cypher_astnode_type_t CYPHER_AST_CREATE;
198 /** Type for an AST `SET` clause node. */
199 extern const cypher_astnode_type_t CYPHER_AST_SET;
200 /** Type for an AST set item node. */
201 extern const cypher_astnode_type_t CYPHER_AST_SET_ITEM;
202 /** Type for an AST set property node. */
203 extern const cypher_astnode_type_t CYPHER_AST_SET_PROPERTY;
204 /** Type for an AST set all properties node. */
205 extern const cypher_astnode_type_t CYPHER_AST_SET_ALL_PROPERTIES;
206 /** Type for an AST merge properties node. */
207 extern const cypher_astnode_type_t CYPHER_AST_MERGE_PROPERTIES;
208 /** Type for an AST set labels node. */
209 extern const cypher_astnode_type_t CYPHER_AST_SET_LABELS;
210 /** Type for an AST `DELETE` clause node. */
211 extern const cypher_astnode_type_t CYPHER_AST_DELETE;
212 /** Type for an AST `REMOVE` clause node. */
213 extern const cypher_astnode_type_t CYPHER_AST_REMOVE;
214 /** Type for an AST remove item node. */
215 extern const cypher_astnode_type_t CYPHER_AST_REMOVE_ITEM;
216 /** Type for an AST remove labels node. */
217 extern const cypher_astnode_type_t CYPHER_AST_REMOVE_LABELS;
218 /** Type for an AST remove property node. */
219 extern const cypher_astnode_type_t CYPHER_AST_REMOVE_PROPERTY;
220 /** Type for an AST `FOREACH` clause node. */
221 extern const cypher_astnode_type_t CYPHER_AST_FOREACH;
222 /** Type for an AST `WITH` clause node. */
223 extern const cypher_astnode_type_t CYPHER_AST_WITH;
224 /** Type for an AST `UNWIND` clause node. */
225 extern const cypher_astnode_type_t CYPHER_AST_UNWIND;
226 /** Type for an AST `CALL` clause node. */
227 extern const cypher_astnode_type_t CYPHER_AST_CALL;
228 /** Type for an AST `RETURN` clause node. */
229 extern const cypher_astnode_type_t CYPHER_AST_RETURN;
230 /** Type for an AST projection node. */
231 extern const cypher_astnode_type_t CYPHER_AST_PROJECTION;
232 /** Type for an AST `ORDER BY` node. */
233 extern const cypher_astnode_type_t CYPHER_AST_ORDER_BY;
234 /** Type for an AST sort item node. */
235 extern const cypher_astnode_type_t CYPHER_AST_SORT_ITEM;
236 /** Type for an AST `UNION` clause node. */
237 extern const cypher_astnode_type_t CYPHER_AST_UNION;
238 /** Type for an AST expression node. */
239 extern const cypher_astnode_type_t CYPHER_AST_EXPRESSION;
240 /** Type for an AST unary operator node. */
241 extern const cypher_astnode_type_t CYPHER_AST_UNARY_OPERATOR;
242 /** Type for an AST binary operator node. */
243 extern const cypher_astnode_type_t CYPHER_AST_BINARY_OPERATOR;
244 /** Type for an AST n-ary comparison operator node. */
245 extern const cypher_astnode_type_t CYPHER_AST_COMPARISON;
246 /** Type for an AST apply operator node. */
247 extern const cypher_astnode_type_t CYPHER_AST_APPLY_OPERATOR;
248 /** Type for an AST apply * operator node. */
249 extern const cypher_astnode_type_t CYPHER_AST_APPLY_ALL_OPERATOR;
250 /** Type for an AST property operator node. */
251 extern const cypher_astnode_type_t CYPHER_AST_PROPERTY_OPERATOR;
252 /** Type for an AST subscript operator node. */
253 extern const cypher_astnode_type_t CYPHER_AST_SUBSCRIPT_OPERATOR;
254 /** Type for an AST slice operator node. */
255 extern const cypher_astnode_type_t CYPHER_AST_SLICE_OPERATOR;
256 /** Type for an AST map projection operator node. */
257 extern const cypher_astnode_type_t CYPHER_AST_MAP_PROJECTION;
258 /** Type for an AST map projection selector node. */
259 extern const cypher_astnode_type_t CYPHER_AST_MAP_PROJECTION_SELECTOR;
260 /** Type for an AST map projection literal entry node. */
261 extern const cypher_astnode_type_t CYPHER_AST_MAP_PROJECTION_LITERAL;
262 /** Type for an AST map projection property entry node. */
263 extern const cypher_astnode_type_t CYPHER_AST_MAP_PROJECTION_PROPERTY;
264 /** Type for an AST map projection identifier entry node. */
265 extern const cypher_astnode_type_t CYPHER_AST_MAP_PROJECTION_IDENTIFIER;
266 /** Type for an AST map projection all properties entry node. */
267 extern const cypher_astnode_type_t CYPHER_AST_MAP_PROJECTION_ALL_PROPERTIES;
268 /** Type for an AST label check operator node. */
269 extern const cypher_astnode_type_t CYPHER_AST_LABELS_OPERATOR;
270 /** Type for an AST list comprehension node. */
271 extern const cypher_astnode_type_t CYPHER_AST_LIST_COMPREHENSION;
272 /** Type for an AST pattern comprehension node. */
273 extern const cypher_astnode_type_t CYPHER_AST_PATTERN_COMPREHENSION;
274 /** Type for an AST CASE expression node. */
275 extern const cypher_astnode_type_t CYPHER_AST_CASE;
276 /** Type for an AST filter expression node. */
277 extern const cypher_astnode_type_t CYPHER_AST_FILTER;
278 /** Type for an AST extract expression node. */
279 extern const cypher_astnode_type_t CYPHER_AST_EXTRACT;
280 /** Type for an AST reduce expression node. */
281 extern const cypher_astnode_type_t CYPHER_AST_REDUCE;
282 /** Type for an AST all predicate node. */
283 extern const cypher_astnode_type_t CYPHER_AST_ALL;
284 /** Type for an AST any predicate node. */
285 extern const cypher_astnode_type_t CYPHER_AST_ANY;
286 /** Type for an AST single predicate node. */
287 extern const cypher_astnode_type_t CYPHER_AST_SINGLE;
288 /** Type for an AST none predicate node. */
289 extern const cypher_astnode_type_t CYPHER_AST_NONE;
290 /** Type for an AST collection node. */
291 extern const cypher_astnode_type_t CYPHER_AST_COLLECTION;
292 /** Type for an AST literal map node. */
293 extern const cypher_astnode_type_t CYPHER_AST_MAP;
294 /** Type for an AST identifier node. */
295 extern const cypher_astnode_type_t CYPHER_AST_IDENTIFIER;
296 /** Type for an AST parameter node. */
297 extern const cypher_astnode_type_t CYPHER_AST_PARAMETER;
298 /** Type for an AST string literal node. */
299 extern const cypher_astnode_type_t CYPHER_AST_STRING;
300 /** Type for an AST integer literal node. */
301 extern const cypher_astnode_type_t CYPHER_AST_INTEGER;
302 /** Type for an AST float literal node. */
303 extern const cypher_astnode_type_t CYPHER_AST_FLOAT;
304 /** Type for an AST boolean literal node. */
305 extern const cypher_astnode_type_t CYPHER_AST_BOOLEAN;
306 /** Type for an AST TRUE literal node. */
307 extern const cypher_astnode_type_t CYPHER_AST_TRUE;
308 /** Type for an AST FALSE literal node. */
309 extern const cypher_astnode_type_t CYPHER_AST_FALSE;
310 /** Type for an AST NULL literal node. */
311 extern const cypher_astnode_type_t CYPHER_AST_NULL;
312 /** Type for an AST label node. */
313 extern const cypher_astnode_type_t CYPHER_AST_LABEL;
314 /** Type for an AST reltype node. */
315 extern const cypher_astnode_type_t CYPHER_AST_RELTYPE;
316 /** Type for an AST prop name node. */
317 extern const cypher_astnode_type_t CYPHER_AST_PROP_NAME;
318 /** Type for an AST function name node. */
319 extern const cypher_astnode_type_t CYPHER_AST_FUNCTION_NAME;
320 /** Type for an AST index name node. */
321 extern const cypher_astnode_type_t CYPHER_AST_INDEX_NAME;
322 /** Type for an AST procedure name node. */
323 extern const cypher_astnode_type_t CYPHER_AST_PROC_NAME;
324 /** Type for an AST pattern node. */
325 extern const cypher_astnode_type_t CYPHER_AST_PATTERN;
326 /** Type for an AST named pattern path node. */
327 extern const cypher_astnode_type_t CYPHER_AST_NAMED_PATH;
328 /** Type for an AST shortestPath node. */
329 extern const cypher_astnode_type_t CYPHER_AST_SHORTEST_PATH;
330 /** Type for an AST pattern path node. */
331 extern const cypher_astnode_type_t CYPHER_AST_PATTERN_PATH;
332 /** Type for an AST node pattern node. */
333 extern const cypher_astnode_type_t CYPHER_AST_NODE_PATTERN;
334 /** Type for an AST relationship pattern node. */
335 extern const cypher_astnode_type_t CYPHER_AST_REL_PATTERN;
336 /** Type for an AST range node. */
337 extern const cypher_astnode_type_t CYPHER_AST_RANGE;
338 /** Type for an AST command node. */
339 extern const cypher_astnode_type_t CYPHER_AST_COMMAND;
340 /** Type for an AST comment node. */
341 extern const cypher_astnode_type_t CYPHER_AST_COMMENT;
342 /** Type for an AST line comment node. */
343 extern const cypher_astnode_type_t CYPHER_AST_LINE_COMMENT;
344 /** Type for an AST block comment node. */
345 extern const cypher_astnode_type_t CYPHER_AST_BLOCK_COMMENT;
346 /** Type for an AST error node. */
347 extern const cypher_astnode_type_t CYPHER_AST_ERROR;
348
349 /**
350 * A cypher expression operator.
351 */
352 typedef struct cypher_operator cypher_operator_t;
353
354 /** The infix binary `OR` operator. */
355 extern const cypher_operator_t *CYPHER_OP_OR;
356 /** The infix binary `XOR` operator. */
357 extern const cypher_operator_t *CYPHER_OP_XOR;
358 /** The infix binary `AND` operator. */
359 extern const cypher_operator_t *CYPHER_OP_AND;
360 /** The prefix unary `NOT` operator. */
361 extern const cypher_operator_t *CYPHER_OP_NOT;
362 /** The infix binary `=` operator. */
363 extern const cypher_operator_t *CYPHER_OP_EQUAL;
364 /** The infix binary `<>` operator. */
365 extern const cypher_operator_t *CYPHER_OP_NEQUAL;
366 /** The n-ary `<` operator. */
367 extern const cypher_operator_t *CYPHER_OP_LT;
368 /** The n-ary `>` operator. */
369 extern const cypher_operator_t *CYPHER_OP_GT;
370 /** The n-ary `<=` operator. */
371 extern const cypher_operator_t *CYPHER_OP_LTE;
372 /** The n-ary `>=` operator. */
373 extern const cypher_operator_t *CYPHER_OP_GTE;
374 /** The infix binary `+` operator. */
375 extern const cypher_operator_t *CYPHER_OP_PLUS;
376 /** The infix binary `-` operator. */
377 extern const cypher_operator_t *CYPHER_OP_MINUS;
378 /** The infix binary `*` operator. */
379 extern const cypher_operator_t *CYPHER_OP_MULT;
380 /** The infix binary `/` operator. */
381 extern const cypher_operator_t *CYPHER_OP_DIV;
382 /** The infix binary `%` operator. */
383 extern const cypher_operator_t *CYPHER_OP_MOD;
384 /** The infix binary `^` operator. */
385 extern const cypher_operator_t *CYPHER_OP_POW;
386 /** The prefix unary `+` operator. */
387 extern const cypher_operator_t *CYPHER_OP_UNARY_PLUS;
388 /** The prefix unary `-` operator. */
389 extern const cypher_operator_t *CYPHER_OP_UNARY_MINUS;
390 /** The postfix binary subscript (`[exp]`) operator. */
391 extern const cypher_operator_t *CYPHER_OP_SUBSCRIPT;
392 /** The postfix binary map projection (`{exp}`) operator. */
393 extern const cypher_operator_t *CYPHER_OP_MAP_PROJECTION;
394 /** The infix binary `=~` operator. */
395 extern const cypher_operator_t *CYPHER_OP_REGEX;
396 /** The infix binary `IN` operator. */
397 extern const cypher_operator_t *CYPHER_OP_IN;
398 /** The infix binary `STARTS WITH` operator. */
399 extern const cypher_operator_t *CYPHER_OP_STARTS_WITH;
400 /** The infix binary `ENDS WITH` operator. */
401 extern const cypher_operator_t *CYPHER_OP_ENDS_WITH;
402 /** The infix binary `CONTAINS` operator. */
403 extern const cypher_operator_t *CYPHER_OP_CONTAINS;
404 /** The postfix unary `IS NULL` operator. */
405 extern const cypher_operator_t *CYPHER_OP_IS_NULL;
406 /** The postfix unary `IS NOT NULL` operator. */
407 extern const cypher_operator_t *CYPHER_OP_IS_NOT_NULL;
408 /** The infix binary property lookup (`l.r`) operator. */
409 extern const cypher_operator_t *CYPHER_OP_PROPERTY;
410 /** The n-ary label check (`l:r`) operator. */
411 extern const cypher_operator_t *CYPHER_OP_LABEL;
412
413 /**
414 * Get the type of an AST node.
415 *
416 * @param [node] The AST node.
417 * @return The type of the node.
418 */
419 __cypherlang_pure
420 cypher_astnode_type_t cypher_astnode_type(const cypher_astnode_t *node);
421
422 /**
423 * Check the type of an AST node.
424 *
425 * @param [node] The AST node.
426 * @param [type] The AST node type.
427 * @return `true` if the node is of the specified type and `false` otherwise.
428 */
429 __cypherlang_pure
430 bool cypher_astnode_instanceof(const cypher_astnode_t *node,
431 cypher_astnode_type_t type);
432
433 /**
434 * Get a string description of the AST node type.
435 *
436 * @param [type] The AST node type.
437 * @return A pointer to a null terminated string containing the type name.
438 */
439 __cypherlang_pure
440 const char *cypher_astnode_typestr(cypher_astnode_type_t type);
441
442 /**
443 * Get the number of children from an AST node.
444 *
445 * @param [node] The AST node.
446 * @return The number of children.
447 */
448 __cypherlang_pure
449 unsigned int cypher_astnode_nchildren(const cypher_astnode_t *node);
450
451 /**
452 * Get a child from an AST node.
453 *
454 * @param [node] The AST node.
455 * @param [index] The index of the child.
456 * @return A pointer to the child of the AST node, or `NULL` if there is no
457 * argument at the specified index.
458 */
459 __cypherlang_pure
460 const cypher_astnode_t *cypher_astnode_get_child(const cypher_astnode_t *node,
461 unsigned int index);
462
463 /**
464 * A position in the input.
465 */
466 struct cypher_input_position
467 {
468 unsigned int line;
469 unsigned int column;
470 size_t offset;
471 };
472
473 extern const struct cypher_input_position cypher_input_position_zero;
474
475 /**
476 * A range in the input.
477 */
478 struct cypher_input_range
479 {
480 struct cypher_input_position start;
481 struct cypher_input_position end;
482 };
483
484 /**
485 * Get the range of an AST node in the input.
486 *
487 * @param [node] The AST node.
488 * @return The range.
489 */
490 __cypherlang_pure
491 struct cypher_input_range cypher_astnode_range(const cypher_astnode_t *node);
492
493 /**
494 * The direction of a relationship pattern.
495 */
496 enum cypher_rel_direction
497 {
498 CYPHER_REL_INBOUND,
499 CYPHER_REL_OUTBOUND,
500 CYPHER_REL_BIDIRECTIONAL
501 };
502
503
504 /**
505 * Construct a `CYPHER_AST_STATEMENT` node.
506 *
507 * @param [options] Options for the statement, all of type
508 * `CYPHER_AST_STATEMENT_OPTION`.
509 * @param [noptions] The number of options (may be zero).
510 * @param [body] The body of the statement, which must be either an
511 * `CYPHER_AST_QUERY` or `CYPHER_AST_SCHEMA_COMMAND`.
512 * @param [children] The children of the node.
513 * @param [nchildren] The number of children.
514 * @param [range] The input range.
515 * @return An AST node, or NULL if an error occurs (errno will be set).
516 */
517 __cypherlang_must_check
518 cypher_astnode_t *cypher_ast_statement(cypher_astnode_t * const *options,
519 unsigned int noptions, const cypher_astnode_t *body,
520 cypher_astnode_t **children, unsigned int nchildren,
521 struct cypher_input_range range);
522
523 /**
524 * Get the number of options in a `CYPHER_AST_STATEMENT` node.
525 *
526 * If the node is not an instance of `CYPHER_AST_STATEMENT` then the result will
527 * be undefined.
528 *
529 * @param [node] The AST node.
530 * @return The number of options.
531 */
532 __cypherlang_pure
533 unsigned int cypher_ast_statement_noptions(const cypher_astnode_t *node);
534
535 /**
536 * Get an option of a `CYPHER_AST_STATEMENT` node.
537 *
538 * If the node is not an instance of `CYPHER_AST_STATEMENT` then the result will
539 * be undefined.
540 *
541 * @param [node] The AST node.
542 * @param [index] The index of the option.
543 * @return A `CYPHER_AST_STATEMENT_OPTION` node, or null.
544 */
545 __cypherlang_pure
546 const cypher_astnode_t *cypher_ast_statement_get_option(
547 const cypher_astnode_t *node, unsigned int index);
548
549 /**
550 * Get the body of a `CYPHER_AST_STATEMENT` node.
551 *
552 * If the node is not an instance of `CYPHER_AST_STATEMENT` then the result will
553 * be undefined.
554 *
555 * @param [node] The AST node.
556 * @return A `CYPHER_AST_QUERY` or `CYPHER_AST_SCHEMA_COMMAND` node.
557 */
558 __cypherlang_pure
559 const cypher_astnode_t *cypher_ast_statement_get_body(
560 const cypher_astnode_t *node);
561
562
563 /**
564 * Construct a `CYPHER_AST_CYPHER_OPTION` node.
565 *
566 * The node will also be an instance of `CYPHER_AST_STATEMENT_OPTION`.
567 *
568 * @param [version] A version node of type `CYPHER_AST_STRING`, or
569 * null.
570 * @param [params] Parameters for the option, all of type
571 * `CYPHER_AST_CYPHER_OPTION_PARAM`.
572 * @param [nparams] The number of parameters (may be zero).
573 * @param [children] The children of the node.
574 * @param [nchildren] The number of children.
575 * @param [range] The input range.
576 * @return An AST node, or NULL if an error occurs (errno will be set).
577 */
578 __cypherlang_must_check
579 cypher_astnode_t *cypher_ast_cypher_option(const cypher_astnode_t *version,
580 cypher_astnode_t * const *params, unsigned int nparams,
581 cypher_astnode_t **children, unsigned int nchildren,
582 struct cypher_input_range range);
583
584 /**
585 * Get the version of a `CYPHER_AST_CYPHER_OPTION` node.
586 *
587 * If the node is not an instance of `CYPHER_AST_CYPHER_OPTION` then the result
588 * will be undefined.
589 *
590 * @param [node] The AST node.
591 * @return A `CYPHER_AST_STRING` node, or null.
592 */
593 __cypherlang_pure
594 const cypher_astnode_t *cypher_ast_cypher_option_get_version(
595 const cypher_astnode_t *node);
596
597 /**
598 * Get the number of parameters in a `CYPHER_AST_CYPHER_OPTION` node.
599 *
600 * If the node is not an instance of `CYPHER_AST_CYPHER_OPTION` then the result
601 * will be undefined.
602 *
603 * @param [node] The AST node.
604 * @return The number of parameters.
605 */
606 __cypherlang_pure
607 unsigned int cypher_ast_cypher_option_nparams(const cypher_astnode_t *node);
608
609 /**
610 * Get an option of a `CYPHER_AST_CYPHER_OPTION` node.
611 *
612 * If the node is not an instance of `CYPHER_AST_CYPHER_OPTION` then the result
613 * will be undefined.
614 *
615 * @param [node] The AST node.
616 * @param [index] The index of the parameter.
617 * @return A `CYPHER_AST_CYPHER_OPTION_PARAM` node, or null if no parameter
618 * is at the specified index.
619 */
620 __cypherlang_pure
621 const cypher_astnode_t *cypher_ast_cypher_option_get_param(
622 const cypher_astnode_t *node, unsigned int index);
623
624
625 /**
626 * Construct a `CYPHER_AST_CYPHER_OPTION_PARAM` node.
627 *
628 * @param [name] A parameter name node, of type `CYPHER_AST_STRING`.
629 * @param [value] A parameter value node, of type `CYPHER_AST_STRING`.
630 * @param [children] The children of the node.
631 * @param [nchildren] The number of children.
632 * @param [range] The input range.
633 * @return An AST node, or NULL if an error occurs (errno will be set).
634 */
635 __cypherlang_must_check
636 cypher_astnode_t *cypher_ast_cypher_option_param(const cypher_astnode_t *name,
637 const cypher_astnode_t *value, cypher_astnode_t **children,
638 unsigned int nchildren, struct cypher_input_range range);
639
640 /**
641 * Get an name of a `CYPHER_AST_CYPHER_OPTION_PARAM` node.
642 *
643 * If the node is not an instance of `CYPHER_AST_CYPHER_OPTION_PARAM` then the
644 * result will be undefined.
645 *
646 * @param [node] The AST node.
647 * @return A `CYPHER_AST_STRING` node.
648 */
649 __cypherlang_pure
650 const cypher_astnode_t *cypher_ast_cypher_option_param_get_name(
651 const cypher_astnode_t *node);
652
653 /**
654 * Get an value of a `CYPHER_AST_CYPHER_OPTION_PARAM` node.
655 *
656 * If the node is not an instance of `CYPHER_AST_CYPHER_OPTION_PARAM` then the
657 * result will be undefined.
658 *
659 * @param [node] The AST node.
660 * @return A `CYPHER_AST_STRING` node.
661 */
662 __cypherlang_pure
663 const cypher_astnode_t *cypher_ast_cypher_option_param_get_value(
664 const cypher_astnode_t *node);
665
666
667 /**
668 * Construct a `CYPHER_AST_EXPLAIN_OPTION` node.
669 *
670 * The node will also be an instance of `CYPHER_AST_STATEMENT_OPTION`.
671 *
672 * @param [children] The children of the node.
673 * @param [nchildren] The number of children.
674 * @param [range] The input range.
675 * @return An AST node, or NULL if an error occurs (errno will be set).
676 */
677 __cypherlang_must_check
678 cypher_astnode_t *cypher_ast_explain_option(cypher_astnode_t **children,
679 unsigned int nchildren, struct cypher_input_range range);
680
681
682 /**
683 * Construct a `CYPHER_AST_PROFILE_OPTION` node.
684 *
685 * The node will also be an instance of `CYPHER_AST_STATEMENT_OPTION`.
686 *
687 * @param [children] The children of the node.
688 * @param [nchildren] The number of children.
689 * @param [range] The input range.
690 * @return An AST node, or NULL if an error occurs (errno will be set).
691 */
692 __cypherlang_must_check
693 cypher_astnode_t *cypher_ast_profile_option(cypher_astnode_t **children,
694 unsigned int nchildren, struct cypher_input_range range);
695
696
697 /**
698 * Construct a `CYPHER_AST_CREATE_NODE_PROP_INDEX` node.
699 *
700 * The node will also be an instance of `CYPHER_AST_SCHEMA_COMMAND`.
701 *
702 * @param [label] A label node, of type `CYPHER_AST_LABEL`.
703 * @param [prop_name] A property name node, of type `CYPHER_AST_PROP_NAME`.
704 * @param [children] The children of the node.
705 * @param [nchildren] The number of children.
706 * @param [range] The input range.
707 * @return An AST node, or NULL if an error occurs (errno will be set).
708 */
709 __cypherlang_must_check
710 cypher_astnode_t *cypher_ast_create_node_prop_index(
711 const cypher_astnode_t *label, const cypher_astnode_t *prop_name,
712 cypher_astnode_t **children, unsigned int nchildren,
713 struct cypher_input_range range);
714
715 /**
716 * Get the label of a `CYPHER_AST_CREATE_NODE_PROP_INDEX` node.
717 *
718 * If the node is not an instance of `CYPHER_AST_CREATE_NODE_PROP_INDEX` then
719 * the result will be undefined.
720 *
721 * @param [node] The AST node.
722 * @return A `CYPHER_AST_LABEL` node.
723 */
724 __cypherlang_pure
725 const cypher_astnode_t *cypher_ast_create_node_prop_index_get_label(
726 const cypher_astnode_t *node);
727
728 /**
729 * Get the property name of a `CYPHER_AST_CREATE_NODE_PROP_INDEX` node.
730 *
731 * If the node is not an instance of `CYPHER_AST_CREATE_NODE_PROP_INDEX` then
732 * the result will be undefined.
733 *
734 * @param [node] The AST node.
735 * @return A `CYPHER_AST_PROP_NAME` node.
736 */
737 __cypherlang_pure
738 const cypher_astnode_t *cypher_ast_create_node_prop_index_get_prop_name(
739 const cypher_astnode_t *node);
740
741
742 /**
743 * Construct a `CYPHER_AST_DROP_NODE_PROP_INDEX` node.
744 *
745 * The node will also be an instance of `CYPHER_AST_SCHEMA_COMMAND`.
746 *
747 * @param [label] A label node, of type `CYPHER_AST_LABEL`.
748 * @param [prop_name] A property name node, of type `CYPHER_AST_PROP_NAME`.
749 * @param [children] The children of the node.
750 * @param [nchildren] The number of children.
751 * @param [range] The input range.
752 * @return An AST node, or NULL if an error occurs (errno will be set).
753 */
754 __cypherlang_must_check
755 cypher_astnode_t *cypher_ast_drop_node_prop_index(const cypher_astnode_t *label,
756 const cypher_astnode_t *prop_name, cypher_astnode_t **children,
757 unsigned int nchildren, struct cypher_input_range range);
758
759 /**
760 * Get the label of a `CYPHER_AST_DROP_NODE_PROP_INDEX` node.
761 *
762 * If the node is not an instance of `CYPHER_AST_DROP_NODE_PROP_INDEX` then the
763 * result will be undefined.
764 *
765 * @param [node] The AST node.
766 * @return A `CYPHER_AST_LABEL` node.
767 */
768 __cypherlang_pure
769 const cypher_astnode_t *cypher_ast_drop_node_prop_index_get_label(
770 const cypher_astnode_t *node);
771
772 /**
773 * Get the property name of a `CYPHER_AST_DROP_NODE_PROP_INDEX` node.
774 *
775 * If the node is not an instance of `CYPHER_AST_DROP_NODE_PROP_INDEX` then the
776 * result will be undefined.
777 *
778 * @param [node] The AST node.
779 * @return A `CYPHER_AST_PROP_NAME` node.
780 */
781 __cypherlang_pure
782 const cypher_astnode_t *cypher_ast_drop_node_prop_index_get_prop_name(
783 const cypher_astnode_t *node);
784
785
786 /**
787 * Construct a `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT` node.
788 *
789 * The node will also be an instance of `CYPHER_AST_SCHEMA_COMMAND`.
790 *
791 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
792 * @param [label] A `CYPHER_AST_LABEL` node.
793 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
794 * @param [unique] `true` if the constraint is unique, and `false` otherwise.
795 * @param [children] The children of the node.
796 * @param [nchildren] The number of children.
797 * @param [range] The input range.
798 * @return An AST node, or NULL if an error occurs (errno will be set).
799 */
800 __cypherlang_must_check
801 cypher_astnode_t *cypher_ast_create_node_prop_constraint(
802 const cypher_astnode_t *identifier, const cypher_astnode_t *label,
803 const cypher_astnode_t *expression, bool unique,
804 cypher_astnode_t **children, unsigned int nchildren,
805 struct cypher_input_range range);
806
807 /**
808 * Get the identifier of a `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT` node.
809 *
810 * If the node is not an instance of `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT`
811 * then the result will be undefined.
812 *
813 * @param [node] The AST node.
814 * @return A `CYPHER_AST_IDENTIFIER` node.
815 */
816 __cypherlang_pure
817 const cypher_astnode_t *cypher_ast_create_node_prop_constraint_get_identifier(
818 const cypher_astnode_t *node);
819
820 /**
821 * Get the label of a `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT` node.
822 *
823 * If the node is not an instance of `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT`
824 * then the result will be undefined.
825 *
826 * @param [node] The AST node.
827 * @return A `CYPHER_AST_LABEL` node.
828 */
829 __cypherlang_pure
830 const cypher_astnode_t *cypher_ast_create_node_prop_constraint_get_label(
831 const cypher_astnode_t *node);
832
833 /**
834 * Get the expression of a `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT` node.
835 *
836 * If the node is not an instance of `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT`
837 * then the result will be undefined.
838 *
839 * @param [node] The AST node.
840 * @return A `CYPHER_AST_EXPRESSION` node.
841 */
842 __cypherlang_pure
843 const cypher_astnode_t *cypher_ast_create_node_prop_constraint_get_expression(
844 const cypher_astnode_t *node);
845
846 /**
847 * Check if the constraint of a `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT` node is unique.
848 *
849 * If the node is not an instance of `CYPHER_AST_CREATE_NODE_PROP_CONSTRAINT`
850 * then the result will be undefined.
851 *
852 * @param [node] The AST node.
853 * @return `true` if the constraint is unique, and `false` otherwise.
854 */
855 bool cypher_ast_create_node_prop_constraint_is_unique(
856 const cypher_astnode_t *node);
857
858
859 /**
860 * Construct a `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT` node.
861 *
862 * The node will also be an instance of `CYPHER_AST_SCHEMA_COMMAND`.
863 *
864 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
865 * @param [label] A `CYPHER_AST_LABEL` node.
866 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
867 * @param [unique] `true` if the constraint is unique, and `false` otherwise.
868 * @param [children] The children of the node.
869 * @param [nchildren] The number of children.
870 * @param [range] The input range.
871 * @return An AST node, or NULL if an error occurs (errno will be set).
872 */
873 __cypherlang_must_check
874 cypher_astnode_t *cypher_ast_drop_node_prop_constraint(
875 const cypher_astnode_t *identifier, const cypher_astnode_t *label,
876 const cypher_astnode_t *expression, bool unique,
877 cypher_astnode_t **children, unsigned int nchildren,
878 struct cypher_input_range range);
879
880 /**
881 * Get the identifier of a `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT` node.
882 *
883 * If the node is not an instance of `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT`
884 * then the result will be undefined.
885 *
886 * @param [node] The AST node.
887 * @return A `CYPHER_AST_IDENTIFIER` node.
888 */
889 __cypherlang_pure
890 const cypher_astnode_t *cypher_ast_drop_node_prop_constraint_get_identifier(
891 const cypher_astnode_t *node);
892
893 /**
894 * Get the label of a `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT` node.
895 *
896 * If the node is not an instance of `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT`
897 * then the result will be undefined.
898 *
899 * @param [node] The AST node.
900 * @return A `CYPHER_AST_LABEL` node.
901 */
902 __cypherlang_pure
903 const cypher_astnode_t *cypher_ast_drop_node_prop_constraint_get_label(
904 const cypher_astnode_t *node);
905
906 /**
907 * Get the expression of a `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT` node.
908 *
909 * If the node is not an instance of `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT`
910 * then the result will be undefined.
911 *
912 * @param [node] The AST node.
913 * @return A `CYPHER_AST_EXPRESSION` node.
914 */
915 __cypherlang_pure
916 const cypher_astnode_t *cypher_ast_drop_node_prop_constraint_get_expression(
917 const cypher_astnode_t *node);
918
919 /**
920 * Check if the constraint of a `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT` node is unique.
921 *
922 * If the node is not an instance of `CYPHER_AST_DROP_NODE_PROP_CONSTRAINT`
923 * then the result will be undefined.
924 *
925 * @param [node] The AST node.
926 * @return `true` if the constraint is unique, and `false` otherwise.
927 */
928 bool cypher_ast_drop_node_prop_constraint_is_unique(
929 const cypher_astnode_t *node);
930
931
932 /**
933 * Construct a `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT` node.
934 *
935 * The node will also be an instance of `CYPHER_AST_SCHEMA_COMMAND`.
936 *
937 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
938 * @param [label] A `CYPHER_AST_LABEL` node.
939 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
940 * @param [unique] `true` if the constraint is unique, and `false` otherwise.
941 * @param [children] The children of the node.
942 * @param [nchildren] The number of children.
943 * @param [range] The input range.
944 * @return An AST node, or NULL if an error occurs (errno will be set).
945 */
946 __cypherlang_must_check
947 cypher_astnode_t *cypher_ast_create_rel_prop_constraint(
948 const cypher_astnode_t *identifier, const cypher_astnode_t *label,
949 const cypher_astnode_t *expression, bool unique,
950 cypher_astnode_t **children, unsigned int nchildren,
951 struct cypher_input_range range);
952
953 /**
954 * Get the identifier of a `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT` node.
955 *
956 * If the node is not an instance of `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT`
957 * then the result will be undefined.
958 *
959 * @param [node] The AST node.
960 * @return A `CYPHER_AST_IDENTIFIER` node.
961 */
962 __cypherlang_pure
963 const cypher_astnode_t *cypher_ast_create_rel_prop_constraint_get_identifier(
964 const cypher_astnode_t *node);
965
966 /**
967 * Get the relationship type of a `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT` node.
968 *
969 * If the node is not an instance of `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT`
970 * then the result will be undefined.
971 *
972 * @param [node] The AST node.
973 * @return A `CYPHER_AST_RELTYPE` node.
974 */
975 __cypherlang_pure
976 const cypher_astnode_t *cypher_ast_create_rel_prop_constraint_get_reltype(
977 const cypher_astnode_t *node);
978
979 /**
980 * Get the expression of a `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT` node.
981 *
982 * If the node is not an instance of `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT`
983 * then the result will be undefined.
984 *
985 * @param [node] The AST node.
986 * @return A `CYPHER_AST_EXPRESSION` node.
987 */
988 __cypherlang_pure
989 const cypher_astnode_t *cypher_ast_create_rel_prop_constraint_get_expression(
990 const cypher_astnode_t *node);
991
992 /**
993 * Check if the constraint of a `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT` node is unique.
994 *
995 * If the node is not an instance of `CYPHER_AST_CREATE_REL_PROP_CONSTRAINT`
996 * then the result will be undefined.
997 *
998 * @param [node] The AST node.
999 * @return `true` if the constraint is unique, and `false` otherwise.
1000 */
1001 bool cypher_ast_create_rel_prop_constraint_is_unique(
1002 const cypher_astnode_t *node);
1003
1004
1005 /**
1006 * Construct a `CYPHER_AST_DROP_REL_PROP_CONSTRAINT` node.
1007 *
1008 * The node will also be an instance of `CYPHER_AST_SCHEMA_COMMAND`.
1009 *
1010 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1011 * @param [label] A `CYPHER_AST_LABEL` node.
1012 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
1013 * @param [unique] `true` if the constraint is unique, and `false` otherwise.
1014 * @param [children] The children of the node.
1015 * @param [nchildren] The number of children.
1016 * @param [range] The input range.
1017 * @return An AST node, or NULL if an error occurs (errno will be set).
1018 */
1019 __cypherlang_must_check
1020 cypher_astnode_t *cypher_ast_drop_rel_prop_constraint(
1021 const cypher_astnode_t *identifier, const cypher_astnode_t *label,
1022 const cypher_astnode_t *expression, bool unique,
1023 cypher_astnode_t **children, unsigned int nchildren,
1024 struct cypher_input_range range);
1025
1026 /**
1027 * Get the identifier of a `CYPHER_AST_DROP_REL_PROP_CONSTRAINT` node.
1028 *
1029 * If the node is not an instance of `CYPHER_AST_DROP_REL_PROP_CONSTRAINT`
1030 * then the result will be undefined.
1031 *
1032 * @param [node] The AST node.
1033 * @return A `CYPHER_AST_IDENTIFIER` node.
1034 */
1035 __cypherlang_pure
1036 const cypher_astnode_t *cypher_ast_drop_rel_prop_constraint_get_identifier(
1037 const cypher_astnode_t *node);
1038
1039 /**
1040 * Get the relationship type of a `CYPHER_AST_DROP_REL_PROP_CONSTRAINT` node.
1041 *
1042 * If the node is not an instance of `CYPHER_AST_DROP_REL_PROP_CONSTRAINT`
1043 * then the result will be undefined.
1044 *
1045 * @param [node] The AST node.
1046 * @return A `CYPHER_AST_RELTYPE` node.
1047 */
1048 __cypherlang_pure
1049 const cypher_astnode_t *cypher_ast_drop_rel_prop_constraint_get_reltype(
1050 const cypher_astnode_t *node);
1051
1052 /**
1053 * Get the expression of a `CYPHER_AST_DROP_REL_PROP_CONSTRAINT` node.
1054 *
1055 * If the node is not an instance of `CYPHER_AST_DROP_REL_PROP_CONSTRAINT`
1056 * then the result will be undefined.
1057 *
1058 * @param [node] The AST node.
1059 * @return A `CYPHER_AST_EXPRESSION` node.
1060 */
1061 __cypherlang_pure
1062 const cypher_astnode_t *cypher_ast_drop_rel_prop_constraint_get_expression(
1063 const cypher_astnode_t *node);
1064
1065 /**
1066 * Check if the constraint of a `CYPHER_AST_DROP_REL_PROP_CONSTRAINT` node is unique.
1067 *
1068 * If the node is not an instance of `CYPHER_AST_DROP_REL_PROP_CONSTRAINT`
1069 * then the result will be undefined.
1070 *
1071 * @param [node] The AST node.
1072 * @return `true` if the constraint is unique, and `false` otherwise.
1073 */
1074 bool cypher_ast_drop_rel_prop_constraint_is_unique(
1075 const cypher_astnode_t *node);
1076
1077
1078 /**
1079 * Construct a `CYPHER_AST_QUERY` node.
1080 *
1081 * @param [options] Options for the query, all of type
1082 * `CYPHER_AST_QUERY_OPTION`.
1083 * @param [noptions] The number of options (may be zero).
1084 * @param [clauses] Clauses for the query, all of type
1085 * `CYPHER_AST_QUERY_CLAUSE`.
1086 * @param [nclauses] The number of clauses.
1087 * @param [children] The children of the node.
1088 * @param [nchildren] The number of children.
1089 * @param [range] The input range.
1090 * @return An AST node, or NULL if an error occurs (errno will be set).
1091 */
1092 __cypherlang_must_check
1093 cypher_astnode_t *cypher_ast_query(cypher_astnode_t * const *options,
1094 unsigned int noptions, cypher_astnode_t * const *clauses,
1095 unsigned int nclauses, cypher_astnode_t **children,
1096 unsigned int nchildren, struct cypher_input_range range);
1097
1098 /**
1099 * Get the number of options in a `CYPHER_AST_QUERY` node.
1100 *
1101 * If the node is not an instance of `CYPHER_AST_QUERY` then the result will
1102 * be undefined.
1103 *
1104 * @param [node] The AST node.
1105 * @return The number of options.
1106 */
1107 __cypherlang_pure
1108 unsigned int cypher_ast_query_noptions(const cypher_astnode_t *node);
1109
1110 /**
1111 * Get an option of a `CYPHER_AST_QUERY` node.
1112 *
1113 * If the node is not an instance of `CYPHER_AST_QUERY` then the result will
1114 * be undefined.
1115 *
1116 * @param [node] The AST node.
1117 * @param [index] The index of the option.
1118 * @return A `CYPHER_AST_QUERY_OPTION` node, or null.
1119 */
1120 __cypherlang_pure
1121 const cypher_astnode_t *cypher_ast_query_get_option(
1122 const cypher_astnode_t *node, unsigned int index);
1123
1124 /**
1125 * Get the number of clauses in a `CYPHER_AST_QUERY` node.
1126 *
1127 * If the node is not an instance of `CYPHER_AST_QUERY` then the result will
1128 * be undefined.
1129 *
1130 * @param [node] The AST node.
1131 * @return The number of clauses.
1132 */
1133 __cypherlang_pure
1134 unsigned int cypher_ast_query_nclauses(const cypher_astnode_t *node);
1135
1136 /**
1137 * Get a clause of a `CYPHER_AST_QUERY` node.
1138 *
1139 * If the node is not an instance of `CYPHER_AST_QUERY` then the result will
1140 * be undefined.
1141 *
1142 * @param [node] The AST node.
1143 * @param [index] The index of the clause.
1144 * @return A `CYPHER_AST_QUERY_OPTION` node, or null.
1145 */
1146 __cypherlang_pure
1147 const cypher_astnode_t *cypher_ast_query_get_clause(
1148 const cypher_astnode_t *node, unsigned int index);
1149
1150
1151 /**
1152 * Construct a `CYPHER_AST_USING_PERIODIC_COMMIT` node.
1153 *
1154 * The node will also be an instance of `CYPHER_AST_QUERY_OPTION`.
1155 *
1156 * @param [limit] A `CYPHER_AST_INTEGER`, or null.
1157 * @param [children] The children of the node.
1158 * @param [nchildren] The number of children.
1159 * @param [range] The input range.
1160 * @return An AST node, or NULL if an error occurs (errno will be set).
1161 */
1162 __cypherlang_must_check
1163 cypher_astnode_t *cypher_ast_using_periodic_commit(
1164 const cypher_astnode_t *limit, cypher_astnode_t **children,
1165 unsigned int nchildren, struct cypher_input_range range);
1166
1167 /**
1168 * Get the limit of a `CYPHER_AST_USING_PERIODIC_COMMIT` node.
1169 *
1170 * If the node is not an instance of `CYPHER_AST_USING_PERIODIC_COMMIT` then
1171 * the result will be undefined.
1172 *
1173 * @param [node] The AST node.
1174 * @return A `CYPHER_AST_INTEGER` node, or null.
1175 */
1176 __cypherlang_pure
1177 const cypher_astnode_t *cypher_ast_using_periodic_commit_get_limit(
1178 const cypher_astnode_t *node);
1179
1180
1181 /**
1182 * Construct a `CYPHER_AST_LOAD_CSV` node.
1183 *
1184 * The node will also be an instance of `CYPHER_AST_QUERY_CLAUSE`.
1185 *
1186 * @param [with_headers] `true` if the `WITH HEADERS` option is enabled, and
1187 * `false` otherwise.
1188 * @param [url] A `CYPHER_AST_EXPRESSION` node.
1189 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1190 * @param [field_terminator] A `CYPHER_AST_STRING` node, or null.
1191 * @param [children] The children of the node.
1192 * @param [nchildren] The number of children.
1193 * @param [range] The input range.
1194 * @return An AST node, or NULL if an error occurs (errno will be set).
1195 */
1196 __cypherlang_must_check
1197 cypher_astnode_t *cypher_ast_load_csv(bool with_headers,
1198 const cypher_astnode_t *url, const cypher_astnode_t *identifier,
1199 const cypher_astnode_t *field_terminator, cypher_astnode_t **children,
1200 unsigned int nchildren, struct cypher_input_range range);
1201
1202 /**
1203 * Check the with_headers value of a `CYPHER_AST_LOAD_CSV` node.
1204 *
1205 * If the node is not an instance of `CYPHER_AST_LOAD_CSV` then the result will
1206 * be undefined.
1207 *
1208 * @param [node] The AST node.
1209 * @return `true` if the `WITH HEADERS` option is enabled,
1210 * and `false` otherwise.
1211 */
1212 __cypherlang_pure
1213 bool cypher_ast_load_csv_has_with_headers(const cypher_astnode_t *node);
1214
1215 /**
1216 * Get the url of a `CYPHER_AST_LOAD_CSV` node.
1217 *
1218 * If the node is not an instance of `CYPHER_AST_LOAD_CSV` then the result will
1219 * be undefined.
1220 *
1221 * @param [node] The AST node.
1222 * @return A `CYPHER_AST_EXPRESSION` node.
1223 */
1224 __cypherlang_pure
1225 const cypher_astnode_t *cypher_ast_load_csv_get_url(
1226 const cypher_astnode_t *node);
1227
1228 /**
1229 * Get the identifier of a `CYPHER_AST_LOAD_CSV` node.
1230 *
1231 * If the node is not an instance of `CYPHER_AST_LOAD_CSV` then the result will
1232 * be undefined.
1233 *
1234 * @param [node] The AST node.
1235 * @return A `CYPHER_AST_IDENTIFIER` node.
1236 */
1237 __cypherlang_pure
1238 const cypher_astnode_t *cypher_ast_load_csv_get_identifier(
1239 const cypher_astnode_t *node);
1240
1241 /**
1242 * Get the field terminator of a `CYPHER_AST_LOAD_CSV` node.
1243 *
1244 * If the node is not an instance of `CYPHER_AST_LOAD_CSV` then the result will
1245 * be undefined.
1246 *
1247 * @param [node] The AST node.
1248 * @return A `CYPHER_AST_STRING` node, or null.
1249 */
1250 __cypherlang_pure
1251 const cypher_astnode_t *cypher_ast_load_csv_get_field_terminator(
1252 const cypher_astnode_t *node);
1253
1254
1255 /**
1256 * Construct a `CYPHER_AST_START` node.
1257 *
1258 * The node will also be an instance of `CYPHER_AST_QUERY_CLAUSE`.
1259 *
1260 * @param [points] Start points for the statement, all of type
1261 * `CYPHER_AST_START_POINT`.
1262 * @param [npoints] The number of start points.
1263 * @param [predicate] A `CYPHER_AST_EXPRESSION`, or null.
1264 * @param [children] The children of the node.
1265 * @param [nchildren] The number of children.
1266 * @param [range] The input range.
1267 * @return An AST node, or NULL if an error occurs (errno will be set).
1268 */
1269 __cypherlang_must_check
1270 cypher_astnode_t *cypher_ast_start(cypher_astnode_t * const *points,
1271 unsigned int npoints, const cypher_astnode_t *predicate,
1272 cypher_astnode_t **children, unsigned int nchildren,
1273 struct cypher_input_range range);
1274
1275 /**
1276 * Get the number of start points in a `CYPHER_AST_START` node.
1277 *
1278 * If the node is not an instance of `CYPHER_AST_START` then the result will
1279 * be undefined.
1280 *
1281 * @param [node] The AST node.
1282 * @return The number of start points.
1283 */
1284 __cypherlang_pure
1285 unsigned int cypher_ast_start_npoints(const cypher_astnode_t *node);
1286
1287 /**
1288 * Get a start point of a `CYPHER_AST_START` node.
1289 *
1290 * If the node is not an instance of `CYPHER_AST_START` then the result will
1291 * be undefined.
1292 *
1293 * @param [node] The AST node.
1294 * @param [index] The index of the start point.
1295 * @return A `CYPHER_AST_QUERY_OPTION` node, or null.
1296 */
1297 __cypherlang_pure
1298 const cypher_astnode_t *cypher_ast_start_get_point(
1299 const cypher_astnode_t *node, unsigned int index);
1300
1301 /**
1302 * Get the predicate of a `CYPHER_AST_START` node.
1303 *
1304 * If the node is not an instance of `CYPHER_AST_START` then the result will
1305 * be undefined.
1306 *
1307 * @param [node] The AST node.
1308 * @return A `CYPHER_AST_EXPRESSION` node, or null.
1309 */
1310 __cypherlang_pure
1311 const cypher_astnode_t *cypher_ast_start_get_predicate(
1312 const cypher_astnode_t *node);
1313
1314
1315 /**
1316 * Construct a `CYPHER_AST_NODE_INDEX_LOOKUP` node.
1317 *
1318 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1319 *
1320 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1321 * @param [index_name] A `CYPHER_AST_INDEX_NAME` node.
1322 * @param [prop_name] A `CYPHER_AST_PROP_NAME` node.
1323 * @param [lookup] A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1324 * @param [children] The children of the node.
1325 * @param [nchildren] The number of children.
1326 * @param [range] The input range.
1327 * @return An AST node, or NULL if an error occurs (errno will be set).
1328 */
1329 __cypherlang_must_check
1330 cypher_astnode_t *cypher_ast_node_index_lookup(
1331 const cypher_astnode_t *identifier, const cypher_astnode_t *index_name,
1332 const cypher_astnode_t *prop_name, const cypher_astnode_t *lookup,
1333 cypher_astnode_t **children, unsigned int nchildren,
1334 struct cypher_input_range range);
1335
1336 /**
1337 * Get the identifier of a `CYPHER_AST_NODE_INDEX_LOOKUP` node.
1338 *
1339 * If the node is not an instance of `CYPHER_AST_NODE_INDEX_LOOKUP` then the
1340 * result will be undefined.
1341 *
1342 * @param [node] The AST node.
1343 * @return A `CYPHER_AST_IDENTIFIER` node.
1344 */
1345 __cypherlang_pure
1346 const cypher_astnode_t *cypher_ast_node_index_lookup_get_identifier(
1347 const cypher_astnode_t *node);
1348
1349 /**
1350 * Get the index name of a `CYPHER_AST_NODE_INDEX_LOOKUP` node.
1351 *
1352 * If the node is not an instance of `CYPHER_AST_NODE_INDEX_LOOKUP` then the
1353 * result will be undefined.
1354 *
1355 * @param [node] The AST node.
1356 * @return A `CYPHER_AST_INDEX_NAME` node.
1357 */
1358 __cypherlang_pure
1359 const cypher_astnode_t *cypher_ast_node_index_lookup_get_index_name(
1360 const cypher_astnode_t *node);
1361
1362 /**
1363 * Get the prop name of a `CYPHER_AST_NODE_INDEX_LOOKUP` node.
1364 *
1365 * If the node is not an instance of `CYPHER_AST_NODE_INDEX_LOOKUP` then the
1366 * result will be undefined.
1367 *
1368 * @param [node] The AST node.
1369 * @return A `CYPHER_AST_PROP_NAME` node.
1370 */
1371 __cypherlang_pure
1372 const cypher_astnode_t *cypher_ast_node_index_lookup_get_prop_name(
1373 const cypher_astnode_t *node);
1374
1375 /**
1376 * Get the lookup of a `CYPHER_AST_NODE_INDEX_LOOKUP` node.
1377 *
1378 * If the node is not an instance of `CYPHER_AST_NODE_INDEX_LOOKUP` then the
1379 * result will be undefined.
1380 *
1381 * @param [node] The AST node.
1382 * @return A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1383 */
1384 __cypherlang_pure
1385 const cypher_astnode_t *cypher_ast_node_index_lookup_get_lookup(
1386 const cypher_astnode_t *node);
1387
1388
1389 /**
1390 * Construct a `CYPHER_AST_NODE_INDEX_QUERY` node.
1391 *
1392 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1393 *
1394 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1395 * @param [index_name] A `CYPHER_AST_INDEX_NAME` node.
1396 * @param [query] A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1397 * @param [children] The children of the node.
1398 * @param [nchildren] The number of children.
1399 * @param [range] The input range.
1400 * @return An AST node, or NULL if an error occurs (errno will be set).
1401 */
1402 __cypherlang_must_check
1403 cypher_astnode_t *cypher_ast_node_index_query(
1404 const cypher_astnode_t *identifier, const cypher_astnode_t *index_name,
1405 const cypher_astnode_t *query, cypher_astnode_t **children,
1406 unsigned int nchildren, struct cypher_input_range range);
1407
1408 /**
1409 * Get the identifier of a `CYPHER_AST_NODE_INDEX_QUERY` node.
1410 *
1411 * If the node is not an instance of `CYPHER_AST_NODE_INDEX_QUERY` then the
1412 * result will be undefined.
1413 *
1414 * @param [node] The AST node.
1415 * @return A `CYPHER_AST_IDENTIFIER` node.
1416 */
1417 __cypherlang_pure
1418 const cypher_astnode_t *cypher_ast_node_index_query_get_identifier(
1419 const cypher_astnode_t *node);
1420
1421 /**
1422 * Get the index name of a `CYPHER_AST_NODE_INDEX_QUERY` node.
1423 *
1424 * If the node is not an instance of `CYPHER_AST_NODE_INDEX_QUERY` then the
1425 * result will be undefined.
1426 *
1427 * @param [node] The AST node.
1428 * @return A `CYPHER_AST_INDEX_NAME` node.
1429 */
1430 __cypherlang_pure
1431 const cypher_astnode_t *cypher_ast_node_index_query_get_index_name(
1432 const cypher_astnode_t *node);
1433
1434 /**
1435 * Get the query of a `CYPHER_AST_NODE_INDEX_QUERY` node.
1436 *
1437 * If the node is not an instance of `CYPHER_AST_NODE_INDEX_QUERY` then the
1438 * result will be undefined.
1439 *
1440 * @param [node] The AST node.
1441 * @return A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1442 */
1443 __cypherlang_pure
1444 const cypher_astnode_t *cypher_ast_node_index_query_get_query(
1445 const cypher_astnode_t *node);
1446
1447
1448 /**
1449 * Construct a `CYPHER_AST_NODE_ID_LOOKUP` node.
1450 *
1451 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1452 *
1453 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1454 * @param [ids] Node IDs for lookup, all of type `CYPHER_AST_INTEGER`.
1455 * @param [nids] The number of node IDs.
1456 * @param [children] The children of the node.
1457 * @param [nchildren] The number of children.
1458 * @param [range] The input range.
1459 * @return An AST node, or NULL if an error occurs (errno will be set).
1460 */
1461 __cypherlang_must_check
1462 cypher_astnode_t *cypher_ast_node_id_lookup(const cypher_astnode_t *identifier,
1463 cypher_astnode_t * const *ids, unsigned int nids,
1464 cypher_astnode_t **children, unsigned int nchildren,
1465 struct cypher_input_range range);
1466
1467 /**
1468 * Get the identifier of a `CYPHER_AST_NODE_ID_LOOKUP` node.
1469 *
1470 * If the node is not an instance of `CYPHER_AST_NODE_ID_LOOKUP` then the
1471 * result will be undefined.
1472 *
1473 * @param [node] The AST node.
1474 * @return A `CYPHER_AST_IDENTIFIER` node.
1475 */
1476 __cypherlang_pure
1477 const cypher_astnode_t *cypher_ast_node_id_lookup_get_identifier(
1478 const cypher_astnode_t *node);
1479
1480 /**
1481 * Get the number of ids in a `CYPHER_AST_NODE_ID_LOOKUP` node.
1482 *
1483 * If the node is not an instance of `CYPHER_AST_NODE_ID_LOOKUP` then the
1484 * result will be undefined.
1485 *
1486 * @param [node] The AST node.
1487 * @return The number of ids.
1488 */
1489 __cypherlang_pure
1490 unsigned int cypher_ast_node_id_lookup_nids(const cypher_astnode_t *node);
1491
1492 /**
1493 * Get an id of a `CYPHER_AST_NODE_ID_LOOKUP` node.
1494 *
1495 * If the node is not an instance of `CYPHER_AST_NODE_ID_LOOKUP` then the
1496 * result will be undefined.
1497 *
1498 * @param [node] The AST node.
1499 * @param [index] The index of the id.
1500 * @return A `CYPHER_AST_INTEGER` node, or null.
1501 */
1502 __cypherlang_pure
1503 const cypher_astnode_t *cypher_ast_node_id_lookup_get_id(
1504 const cypher_astnode_t *node, unsigned int index);
1505
1506
1507 /**
1508 * Construct a `CYPHER_AST_ALL_NODES_SCAN` node.
1509 *
1510 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1511 *
1512 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1513 * @param [children] The children of the node.
1514 * @param [nchildren] The number of children.
1515 * @param [range] The input range.
1516 * @return An AST node, or NULL if an error occurs (errno will be set).
1517 */
1518 __cypherlang_must_check
1519 cypher_astnode_t *cypher_ast_all_nodes_scan(const cypher_astnode_t *identifier,
1520 cypher_astnode_t **children, unsigned int nchildren,
1521 struct cypher_input_range range);
1522
1523 /**
1524 * Get the identifier of a `CYPHER_AST_ALL_NODES_SCAN` node.
1525 *
1526 * If the node is not an instance of `CYPHER_AST_ALL_NODES_SCAN` then the
1527 * result will be undefined.
1528 *
1529 * @param [node] The AST node.
1530 * @return A `CYPHER_AST_IDENTIFIER` node.
1531 */
1532 __cypherlang_pure
1533 const cypher_astnode_t *cypher_ast_all_nodes_scan_get_identifier(
1534 const cypher_astnode_t *node);
1535
1536
1537 /**
1538 * Construct a `CYPHER_AST_REL_INDEX_LOOKUP` node.
1539 *
1540 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1541 *
1542 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1543 * @param [index_name] A `CYPHER_AST_INDEX_NAME` node.
1544 * @param [prop_name] A `CYPHER_AST_PROP_NAME` node.
1545 * @param [lookup] A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1546 * @param [children] The children of the node.
1547 * @param [nchildren] The number of children.
1548 * @param [range] The input range.
1549 * @return An AST node, or NULL if an error occurs (errno will be set).
1550 */
1551 __cypherlang_must_check
1552 cypher_astnode_t *cypher_ast_rel_index_lookup(
1553 const cypher_astnode_t *identifier, const cypher_astnode_t *index_name,
1554 const cypher_astnode_t *prop_name, const cypher_astnode_t *lookup,
1555 cypher_astnode_t **children, unsigned int nchildren,
1556 struct cypher_input_range range);
1557
1558
1559 /**
1560 * Get the identifier of a `CYPHER_AST_REL_INDEX_LOOKUP` node.
1561 *
1562 * If the node is not an instance of `CYPHER_AST_REL_INDEX_LOOKUP` then the
1563 * result will be undefined.
1564 *
1565 * @param [node] The AST node.
1566 * @return A `CYPHER_AST_IDENTIFIER` node.
1567 */
1568 __cypherlang_pure
1569 const cypher_astnode_t *cypher_ast_rel_index_lookup_get_identifier(
1570 const cypher_astnode_t *node);
1571
1572 /**
1573 * Get the index name of a `CYPHER_AST_REL_INDEX_LOOKUP` node.
1574 *
1575 * If the node is not an instance of `CYPHER_AST_REL_INDEX_LOOKUP` then the
1576 * result will be undefined.
1577 *
1578 * @param [node] The AST node.
1579 * @return A `CYPHER_AST_INDEX_NAME` node.
1580 */
1581 __cypherlang_pure
1582 const cypher_astnode_t *cypher_ast_rel_index_lookup_get_index_name(
1583 const cypher_astnode_t *node);
1584
1585 /**
1586 * Get the prop name of a `CYPHER_AST_REL_INDEX_LOOKUP` node.
1587 *
1588 * If the node is not an instance of `CYPHER_AST_REL_INDEX_LOOKUP` then the
1589 * result will be undefined.
1590 *
1591 * @param [node] The AST node.
1592 * @return A `CYPHER_AST_PROP_NAME` node.
1593 */
1594 __cypherlang_pure
1595 const cypher_astnode_t *cypher_ast_rel_index_lookup_get_prop_name(
1596 const cypher_astnode_t *node);
1597
1598 /**
1599 * Get the lookup of a `CYPHER_AST_REL_INDEX_LOOKUP` node.
1600 *
1601 * If the node is not an instance of `CYPHER_AST_REL_INDEX_LOOKUP` then the
1602 * result will be undefined.
1603 *
1604 * @param [node] The AST node.
1605 * @return A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1606 */
1607 __cypherlang_pure
1608 const cypher_astnode_t *cypher_ast_rel_index_lookup_get_lookup(
1609 const cypher_astnode_t *node);
1610
1611
1612 /**
1613 * Construct a `CYPHER_AST_REL_INDEX_QUERY` node.
1614 *
1615 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1616 *
1617 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1618 * @param [index_name] A `CYPHER_AST_INDEX_NAME` node.
1619 * @param [query] A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1620 * @param [children] The children of the node.
1621 * @param [nchildren] The number of children.
1622 * @param [range] The input range.
1623 * @return An AST node, or NULL if an error occurs (errno will be set).
1624 */
1625 __cypherlang_must_check
1626 cypher_astnode_t *cypher_ast_rel_index_query(
1627 const cypher_astnode_t *identifier, const cypher_astnode_t *index_name,
1628 const cypher_astnode_t *query, cypher_astnode_t **children,
1629 unsigned int nchildren, struct cypher_input_range range);
1630
1631 /**
1632 * Get the identifier of a `CYPHER_AST_REL_INDEX_QUERY` node.
1633 *
1634 * If the node is not an instance of `CYPHER_AST_REL_INDEX_QUERY` then the
1635 * result will be undefined.
1636 *
1637 * @param [node] The AST node.
1638 * @return A `CYPHER_AST_IDENTIFIER` node.
1639 */
1640 __cypherlang_pure
1641 const cypher_astnode_t *cypher_ast_rel_index_query_get_identifier(
1642 const cypher_astnode_t *node);
1643
1644 /**
1645 * Get the index name of a `CYPHER_AST_REL_INDEX_QUERY` node.
1646 *
1647 * If the node is not an instance of `CYPHER_AST_REL_INDEX_QUERY` then the
1648 * result will be undefined.
1649 *
1650 * @param [node] The AST node.
1651 * @return A `CYPHER_AST_INDEX_NAME` node.
1652 */
1653 __cypherlang_pure
1654 const cypher_astnode_t *cypher_ast_rel_index_query_get_index_name(
1655 const cypher_astnode_t *node);
1656
1657 /**
1658 * Get the query of a `CYPHER_AST_REL_INDEX_QUERY` node.
1659 *
1660 * If the node is not an instance of `CYPHER_AST_REL_INDEX_QUERY` then the
1661 * result will be undefined.
1662 *
1663 * @param [node] The AST node.
1664 * @return A `CYPHER_AST_STRING` or `CYPHER_AST_PARAMETER` node.
1665 */
1666 __cypherlang_pure
1667 const cypher_astnode_t *cypher_ast_rel_index_query_get_query(
1668 const cypher_astnode_t *node);
1669
1670
1671 /**
1672 * Construct a `CYPHER_AST_REL_ID_LOOKUP` node.
1673 *
1674 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1675 *
1676 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1677 * @param [ids] Node IDs for lookup, all of type `CYPHER_AST_INTEGER`.
1678 * @param [nids] The number of node IDs.
1679 * @param [children] The children of the node.
1680 * @param [nchildren] The number of children.
1681 * @param [range] The input range.
1682 * @return An AST node, or NULL if an error occurs (errno will be set).
1683 */
1684 __cypherlang_must_check
1685 cypher_astnode_t *cypher_ast_rel_id_lookup(const cypher_astnode_t *identifier,
1686 cypher_astnode_t * const *ids, unsigned int nids,
1687 cypher_astnode_t **children, unsigned int nchildren,
1688 struct cypher_input_range range);
1689
1690
1691 /**
1692 * Get the identifier of a `CYPHER_AST_REL_ID_LOOKUP` node.
1693 *
1694 * If the node is not an instance of `CYPHER_AST_REL_ID_LOOKUP` then the
1695 * result will be undefined.
1696 *
1697 * @param [node] The AST node.
1698 * @return A `CYPHER_AST_IDENTIFIER` node.
1699 */
1700 __cypherlang_pure
1701 const cypher_astnode_t *cypher_ast_rel_id_lookup_get_identifier(
1702 const cypher_astnode_t *node);
1703
1704 /**
1705 * Get the number of ids in a `CYPHER_AST_REL_ID_LOOKUP` node.
1706 *
1707 * If the node is not an instance of `CYPHER_AST_REL_ID_LOOKUP` then the
1708 * result will be undefined.
1709 *
1710 * @param [node] The AST node.
1711 * @return The number of ids.
1712 */
1713 __cypherlang_pure
1714 unsigned int cypher_ast_rel_id_lookup_nids(const cypher_astnode_t *node);
1715
1716 /**
1717 * Get an id of a `CYPHER_AST_REL_ID_LOOKUP` node.
1718 *
1719 * If the node is not an instance of `CYPHER_AST_REL_ID_LOOKUP` then the
1720 * result will be undefined.
1721 *
1722 * @param [node] The AST node.
1723 * @param [index] The index of the id.
1724 * @return A `CYPHER_AST_INTEGER` node, or null.
1725 */
1726 __cypherlang_pure
1727 const cypher_astnode_t *cypher_ast_rel_id_lookup_get_id(
1728 const cypher_astnode_t *node, unsigned int index);
1729
1730
1731 /**
1732 * Construct a `CYPHER_AST_ALL_RELS_SCAN` node.
1733 *
1734 * The node will also be an instance of `CYPHER_AST_START_POINT`.
1735 *
1736 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1737 * @param [children] The children of the node.
1738 * @param [nchildren] The number of children.
1739 * @param [range] The input range.
1740 * @return An AST node, or NULL if an error occurs (errno will be set).
1741 */
1742 __cypherlang_must_check
1743 cypher_astnode_t *cypher_ast_all_rels_scan(const cypher_astnode_t *identifier,
1744 cypher_astnode_t **children, unsigned int nchildren,
1745 struct cypher_input_range range);
1746
1747 /**
1748 * Get the identifier of a `CYPHER_AST_ALL_RELS_SCAN` node.
1749 *
1750 * If the node is not an instance of `CYPHER_AST_ALL_RELS_SCAN` then the
1751 * result will be undefined.
1752 *
1753 * @param [node] The AST node.
1754 * @return A `CYPHER_AST_IDENTIFIER` node.
1755 */
1756 __cypherlang_pure
1757 const cypher_astnode_t *cypher_ast_all_rels_scan_get_identifier(
1758 const cypher_astnode_t *node);
1759
1760
1761 /**
1762 * Construct a `CYPHER_AST_MATCH` node.
1763 *
1764 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
1765 *
1766 * @param [optional] `true` if the node represents an `OPTIONAL MATCH`, and
1767 * `false` otherwise.
1768 * @param [pattern] A `CYPHER_AST_PATTERN` node.
1769 * @param [hints] Hints for lookup, all of type `CYPHER_AST_MATCH_HINT`.
1770 * @param [nhints] The number of match hints.
1771 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
1772 * @param [children] The children of the node.
1773 * @param [nchildren] The number of children.
1774 * @param [range] The input range.
1775 * @return An AST node, or NULL if an error occurs (errno will be set).
1776 */
1777 __cypherlang_must_check
1778 cypher_astnode_t *cypher_ast_match(bool optional,
1779 const cypher_astnode_t *pattern, cypher_astnode_t * const *hints,
1780 unsigned int nhints, const cypher_astnode_t *predicate,
1781 cypher_astnode_t **children, unsigned int nchildren,
1782 struct cypher_input_range range);
1783
1784 /**
1785 * Check if the optional value of a `CYPHER_AST_MATCH` node is set.
1786 *
1787 * If the node is not an instance of `CYPHER_AST_MATCH` then the result will be
1788 * undefined.
1789 *
1790 * @param [node] The AST node.
1791 * @return `true` if the `OPTIONAL MATCH` option is enabled,
1792 * and `false` otherwise.
1793 */
1794 __cypherlang_pure
1795 bool cypher_ast_match_is_optional(const cypher_astnode_t *node);
1796
1797 /**
1798 * Get the pattern of a `CYPHER_AST_MATCH` node.
1799 *
1800 * If the node is not an instance of `CYPHER_AST_MATCH` then the result will be
1801 * undefined.
1802 *
1803 * @param [node] The AST node.
1804 * @return A `CYPHER_AST_PATTERN` node.
1805 */
1806 __cypherlang_pure
1807 const cypher_astnode_t *cypher_ast_match_get_pattern(
1808 const cypher_astnode_t *node);
1809
1810 /**
1811 * Get the number of hints in a `CYPHER_AST_MATCH` node.
1812 *
1813 * If the node is not an instance of `CYPHER_AST_MATCH` then the result will be
1814 * undefined.
1815 *
1816 * @param [node] The AST node.
1817 * @return The number of hints.
1818 */
1819 __cypherlang_pure
1820 unsigned int cypher_ast_match_nhints(const cypher_astnode_t *node);
1821
1822 /**
1823 * Get a hint from a `CYPHER_AST_MATCH` node.
1824 *
1825 * If the node is not an instance of `CYPHER_AST_MATCH` then the result will be
1826 * undefined.
1827 *
1828 * @param [node] The AST node.
1829 * @param [index] The index of the hint.
1830 * @return A `CYPHER_AST_MATCH_HINT` node, or null.
1831 */
1832 __cypherlang_pure
1833 const cypher_astnode_t *cypher_ast_match_get_hint(
1834 const cypher_astnode_t *node, unsigned int index);
1835
1836 /**
1837 * Get the predicate of a `CYPHER_AST_PREDICATE` node.
1838 *
1839 * If the node is not an instance of `CYPHER_AST_PREDICATE` then the result
1840 * will be undefined.
1841 *
1842 * @param [node] The AST node.
1843 * @return A `CYPHER_AST_PREDICATE` node, or null.
1844 */
1845 __cypherlang_pure
1846 const cypher_astnode_t *cypher_ast_match_get_predicate(
1847 const cypher_astnode_t *node);
1848
1849
1850 /**
1851 * Construct a `CYPHER_AST_USING_INDEX` node.
1852 *
1853 * The node will also be an instance of `CYPHER_AST_MATCH_HINT`.
1854 *
1855 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1856 * @param [label] A `CYPHER_AST_LABEL` node.
1857 * @param [prop_name] A `CYPHER_AST_PROP_NAME` node.
1858 * @param [children] The children of the node.
1859 * @param [nchildren] The number of children.
1860 * @param [range] The input range.
1861 * @return An AST node, or NULL if an error occurs (errno will be set).
1862 */
1863 __cypherlang_must_check
1864 cypher_astnode_t *cypher_ast_using_index(const cypher_astnode_t *identifier,
1865 const cypher_astnode_t *label, const cypher_astnode_t *prop_name,
1866 cypher_astnode_t **children, unsigned int nchildren,
1867 struct cypher_input_range range);
1868
1869 /**
1870 * Get the identifer of a `CYPHER_AST_USING_INDEX` node.
1871 *
1872 * If the node is not an instance of `CYPHER_AST_USING_INDEX` then the result
1873 * will be undefined.
1874 *
1875 * @param [node] The AST node.
1876 * @return A `CYPHER_AST_IDENTIFIER` node.
1877 */
1878 __cypherlang_pure
1879 const cypher_astnode_t *cypher_ast_using_index_get_identifier(
1880 const cypher_astnode_t *node);
1881
1882 /**
1883 * Get the label of a `CYPHER_AST_USING_INDEX` node.
1884 *
1885 * If the node is not an instance of `CYPHER_AST_USING_INDEX` then the result
1886 * will be undefined.
1887 *
1888 * @param [node] The AST node.
1889 * @return A `CYPHER_AST_IDENTIFIER` node.
1890 */
1891 __cypherlang_pure
1892 const cypher_astnode_t *cypher_ast_using_index_get_label(
1893 const cypher_astnode_t *node);
1894
1895 /**
1896 * Get the label of a `CYPHER_AST_USING_INDEX` node.
1897 *
1898 * If the node is not an instance of `CYPHER_AST_USING_INDEX` then the result
1899 * will be undefined.
1900 *
1901 * @param [node] The AST node.
1902 * @return A `CYPHER_AST_PROP_NAME` node.
1903 */
1904 __cypherlang_pure
1905 const cypher_astnode_t *cypher_ast_using_index_get_prop_name(
1906 const cypher_astnode_t *node);
1907
1908
1909 /**
1910 * Construct a `CYPHER_AST_USING_JOIN` node.
1911 *
1912 * The node will also be an instance of `CYPHER_AST_MATCH_HINT`.
1913 *
1914 * @param [identifiers] Identifiers for the hint, all of type
1915 * `CYPHER_AST_IDENTIFIER`.
1916 * @param [nidentifiers] The number of identifiers
1917 * @param [children] The children of the node.
1918 * @param [nchildren] The number of children.
1919 * @param [range] The input range.
1920 * @return An AST node, or NULL if an error occurs (errno will be set).
1921 */
1922 __cypherlang_must_check
1923 cypher_astnode_t *cypher_ast_using_join(
1924 cypher_astnode_t * const *identifiers, unsigned int nidentifiers,
1925 cypher_astnode_t **children, unsigned int nchildren,
1926 struct cypher_input_range range);
1927
1928 /**
1929 * Get the number of identifiers in a `CYPHER_AST_USING_JOIN` node.
1930 *
1931 * If the node is not an instance of `CYPHER_AST_USING_JOIN` then the result
1932 * will be undefined.
1933 *
1934 * @param [node] The AST node.
1935 * @return The number of identifiers.
1936 */
1937 __cypherlang_pure
1938 unsigned int cypher_ast_using_join_nidentifiers(const cypher_astnode_t *node);
1939
1940 /**
1941 * Get a identifier from a `CYPHER_AST_USING_JOIN` node.
1942 *
1943 * If the node is not an instance of `CYPHER_AST_USING_JOIN` then the result
1944 * will be undefined.
1945 *
1946 * @param [node] The AST node.
1947 * @param [index] The index of the identifier.
1948 * @return A `CYPHER_AST_IDENTIFIER` node, or null.
1949 */
1950 __cypherlang_pure
1951 const cypher_astnode_t *cypher_ast_using_join_get_identifier(
1952 const cypher_astnode_t *node, unsigned int index);
1953
1954
1955 /**
1956 * Construct a `CYPHER_AST_USING_SCAN` node.
1957 *
1958 * The node will also be an instance of `CYPHER_AST_MATCH_HINT`.
1959 *
1960 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
1961 * @param [label] A `CYPHER_AST_LABEL` node.
1962 * @param [children] The children of the node.
1963 * @param [nchildren] The number of children.
1964 * @param [range] The input range.
1965 * @return An AST node, or NULL if an error occurs (errno will be set).
1966 */
1967 __cypherlang_must_check
1968 cypher_astnode_t *cypher_ast_using_scan(const cypher_astnode_t *identifier,
1969 const cypher_astnode_t *label, cypher_astnode_t **children,
1970 unsigned int nchildren, struct cypher_input_range range);
1971
1972 /**
1973 * Get the identifer of a `CYPHER_AST_USING_SCAN` node.
1974 *
1975 * If the node is not an instance of `CYPHER_AST_USING_SCAN` then the result
1976 * will be undefined.
1977 *
1978 * @param [node] The AST node.
1979 * @return A `CYPHER_AST_IDENTIFIER` node.
1980 */
1981 __cypherlang_pure
1982 const cypher_astnode_t *cypher_ast_using_scan_get_identifier(
1983 const cypher_astnode_t *node);
1984
1985 /**
1986 * Get the label of a `CYPHER_AST_USING_SCAN` node.
1987 *
1988 * If the node is not an instance of `CYPHER_AST_USING_SCAN` then the result
1989 * will be undefined.
1990 *
1991 * @param [node] The AST node.
1992 * @return A `CYPHER_AST_IDENTIFIER` node.
1993 */
1994 __cypherlang_pure
1995 const cypher_astnode_t *cypher_ast_using_scan_get_label(
1996 const cypher_astnode_t *node);
1997
1998
1999 /**
2000 * Construct a `CYPHER_AST_MERGE` node.
2001 *
2002 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2003 *
2004 * @param [path] A `CYPHER_AST_PATTERN_PATH` node.
2005 * @param [actions] Actions for merge, all of type `CYPHER_AST_MERGE_ACTION`.
2006 * @param [nactions] The number of match actions.
2007 * @param [children] The children of the node.
2008 * @param [nchildren] The number of children.
2009 * @param [range] The input range.
2010 * @return An AST node, or NULL if an error occurs (errno will be set).
2011 */
2012 __cypherlang_must_check
2013 cypher_astnode_t *cypher_ast_merge(const cypher_astnode_t *path,
2014 cypher_astnode_t * const *actions, unsigned int nactions,
2015 cypher_astnode_t **children, unsigned int nchildren,
2016 struct cypher_input_range range);
2017
2018 /**
2019 * Get the pattern path of a `CYPHER_AST_MERGE` node.
2020 *
2021 * If the node is not an instance of `CYPHER_AST_MERGE` then the result will be
2022 * undefined.
2023 *
2024 * @param [node] The AST node.
2025 * @return A `CYPHER_AST_PATTERN_PATH` node.
2026 */
2027 __cypherlang_pure
2028 const cypher_astnode_t *cypher_ast_merge_get_pattern_path(
2029 const cypher_astnode_t *node);
2030
2031 /**
2032 * Get the number of actions in a `CYPHER_AST_MERGE` node.
2033 *
2034 * If the node is not an instance of `CYPHER_AST_MERGE` then the result will be
2035 * undefined.
2036 *
2037 * @param [node] The AST node.
2038 * @return The number of actions.
2039 */
2040 __cypherlang_pure
2041 unsigned int cypher_ast_merge_nactions(const cypher_astnode_t *node);
2042
2043 /**
2044 * Get an action from a `CYPHER_AST_MERGE` node.
2045 *
2046 * If the node is not an instance of `CYPHER_AST_MERGE` then the result will be
2047 * undefined.
2048 *
2049 * @param [node] The AST node.
2050 * @param [index] The index of the action.
2051 * @return A `CYPHER_AST_MERGE_HINT` node, or null.
2052 */
2053 __cypherlang_pure
2054 const cypher_astnode_t *cypher_ast_merge_get_action(
2055 const cypher_astnode_t *node, unsigned int index);
2056
2057
2058 /**
2059 * Construct a `CYPHER_AST_ON_MATCH` node.
2060 *
2061 * The node will also be an instance of `CYPHER_AST_MERGE_ACTION`.
2062 *
2063 * @param [items] Items for `ON MATCH`, all of type `CYPHER_AST_SET_ITEM`.
2064 * @param [nitems] The number of `ON MATCH` items.
2065 * @param [children] The children of the node.
2066 * @param [nchildren] The number of children.
2067 * @param [range] The input range.
2068 * @return An AST node, or NULL if an error occurs (errno will be set).
2069 */
2070 __cypherlang_must_check
2071 cypher_astnode_t *cypher_ast_on_match(cypher_astnode_t * const *items,
2072 unsigned int nitems, cypher_astnode_t **children,
2073 unsigned int nchildren, struct cypher_input_range range);
2074
2075 /**
2076 * Get the number of items in a `CYPHER_AST_ON_MATCH` node.
2077 *
2078 * If the node is not an instance of `CYPHER_AST_ON_MATCH` then the result will
2079 * be undefined.
2080 *
2081 * @param [node] The AST node.
2082 * @return The number of items.
2083 */
2084 __cypherlang_pure
2085 unsigned int cypher_ast_on_match_nitems(const cypher_astnode_t *node);
2086
2087 /**
2088 * Get an item from a `CYPHER_AST_ON_MATCH` node.
2089 *
2090 * If the node is not an instance of `CYPHER_AST_ON_MATCH` then the result will
2091 * be undefined.
2092 *
2093 * @param [node] The AST node.
2094 * @param [index] The index of the action.
2095 * @return A `CYPHER_AST_SET_ITEM` node, or null.
2096 */
2097 __cypherlang_pure
2098 const cypher_astnode_t *cypher_ast_on_match_get_item(
2099 const cypher_astnode_t *node, unsigned int index);
2100
2101
2102 /**
2103 * Construct a `CYPHER_AST_ON_CREATE` node.
2104 *
2105 * The node will also be an instance of `CYPHER_AST_MERGE_ACTION`.
2106 *
2107 * @param [items] Items for `ON CREATE`, all of type `CYPHER_AST_SET_ITEM`.
2108 * @param [nitems] The number of `ON CREATE` items.
2109 * @param [children] The children of the node.
2110 * @param [nchildren] The number of children.
2111 * @param [range] The input range.
2112 * @return An AST node, or NULL if an error occurs (errno will be set).
2113 */
2114 __cypherlang_must_check
2115 cypher_astnode_t *cypher_ast_on_create(cypher_astnode_t * const *items,
2116 unsigned int nitems, cypher_astnode_t **children,
2117 unsigned int nchildren, struct cypher_input_range range);
2118
2119 /**
2120 * Get the number of items in a `CYPHER_AST_ON_CREATE` node.
2121 *
2122 * If the node is not an instance of `CYPHER_AST_ON_CREATE` then the result
2123 * will be undefined.
2124 *
2125 * @param [node] The AST node.
2126 * @return The number of items.
2127 */
2128 __cypherlang_pure
2129 unsigned int cypher_ast_on_create_nitems(const cypher_astnode_t *node);
2130
2131 /**
2132 * Get an item from a `CYPHER_AST_ON_CREATE` node.
2133 *
2134 * If the node is not an instance of `CYPHER_AST_ON_CREATE` then the result
2135 * will be undefined.
2136 *
2137 * @param [node] The AST node.
2138 * @param [index] The index of the action.
2139 * @return A `CYPHER_AST_SET_ITEM` node, or null.
2140 */
2141 __cypherlang_pure
2142 const cypher_astnode_t *cypher_ast_on_create_get_item(
2143 const cypher_astnode_t *node, unsigned int index);
2144
2145
2146 /**
2147 * Construct a `CYPHER_AST_CREATE` node.
2148 *
2149 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2150 *
2151 * @param [unique] `true` if the create is unique, `false` otherwise.
2152 * @param [pattern] A `CYPHER_AST_PATTERN` node.
2153 * @param [children] The children of the node.
2154 * @param [nchildren] The number of children.
2155 * @param [range] The input range.
2156 * @return An AST node, or NULL if an error occurs (errno will be set).
2157 */
2158 __cypherlang_must_check
2159 cypher_astnode_t *cypher_ast_create(bool unique,
2160 const cypher_astnode_t *pattern, cypher_astnode_t **children,
2161 unsigned int nchildren, struct cypher_input_range range);
2162
2163 /**
2164 * Check if the unique value of a `CYPHER_AST_CREATE` node is set.
2165 *
2166 * If the node is not an instance of `CYPHER_AST_CREATE` then the result will
2167 * be undefined.
2168 *
2169 * @param [node] The AST node.
2170 * @return `true` if the `UNIQUE` option is enabled, and `false` otherwise.
2171 */
2172 __cypherlang_pure
2173 bool cypher_ast_create_is_unique(const cypher_astnode_t *node);
2174
2175 /**
2176 * Get the pattern of a `CYPHER_AST_CREATE` node.
2177 *
2178 * If the node is not an instance of `CYPHER_AST_CREATE` then the result will
2179 * be undefined.
2180 *
2181 * @param [node] The AST node.
2182 * @return A `CYPHER_AST_PATTERN` node.
2183 */
2184 __cypherlang_pure
2185 const cypher_astnode_t *cypher_ast_create_get_pattern(
2186 const cypher_astnode_t *node);
2187
2188
2189 /**
2190 * Construct a `CYPHER_AST_SET` node.
2191 *
2192 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2193 *
2194 * @param [items] Items for `SET`, all of type `CYPHER_AST_SET_ITEM`.
2195 * @param [nitems] The number of `SET` items.
2196 * @param [children] The children of the node.
2197 * @param [nchildren] The number of children.
2198 * @param [range] The input range.
2199 * @return An AST node, or NULL if an error occurs (errno will be set).
2200 */
2201 __cypherlang_must_check
2202 cypher_astnode_t *cypher_ast_set(cypher_astnode_t * const *items,
2203 unsigned int nitems, cypher_astnode_t **children,
2204 unsigned int nchildren, struct cypher_input_range range);
2205
2206 /**
2207 * Get the number of items in a `CYPHER_AST_SET` node.
2208 *
2209 * If the node is not an instance of `CYPHER_AST_SET` then the result will be
2210 * undefined.
2211 *
2212 * @param [node] The AST node.
2213 * @return The number of items.
2214 */
2215 __cypherlang_pure
2216 unsigned int cypher_ast_set_nitems(const cypher_astnode_t *node);
2217
2218 /**
2219 * Get an item from a `CYPHER_AST_SET` node.
2220 *
2221 * If the node is not an instance of `CYPHER_AST_SET` then the result will be
2222 * undefined.
2223 *
2224 * @param [node] The AST node.
2225 * @param [index] The index of the action.
2226 * @return A `CYPHER_AST_SET_ITEM` node, or null.
2227 */
2228 __cypherlang_pure
2229 const cypher_astnode_t *cypher_ast_set_get_item(
2230 const cypher_astnode_t *node, unsigned int index);
2231
2232
2233 /**
2234 * Construct a `CYPHER_AST_SET_PROPERTY` node.
2235 *
2236 * The node will also be an instance of `CYPHER_AST_SET_ITEM`.
2237 *
2238 * @param [property] A `CYPHER_AST_PROPERTY_OPERATOR` node.
2239 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
2240 * @param [children] The children of the node.
2241 * @param [nchildren] The number of children.
2242 * @param [range] The input range.
2243 * @return An AST node, or NULL if an error occurs (errno will be set).
2244 */
2245 __cypherlang_must_check
2246 cypher_astnode_t *cypher_ast_set_property(const cypher_astnode_t *property,
2247 const cypher_astnode_t *expression, cypher_astnode_t **children,
2248 unsigned int nchildren, struct cypher_input_range range);
2249
2250 /**
2251 * Get the property operator of a `CYPHER_AST_SET_PROPERTY` node.
2252 *
2253 * If the node is not an instance of `CYPHER_AST_SET_PROPERTY` then the result
2254 * will be undefined.
2255 *
2256 * @param [node] The AST node.
2257 * @return A `CYPHER_AST_PROPERTY_OPERATOR` node.
2258 */
2259 __cypherlang_pure
2260 const cypher_astnode_t *cypher_ast_set_property_get_property(
2261 const cypher_astnode_t *node);
2262
2263 /**
2264 * Get the expression of a `CYPHER_AST_SET_PROPERTY` node.
2265 *
2266 * If the node is not an instance of `CYPHER_AST_SET_PROPERTY` then the result
2267 * will be undefined.
2268 *
2269 * @param [node] The AST node.
2270 * @return A `CYPHER_AST_EXPRESSION` node.
2271 */
2272 __cypherlang_pure
2273 const cypher_astnode_t *cypher_ast_set_property_get_expression(
2274 const cypher_astnode_t *node);
2275
2276
2277 /**
2278 * Construct a `CYPHER_AST_SET_ALL_PROPERTIES` node.
2279 *
2280 * The node will also be an instance of `CYPHER_AST_SET_ITEM`.
2281 *
2282 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
2283 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
2284 * @param [children] The children of the node.
2285 * @param [nchildren] The number of children.
2286 * @param [range] The input range.
2287 * @return An AST node, or NULL if an error occurs (errno will be set).
2288 */
2289 __cypherlang_must_check
2290 cypher_astnode_t *cypher_ast_set_all_properties(
2291 const cypher_astnode_t *identifier, const cypher_astnode_t *expression,
2292 cypher_astnode_t **children, unsigned int nchildren,
2293 struct cypher_input_range range);
2294
2295 /**
2296 * Get the identifier of a `CYPHER_AST_SET_ALL_PROPERTIES` node.
2297 *
2298 * If the node is not an instance of `CYPHER_AST_SET_ALL_PROPERTIES` then the
2299 * result will be undefined.
2300 *
2301 * @param [node] The AST node.
2302 * @return A `CYPHER_AST_IDENTIFIER` node.
2303 */
2304 __cypherlang_pure
2305 const cypher_astnode_t *cypher_ast_set_all_properties_get_identifier(
2306 const cypher_astnode_t *node);
2307
2308 /**
2309 * Get the expression of a `CYPHER_AST_SET_ALL_PROPERTIES` node.
2310 *
2311 * If the node is not an instance of `CYPHER_AST_SET_ALL_PROPERTIES` then the
2312 * result will be undefined.
2313 *
2314 * @param [node] The AST node.
2315 * @return A `CYPHER_AST_EXPRESSION` node.
2316 */
2317 __cypherlang_pure
2318 const cypher_astnode_t *cypher_ast_set_all_properties_get_expression(
2319 const cypher_astnode_t *node);
2320
2321
2322 /**
2323 * Construct a `CYPHER_AST_MERGE_PROPERTIES` node.
2324 *
2325 * The node will also be an instance of `CYPHER_AST_SET_ITEM`.
2326 *
2327 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
2328 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
2329 * @param [children] The children of the node.
2330 * @param [nchildren] The number of children.
2331 * @param [range] The input range.
2332 * @return An AST node, or NULL if an error occurs (errno will be set).
2333 */
2334 __cypherlang_must_check
2335 cypher_astnode_t *cypher_ast_merge_properties(
2336 const cypher_astnode_t *identifier, const cypher_astnode_t *expression,
2337 cypher_astnode_t **children, unsigned int nchildren,
2338 struct cypher_input_range range);
2339
2340 /**
2341 * Get the identifier of a `CYPHER_AST_MERGE_PROPERTIES` node.
2342 *
2343 * If the node is not an instance of `CYPHER_AST_MERGE_PROPERTIES` then the
2344 * result will be undefined.
2345 *
2346 * @param [node] The AST node.
2347 * @return A `CYPHER_AST_IDENTIFIER` node.
2348 */
2349 __cypherlang_pure
2350 const cypher_astnode_t *cypher_ast_merge_properties_get_identifier(
2351 const cypher_astnode_t *node);
2352
2353 /**
2354 * Get the expression of a `CYPHER_AST_MERGE_PROPERTIES` node.
2355 *
2356 * If the node is not an instance of `CYPHER_AST_MERGE_PROPERTIES` then the
2357 * result will be undefined.
2358 *
2359 * @param [node] The AST node.
2360 * @return A `CYPHER_AST_EXPRESSION` node.
2361 */
2362 __cypherlang_pure
2363 const cypher_astnode_t *cypher_ast_merge_properties_get_expression(
2364 const cypher_astnode_t *node);
2365
2366
2367 /**
2368 * Construct a `CYPHER_AST_SET_LABELS` node.
2369 *
2370 * The node will also be an instance of `CYPHER_AST_SET_ITEM`.
2371 *
2372 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
2373 * @param [labels] The labels to be set, which must all be of type
2374 * `CYPHER_AST_LABEL`.
2375 * @param [nlabels] The number of labels to be set.
2376 * @param [children] The children of the node.
2377 * @param [nchildren] The number of children.
2378 * @param [range] The input range.
2379 * @return An AST node, or NULL if an error occurs (errno will be set).
2380 */
2381 __cypherlang_must_check
2382 cypher_astnode_t *cypher_ast_set_labels(const cypher_astnode_t *identifier,
2383 cypher_astnode_t * const *labels, unsigned int nlabels,
2384 cypher_astnode_t **children, unsigned int nchildren,
2385 struct cypher_input_range range);
2386
2387 /**
2388 * Get the identifier of a `CYPHER_AST_SET_LABELS` node.
2389 *
2390 * If the node is not an instance of `CYPHER_AST_SET_LABELS` then the
2391 * result will be undefined.
2392 *
2393 * @param [node] The AST node.
2394 * @return A `CYPHER_AST_IDENTIFIER` node.
2395 */
2396 __cypherlang_pure
2397 const cypher_astnode_t *cypher_ast_set_labels_get_identifier(
2398 const cypher_astnode_t *node);
2399
2400 /**
2401 * Get the number of labels in a `CYPHER_AST_SET_LABELS` node.
2402 *
2403 * If the node is not an instance of `CYPHER_AST_SET_LABELS` then the result
2404 * will be undefined.
2405 *
2406 * @param [node] The AST node.
2407 * @return The number of labels.
2408 */
2409 __cypherlang_pure
2410 unsigned int cypher_ast_set_labels_nlabels(const cypher_astnode_t *node);
2411
2412 /**
2413 * Get a label from a `CYPHER_AST_SET_LABELS` node.
2414 *
2415 * If the node is not an instance of `CYPHER_AST_SET_LABELS` then the result
2416 * will be undefined.
2417 *
2418 * @param [node] The AST node.
2419 * @param [index] The index of the label.
2420 * @return A `CYPHER_AST_LABEL` node, or null.
2421 */
2422 __cypherlang_pure
2423 const cypher_astnode_t *cypher_ast_set_labels_get_label(
2424 const cypher_astnode_t *node, unsigned int index);
2425
2426
2427 /**
2428 * Construct a `CYPHER_AST_DELETE` node.
2429 *
2430 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2431 *
2432 * @param [detach] `true` if the `DETACH` option is present, `false` otherwise.
2433 * @param [expressions] Expressions for `DELETE`, all of type
2434 * `CYPHER_AST_EXPRESSION`.
2435 * @param [nexpressions] The number of expressions.
2436 * @param [children] The children of the node.
2437 * @param [nchildren] The number of children.
2438 * @param [range] The input range.
2439 * @return An AST node, or NULL if an error occurs (errno will be set).
2440 */
2441 __cypherlang_must_check
2442 cypher_astnode_t *cypher_ast_delete(bool detach,
2443 cypher_astnode_t * const *expressions, unsigned int nexpressions,
2444 cypher_astnode_t **children, unsigned int nchildren,
2445 struct cypher_input_range range);
2446
2447 /**
2448 * Check if `DETACH` is present for a `CYPHER_AST_DELETE` node.
2449 *
2450 * If the node is not an instance of `CYPHER_AST_DELETE` then the result will
2451 * be undefined.
2452 *
2453 * @param [node] The AST node.
2454 * @return `true` if `DETACH` is present, `false` otherwise.
2455 */
2456 __cypherlang_pure
2457 bool cypher_ast_delete_has_detach(const cypher_astnode_t *node);
2458
2459 /**
2460 * Get the number of expression in a `CYPHER_AST_DELETE` node.
2461 *
2462 * If the node is not an instance of `CYPHER_AST_DELETE` then the result will
2463 * be undefined.
2464 *
2465 * @param [node] The AST node.
2466 * @return The number of expression.
2467 */
2468 __cypherlang_pure
2469 unsigned int cypher_ast_delete_nexpressions(const cypher_astnode_t *node);
2470
2471 /**
2472 * Get an expression from a `CYPHER_AST_DELETE` node.
2473 *
2474 * If the node is not an instance of `CYPHER_AST_DELETE` then the result will
2475 * be undefined.
2476 *
2477 * @param [node] The AST node.
2478 * @param [index] The index of the expression.
2479 * @return A `CYPHER_AST_EXPRESSION` node, or null.
2480 */
2481 __cypherlang_pure
2482 const cypher_astnode_t *cypher_ast_delete_get_expression(
2483 const cypher_astnode_t *node, unsigned int index);
2484
2485
2486 /**
2487 * Construct a `CYPHER_AST_REMOVE` node.
2488 *
2489 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2490 *
2491 * @param [items] Items for `REMOVE`, all of type `CYPHER_AST_REMOVE_ITEM`.
2492 * @param [nitems] The number of items.
2493 * @param [children] The children of the node.
2494 * @param [nchildren] The number of children.
2495 * @param [range] The input range.
2496 * @return An AST node, or NULL if an error occurs (errno will be set).
2497 */
2498 __cypherlang_must_check
2499 cypher_astnode_t *cypher_ast_remove(cypher_astnode_t * const *items,
2500 unsigned int nitems, cypher_astnode_t **children,
2501 unsigned int nchildren, struct cypher_input_range range);
2502
2503 /**
2504 * Get the number of items in a `CYPHER_AST_REMOVE` node.
2505 *
2506 * If the node is not an instance of `CYPHER_AST_REMOVE` then the result will
2507 * be undefined.
2508 *
2509 * @param [node] The AST node.
2510 * @return The number of items.
2511 */
2512 __cypherlang_pure
2513 unsigned int cypher_ast_remove_nitems(const cypher_astnode_t *node);
2514
2515 /**
2516 * Get an item from a `CYPHER_AST_REMOVE` node.
2517 *
2518 * If the node is not an instance of `CYPHER_AST_REMOVE` then the result will
2519 * be undefined.
2520 *
2521 * @param [node] The AST node.
2522 * @param [index] The index of the item.
2523 * @return A `CYPHER_AST_EXPRESSION` node, or null.
2524 */
2525 __cypherlang_pure
2526 const cypher_astnode_t *cypher_ast_remove_get_item(
2527 const cypher_astnode_t *node, unsigned int index);
2528
2529
2530 /**
2531 * Construct a `CYPHER_AST_REMOVE_LABELS` node.
2532 *
2533 * The node will also be an instance of `CYPHER_AST_REMOVE_ITEM`.
2534 *
2535 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
2536 * @param [labels] Labels to remove, all of type `CYPHER_AST_LABEL`.
2537 * @param [nlabels] The number of labels.
2538 * @param [children] The children of the node.
2539 * @param [nchildren] The number of children.
2540 * @param [range] The input range.
2541 * @return An AST node, or NULL if an error occurs (errno will be set).
2542 */
2543 __cypherlang_must_check
2544 cypher_astnode_t *cypher_ast_remove_labels(const cypher_astnode_t *identifier,
2545 cypher_astnode_t * const *labels, unsigned int nlabels,
2546 cypher_astnode_t **children, unsigned int nchildren,
2547 struct cypher_input_range range);
2548
2549 /**
2550 * Get the identifier of a `CYPHER_AST_REMOVE_LABELS` node.
2551 *
2552 * If the node is not an instance of `CYPHER_AST_REMOVE_LABELS` then the result
2553 * will be undefined.
2554 *
2555 * @param [node] The AST node.
2556 * @return A `CYPHER_AST_IDENTIFIER` node.
2557 */
2558 __cypherlang_pure
2559 const cypher_astnode_t *cypher_ast_remove_labels_get_identifier(
2560 const cypher_astnode_t *node);
2561
2562 /**
2563 * Get the number of labels in a `CYPHER_AST_REMOVE_LABELS` node.
2564 *
2565 * If the node is not an instance of `CYPHER_AST_REMOVE_LABELS` then the result
2566 * will be undefined.
2567 *
2568 * @param [node] The AST node.
2569 * @return The number of labels.
2570 */
2571 __cypherlang_pure
2572 unsigned int cypher_ast_remove_labels_nlabels(const cypher_astnode_t *node);
2573
2574 /**
2575 * Get a label from a `CYPHER_AST_REMOVE_LABELS` node.
2576 *
2577 * If the node is not an instance of `CYPHER_AST_REMOVE_LABELS` then the result
2578 * will be undefined.
2579 *
2580 * @param [node] The AST node.
2581 * @param [index] The index of the label.
2582 * @return A `CYPHER_AST_LABEL` node, or null.
2583 */
2584 __cypherlang_pure
2585 const cypher_astnode_t *cypher_ast_remove_labels_get_label(
2586 const cypher_astnode_t *node, unsigned int index);
2587
2588
2589 /**
2590 * Construct a `CYPHER_AST_REMOVE_PROPERTY` node.
2591 *
2592 * The node will also be an instance of `CYPHER_AST_REMOVE_ITEM`.
2593 *
2594 * @param [property] A `CYPHER_AST_PROPERTY_OPERATOR` node.
2595 * @param [children] The children of the node.
2596 * @param [nchildren] The number of children.
2597 * @param [range] The input range.
2598 * @return An AST node, or NULL if an error occurs (errno will be set).
2599 */
2600 __cypherlang_must_check
2601 cypher_astnode_t *cypher_ast_remove_property(const cypher_astnode_t *property,
2602 cypher_astnode_t **children, unsigned int nchildren,
2603 struct cypher_input_range range);
2604
2605 /**
2606 * Get the property operator of a `CYPHER_AST_REMOVE_PROPERTY` node.
2607 *
2608 * If the node is not an instance of `CYPHER_AST_REMOVE_PROPERTY` then the
2609 * result will be undefined.
2610 *
2611 * @param [node] The AST node.
2612 * @return A `CYPHER_AST_PROPERTY_OPERATOR` node.
2613 */
2614 __cypherlang_pure
2615 const cypher_astnode_t *cypher_ast_remove_property_get_property(
2616 const cypher_astnode_t *node);
2617
2618
2619 /**
2620 * Construct a `CYPHER_AST_FOREACH` node.
2621 *
2622 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2623 *
2624 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
2625 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
2626 * @param [clauses] Clauses for foreach, all of type `CYPHER_AST_CLAUSE`.
2627 * @param [nclauses] The number of clauses.
2628 * @param [children] The children of the node.
2629 * @param [nchildren] The number of children.
2630 * @param [range] The input range.
2631 * @return An AST node, or NULL if an error occurs (errno will be set).
2632 */
2633 __cypherlang_must_check
2634 cypher_astnode_t *cypher_ast_foreach(const cypher_astnode_t *identifier,
2635 const cypher_astnode_t *expression, cypher_astnode_t * const *clauses,
2636 unsigned int nclauses, cypher_astnode_t **children,
2637 unsigned int nchildren, struct cypher_input_range range);
2638
2639 /**
2640 * Get the identifier of a `CYPHER_AST_FOREACH` node.
2641 *
2642 * If the node is not an instance of `CYPHER_AST_FOREACH` then the result will
2643 * be undefined.
2644 *
2645 * @param [node] The AST node.
2646 * @return A `CYPHER_AST_IDENTIFIER` node.
2647 */
2648 __cypherlang_pure
2649 const cypher_astnode_t *cypher_ast_foreach_get_identifier(
2650 const cypher_astnode_t *node);
2651
2652 /**
2653 * Get the expression of a `CYPHER_AST_FOREACH` node.
2654 *
2655 * If the node is not an instance of `CYPHER_AST_FOREACH` then the result will
2656 * be undefined.
2657 *
2658 * @param [node] The AST node.
2659 * @return A `CYPHER_AST_EXPRESSION` node.
2660 */
2661 __cypherlang_pure
2662 const cypher_astnode_t *cypher_ast_foreach_get_expression(
2663 const cypher_astnode_t *node);
2664
2665 /**
2666 * Get the number of clauses from a `CYPHER_AST_FOREACH` node.
2667 *
2668 * If the node is not an instance of `CYPHER_AST_FOREACH` then the result will
2669 * be undefined.
2670 *
2671 * @param [node] The AST node.
2672 * @return The number of clauses.
2673 */
2674 __cypherlang_pure
2675 unsigned int cypher_ast_foreach_nclauses(const cypher_astnode_t *node);
2676
2677 /**
2678 * Get a clause from a `CYPHER_AST_FOREACH` node.
2679 *
2680 * If the node is not an instance of `CYPHER_AST_FOREACH` then the result will
2681 * be undefined.
2682 *
2683 * @param [node] The AST node.
2684 * @param [index] The index of the alternative.
2685 * @return A `CYPHER_AST_CLAUSE` node, or null.
2686 */
2687 __cypherlang_pure
2688 const cypher_astnode_t *cypher_ast_foreach_get_clause(
2689 const cypher_astnode_t *node, unsigned int index);
2690
2691
2692 /**
2693 * Construct a `CYPHER_AST_WITH` node.
2694 *
2695 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2696 *
2697 * @param [distinct] `true` if the `DISTINCT` keyword is specified.
2698 * @param [include_existing] `true` if including existing identifiers
2699 * (i.e. `WITH *`).
2700 * @param [projections] Projections for with, all of type
2701 * `CYPHER_AST_PROJECTION`.
2702 * @param [nprojections] The number of projections.
2703 * @param [order_by] A `CYPHER_AST_ORDER_BY` node, or null.
2704 * @param [skip] A `CYPHER_AST_INTEGER` node, or null.
2705 * @param [limit] A `CYPHER_AST_INTEGER` node, or null.
2706 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
2707 * @param [children] The children of the node.
2708 * @param [nchildren] The number of children.
2709 * @param [range] The input range.
2710 * @return An AST node, or NULL if an error occurs (errno will be set).
2711 */
2712 __cypherlang_must_check
2713 cypher_astnode_t *cypher_ast_with(bool distinct, bool include_existing,
2714 cypher_astnode_t * const *projections, unsigned int nprojections,
2715 const cypher_astnode_t *order_by, const cypher_astnode_t *skip,
2716 const cypher_astnode_t *limit, const cypher_astnode_t *predicate,
2717 cypher_astnode_t **children, unsigned int nchildren,
2718 struct cypher_input_range range);
2719
2720 /**
2721 * Check if `DISTINCT` is present for a `CYPHER_AST_WITH` node.
2722 *
2723 * If the node is not an instance of `CYPHER_AST_WITH` then the result will be
2724 * undefined.
2725 *
2726 * @param [node] The AST node.
2727 * @return `true` if `DISTINCT` is set, `false` otherwise.
2728 */
2729 __cypherlang_pure
2730 bool cypher_ast_with_is_distinct(const cypher_astnode_t *node);
2731
2732 /**
2733 * Check if including existing identifiers (`*`) in a `CYPHER_AST_WITH` node.
2734 *
2735 * If the node is not an instance of `CYPHER_AST_WITH` then the result will be
2736 * undefined.
2737 *
2738 * @param [node] The AST node.
2739 * @return `true` if including existing identifiers, `false` otherwise.
2740 */
2741 __cypherlang_pure
2742 bool cypher_ast_with_has_include_existing(const cypher_astnode_t *node);
2743
2744 /**
2745 * Get the number of projections in a `CYPHER_AST_WITH` node.
2746 *
2747 * If the node is not an instance of `CYPHER_AST_WITH` then the result will be
2748 * undefined.
2749 *
2750 * @param [node] The AST node.
2751 * @return The number of projections.
2752 */
2753 __cypherlang_pure
2754 unsigned int cypher_ast_with_nprojections(const cypher_astnode_t *node);
2755
2756 /**
2757 * Get a projection from a `CYPHER_AST_WITH` node.
2758 *
2759 * If the node is not an instance of `CYPHER_AST_WITH` then the result will
2760 * be undefined.
2761 *
2762 * @param [node] The AST node.
2763 * @param [index] The index of the identifier.
2764 * @return A `CYPHER_AST_PROJECTION` node, or null.
2765 */
2766 __cypherlang_pure
2767 const cypher_astnode_t *cypher_ast_with_get_projection(
2768 const cypher_astnode_t *node, unsigned int index);
2769
2770 /**
2771 * Get the "order by" node of a `CYPHER_AST_WITH` node.
2772 *
2773 * If the node is not an instance of `CYPHER_AST_WITH` then the result will
2774 * be undefined.
2775 *
2776 * @param [node] The AST node.
2777 * @return A `CYPHER_AST_ORDER_BY` node, or null.
2778 */
2779 __cypherlang_pure
2780 const cypher_astnode_t *cypher_ast_with_get_order_by(
2781 const cypher_astnode_t *node);
2782
2783 /**
2784 * Get the skip value of a `CYPHER_AST_WITH` node.
2785 *
2786 * If the node is not an instance of `CYPHER_AST_WITH` then the result will
2787 * be undefined.
2788 *
2789 * @param [node] The AST node.
2790 * @return A `CYPHER_AST_INTEGER` node, or null.
2791 */
2792 __cypherlang_pure
2793 const cypher_astnode_t *cypher_ast_with_get_skip(
2794 const cypher_astnode_t *node);
2795
2796 /**
2797 * Get the limit value of a `CYPHER_AST_WITH` node.
2798 *
2799 * If the node is not an instance of `CYPHER_AST_WITH` then the result will
2800 * be undefined.
2801 *
2802 * @param [node] The AST node.
2803 * @return A `CYPHER_AST_INTEGER` node, or null.
2804 */
2805 __cypherlang_pure
2806 const cypher_astnode_t *cypher_ast_with_get_limit(
2807 const cypher_astnode_t *node);
2808
2809 /**
2810 * Get the predicate of a `CYPHER_AST_WITH` node.
2811 *
2812 * If the node is not an instance of `CYPHER_AST_WITH` then the result will
2813 * be undefined.
2814 *
2815 * @param [node] The AST node.
2816 * @return A `CYPHER_AST_EXPRESSION` node, or null.
2817 */
2818 __cypherlang_pure
2819 const cypher_astnode_t *cypher_ast_with_get_predicate(
2820 const cypher_astnode_t *node);
2821
2822
2823 /**
2824 * Construct a `CYPHER_AST_UNWIND` node.
2825 *
2826 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2827 *
2828 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
2829 * @param [alias] A `CYPHER_AST_IDENTIFIER` node.
2830 * @param [children] The children of the node.
2831 * @param [nchildren] The number of children.
2832 * @param [range] The input range.
2833 * @return An AST node, or NULL if an error occurs (errno will be set).
2834 */
2835 __cypherlang_must_check
2836 cypher_astnode_t *cypher_ast_unwind(const cypher_astnode_t *expression,
2837 const cypher_astnode_t *alias, cypher_astnode_t **children,
2838 unsigned int nchildren, struct cypher_input_range range);
2839
2840 /**
2841 * Get the expression of a `CYPHER_AST_UNWIND` node.
2842 *
2843 * If the node is not an instance of `CYPHER_AST_UNWIND` then the result will
2844 * be undefined.
2845 *
2846 * @param [node] The AST node.
2847 * @return A `CYPHER_AST_EXPRESSION` node.
2848 */
2849 __cypherlang_pure
2850 const cypher_astnode_t *cypher_ast_unwind_get_expression(
2851 const cypher_astnode_t *node);
2852
2853 /**
2854 * Get the alias of a `CYPHER_AST_UNWIND` node.
2855 *
2856 * If the node is not an instance of `CYPHER_AST_UNWIND` then the result will
2857 * be undefined.
2858 *
2859 * @param [node] The AST node.
2860 * @return A `CYPHER_AST_EXPRESSION` node.
2861 */
2862 __cypherlang_pure
2863 const cypher_astnode_t *cypher_ast_unwind_get_alias(
2864 const cypher_astnode_t *node);
2865
2866
2867 /**
2868 * Construct a `CYPHER_AST_CALL` node.
2869 *
2870 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2871 *
2872 * @param [proc_name] A `CYPHER_AST_PROC_NAME` node.
2873 * @param [args] An array of `CYPHER_AST_EXPRESSION` nodes.
2874 * @param [nargs] The number of args.
2875 * @param [projections] Projections for with, all of type
2876 * `CYPHER_AST_PROJECTION`.
2877 * @param [nprojections] The number of projections.
2878 * @param [children] The children of the node.
2879 * @param [nchildren] The number of children.
2880 * @param [range] The input range.
2881 * @return An AST node, or NULL if an error occurs (errno will be set).
2882 */
2883 __cypherlang_must_check
2884 cypher_astnode_t *cypher_ast_call(const cypher_astnode_t *proc_name,
2885 cypher_astnode_t * const *args, unsigned int nargs,
2886 cypher_astnode_t * const *projections, unsigned int nprojections,
2887 cypher_astnode_t **children, unsigned int nchildren,
2888 struct cypher_input_range range);
2889
2890 /**
2891 * Get the proc name of a `CYPHER_AST_CALL` node.
2892 *
2893 * If the node is not an instance of `CYPHER_AST_CALL` then the result will
2894 * be undefined.
2895 *
2896 * @param [node] The AST node.
2897 * @return A `CYPHER_AST_PROC_NAME` node.
2898 */
2899 __cypherlang_pure
2900 const cypher_astnode_t *cypher_ast_call_get_proc_name(
2901 const cypher_astnode_t *node);
2902
2903 /**
2904 * Get the number of arguments of a `CYPHER_AST_CALL` node.
2905 *
2906 * If the node is not an instance of `CYPHER_AST_CALL` then the result will be
2907 * undefined.
2908 *
2909 * @param [node] The AST node.
2910 * @return The number of arguments.
2911 */
2912 __cypherlang_pure
2913 unsigned int cypher_ast_call_narguments(const cypher_astnode_t *node);
2914
2915 /**
2916 * Get an argument of a `CYPHER_AST_CALL` node.
2917 *
2918 * If the node is not an instance of `CYPHER_AST_CALL` then the result will be
2919 * undefined.
2920 *
2921 * @param [node] The AST node.
2922 * @param [index] The index of the argument.
2923 * @return A `CYPHER_AST_EXPRESSION` node.
2924 */
2925 __cypherlang_pure
2926 const cypher_astnode_t *cypher_ast_call_get_argument(
2927 const cypher_astnode_t *node, unsigned int index);
2928
2929 /**
2930 * Get the number of projections of a `CYPHER_AST_CALL` node.
2931 *
2932 * If the node is not an instance of `CYPHER_AST_CALL` then the result will be
2933 * undefined.
2934 *
2935 * @param [node] The AST node.
2936 * @return The number of projections.
2937 */
2938 __cypherlang_pure
2939 unsigned int cypher_ast_call_nprojections(const cypher_astnode_t *node);
2940
2941 /**
2942 * Get a projection of a `CYPHER_AST_CALL` node.
2943 *
2944 * If the node is not an instance of `CYPHER_AST_CALL` then the result will be
2945 * undefined.
2946 *
2947 * @param [node] The AST node.
2948 * @param [index] The index of the projection.
2949 * @return A `CYPHER_AST_PROJECTION` node.
2950 */
2951 __cypherlang_pure
2952 const cypher_astnode_t *cypher_ast_call_get_projection(
2953 const cypher_astnode_t *node, unsigned int index);
2954
2955
2956 /**
2957 * Construct a `CYPHER_AST_RETURN` node.
2958 *
2959 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
2960 *
2961 * @param [distinct] `true` if the `DISTINCT` keyword is specified.
2962 * @param [include_existing] `true` if including existing identifiers
2963 * (i.e. `RETURN *`).
2964 * @param [projections] Projections to return, all of type
2965 * `CYPHER_AST_PROJECTION`.
2966 * @param [nprojections] The number of projections.
2967 * @param [order_by] A `CYPHER_AST_ORDER_BY` node, or null.
2968 * @param [skip] A `CYPHER_AST_INTEGER` node, or null.
2969 * @param [limit] A `CYPHER_AST_INTEGER` node, or null.
2970 * @param [children] The children of the node.
2971 * @param [nchildren] The number of children.
2972 * @param [range] The input range.
2973 * @return An AST node, or NULL if an error occurs (errno will be set).
2974 */
2975 __cypherlang_must_check
2976 cypher_astnode_t *cypher_ast_return(bool distinct, bool include_existing,
2977 cypher_astnode_t * const *projections, unsigned int nprojections,
2978 const cypher_astnode_t *order_by, const cypher_astnode_t *skip,
2979 const cypher_astnode_t *limit, cypher_astnode_t **children,
2980 unsigned int nchildren, struct cypher_input_range range);
2981
2982 /**
2983 * Check if `DISTINCT` is set in a `CYPHER_AST_RETURN` node.
2984 *
2985 * If the node is not an instance of `CYPHER_AST_RETURN` then the result will
2986 * be undefined.
2987 *
2988 * @param [node] The AST node.
2989 * @return `true` if `DISTINCT` is set, `false` otherwise.
2990 */
2991 __cypherlang_pure
2992 bool cypher_ast_return_is_distinct(const cypher_astnode_t *node);
2993
2994 /**
2995 * Check if including existing identifiers (`*`) in a `CYPHER_AST_RETURN` node.
2996 *
2997 * If the node is not an instance of `CYPHER_AST_RETURN` then the result will
2998 * be undefined.
2999 *
3000 * @param [node] The AST node.
3001 * @return `true` if including existing identifiers, `false` otherwise.
3002 */
3003 __cypherlang_pure
3004 bool cypher_ast_return_has_include_existing(const cypher_astnode_t *node);
3005
3006 /**
3007 * Get the number of projections in a `CYPHER_AST_RETURN` node.
3008 *
3009 * If the node is not an instance of `CYPHER_AST_RETURN` then the result will
3010 * be undefined.
3011 *
3012 * @param [node] The AST node.
3013 * @return The number of projections.
3014 */
3015 __cypherlang_pure
3016 unsigned int cypher_ast_return_nprojections(const cypher_astnode_t *node);
3017
3018 /**
3019 * Get a projection from a `CYPHER_AST_RETURN` node.
3020 *
3021 * If the node is not an instance of `CYPHER_AST_RETURN` then the result will
3022 * be undefined.
3023 *
3024 * @param [node] The AST node.
3025 * @param [index] The index of the identifier.
3026 * @return A `CYPHER_AST_PROJECTION` node, or null.
3027 */
3028 __cypherlang_pure
3029 const cypher_astnode_t *cypher_ast_return_get_projection(
3030 const cypher_astnode_t *node, unsigned int index);
3031
3032 /**
3033 * Get the "order by" node of a `CYPHER_AST_RETURN` node.
3034 *
3035 * If the node is not an instance of `CYPHER_AST_RETURN` then the result will
3036 * be undefined.
3037 *
3038 * @param [node] The AST node.
3039 * @return A `CYPHER_AST_ORDER_BY` node, or null.
3040 */
3041 __cypherlang_pure
3042 const cypher_astnode_t *cypher_ast_return_get_order_by(
3043 const cypher_astnode_t *node);
3044
3045 /**
3046 * Get the skip value of a `CYPHER_AST_RETURN` node.
3047 *
3048 * If the node is not an instance of `CYPHER_AST_RETURN` then the result will
3049 * be undefined.
3050 *
3051 * @param [node] The AST node.
3052 * @return A `CYPHER_AST_INTEGER` node, or null.
3053 */
3054 __cypherlang_pure
3055 const cypher_astnode_t *cypher_ast_return_get_skip(
3056 const cypher_astnode_t *node);
3057
3058 /**
3059 * Get the limit value of a `CYPHER_AST_RETURN` node.
3060 *
3061 * If the node is not an instance of `CYPHER_AST_RETURN` then the result will
3062 * be undefined.
3063 *
3064 * @param [node] The AST node.
3065 * @return A `CYPHER_AST_INTEGER` node, or null.
3066 */
3067 __cypherlang_pure
3068 const cypher_astnode_t *cypher_ast_return_get_limit(
3069 const cypher_astnode_t *node);
3070
3071
3072 /**
3073 * Construct a `CYPHER_AST_PROJECTION` node.
3074 *
3075 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3076 * @param [alias] A `CYPHER_AST_IDENTIFIER` node, or null.
3077 * @param [children] The children of the node.
3078 * @param [nchildren] The number of children.
3079 * @param [range] The input range.
3080 * @return An AST node, or NULL if an error occurs (errno will be set).
3081 */
3082 __cypherlang_must_check
3083 cypher_astnode_t *cypher_ast_projection(const cypher_astnode_t *expression,
3084 const cypher_astnode_t *alias, cypher_astnode_t **children,
3085 unsigned int nchildren, struct cypher_input_range range);
3086
3087 /**
3088 * Get the expression from a `CYPHER_AST_PROJECTION` node.
3089 *
3090 * If the node is not an instance of `CYPHER_AST_PROJECTION` then the result
3091 * will be undefined.
3092 *
3093 * @param [node] The AST node.
3094 * @return A `CYPHER_AST_EXPRESSION` node.
3095 */
3096 __cypherlang_pure
3097 const cypher_astnode_t *cypher_ast_projection_get_expression(
3098 const cypher_astnode_t *node);
3099
3100 /**
3101 * Get the alias from a `CYPHER_AST_PROJECTION` node.
3102 *
3103 * If the node is not an instance of `CYPHER_AST_PROJECTION` then the result
3104 * will be undefined.
3105 *
3106 * @param [node] The AST node.
3107 * @return A `CYPHER_AST_IDENTIFIER` node, or null.
3108 */
3109 __cypherlang_pure
3110 const cypher_astnode_t *cypher_ast_projection_get_alias(
3111 const cypher_astnode_t *node);
3112
3113
3114 /**
3115 * Construct a `CYPHER_AST_ORDER_BY` node.
3116 *
3117 * @param [items] Items for `ORDER BY`, all of type `CYPHER_AST_SORT_ITEM`.
3118 * @param [nitems] The number of items.
3119 * @param [children] The children of the node.
3120 * @param [nchildren] The number of children.
3121 * @param [range] The input range.
3122 * @return An AST node, or NULL if an error occurs (errno will be set).
3123 */
3124 __cypherlang_must_check
3125 cypher_astnode_t *cypher_ast_order_by(cypher_astnode_t * const *items,
3126 unsigned int nitems, cypher_astnode_t **children,
3127 unsigned int nchildren, struct cypher_input_range range);
3128
3129 /**
3130 * Get the number of items in a `CYPHER_AST_ORDER_BY` node.
3131 *
3132 * If the node is not an instance of `CYPHER_AST_ORDER_BY` then the result will
3133 * be undefined.
3134 *
3135 * @param [node] The AST node.
3136 * @return The number of items.
3137 */
3138 __cypherlang_pure
3139 unsigned int cypher_ast_order_by_nitems(const cypher_astnode_t *node);
3140
3141 /**
3142 * Get an item from a `CYPHER_AST_ORDER_BY` node.
3143 *
3144 * If the node is not an instance of `CYPHER_AST_ORDER_BY` then the result will
3145 * be undefined.
3146 *
3147 * @param [node] The AST node.
3148 * @param [index] The index of the action.
3149 * @return A `CYPHER_AST_SET_ITEM` node, or null.
3150 */
3151 __cypherlang_pure
3152 const cypher_astnode_t *cypher_ast_order_by_get_item(
3153 const cypher_astnode_t *node, unsigned int index);
3154
3155
3156 /**
3157 * Construct a `CYPHER_AST_SORT_ITEM` node.
3158 *
3159 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3160 * @param [ascending] `true` if the sort item is ascending.
3161 * @param [children] The children of the node.
3162 * @param [nchildren] The number of children.
3163 * @param [range] The input range.
3164 * @return An AST node, or NULL if an error occurs (errno will be set).
3165 */
3166 __cypherlang_must_check
3167 cypher_astnode_t *cypher_ast_sort_item(const cypher_astnode_t *expression,
3168 bool ascending, cypher_astnode_t **children, unsigned int nchildren,
3169 struct cypher_input_range range);
3170
3171 /**
3172 * Get the expression from a `CYPHER_AST_SORT_ITEM` node.
3173 *
3174 * If the node is not an instance of `CYPHER_AST_SORT_ITEM` then the result
3175 * will be undefined.
3176 *
3177 * @param [node] The AST node.
3178 * @return A `CYPHER_AST_EXPRESSION` node.
3179 */
3180 __cypherlang_pure
3181 const cypher_astnode_t *cypher_ast_sort_item_get_expression(
3182 const cypher_astnode_t *node);
3183
3184 /**
3185 * Check if a `CYPHER_AST_SORT_ITEM` node is using ascending order.
3186 *
3187 * If the node is not an instance of `CYPHER_AST_SORT_ITEM` then the result
3188 * will be undefined.
3189 *
3190 * @param [node] The AST node.
3191 * @return `true` if the sort item is ascending, `false` otherwise.
3192 */
3193 __cypherlang_pure
3194 bool cypher_ast_sort_item_is_ascending(const cypher_astnode_t *node);
3195
3196
3197 /**
3198 * Construct a `CYPHER_AST_UNION` node.
3199 *
3200 * The node will also be an instance of `CYPHER_AST_CLAUSE`.
3201 *
3202 * @param [all] `true` if `ALL` is specified for the union.
3203 * @param [children] The children of the node.
3204 * @param [nchildren] The number of children.
3205 * @param [range] The input range.
3206 * @return An AST node, or NULL if an error occurs (errno will be set).
3207 */
3208 __cypherlang_must_check
3209 cypher_astnode_t *cypher_ast_union(bool all, cypher_astnode_t **children,
3210 unsigned int nchildren, struct cypher_input_range range);
3211
3212 /**
3213 * Check if a `CYPHER_AST_UNION` node has `ALL` specified.
3214 *
3215 * If the node is not an instance of `CYPHER_AST_UNION` then the result will be
3216 * undefined.
3217 *
3218 * @param [node] The AST node.
3219 * @return `true` if `ALL` is specified, `false` otherwise.
3220 */
3221 __cypherlang_pure
3222 bool cypher_ast_union_has_all(const cypher_astnode_t *node);
3223
3224
3225 /**
3226 * Construct a `CYPHER_AST_UNARY_OPERATOR` node.
3227 *
3228 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3229 *
3230 * @param [op] The operator.
3231 * @param [arg] The argument to the unary operator, of type
3232 * `CYPHER_AST_EXPRESSION`.
3233 * @param [children] The children of the node.
3234 * @param [nchildren] The number of children.
3235 * @param [range] The input range.
3236 * @return An AST node, or NULL if an error occurs (errno will be set).
3237 */
3238 __cypherlang_must_check
3239 cypher_astnode_t *cypher_ast_unary_operator(const cypher_operator_t *op,
3240 const cypher_astnode_t *arg, cypher_astnode_t **children,
3241 unsigned int nchildren, struct cypher_input_range range);
3242
3243 /**
3244 * Get the operator of a `CYPHER_AST_UNARY_OPERATOR` node.
3245 *
3246 * If the node is not an instance of `CYPHER_AST_UNARY_OPERATOR` then the
3247 * result will be undefined.
3248 *
3249 * @param [node] The AST node.
3250 * @return The operator.
3251 */
3252 __cypherlang_pure
3253 const cypher_operator_t *cypher_ast_unary_operator_get_operator(
3254 const cypher_astnode_t *node);
3255
3256 /**
3257 * Get the argument of a `CYPHER_AST_UNARY_OPERATOR` node.
3258 *
3259 * If the node is not an instance of `CYPHER_AST_UNARY_OPERATOR` then the
3260 * result will be undefined.
3261 *
3262 * @param [node] The AST node.
3263 * @return The argument, of type `CYPHER_AST_EXPRESSION`.
3264 */
3265 __cypherlang_pure
3266 const cypher_astnode_t *cypher_ast_unary_operator_get_argument(
3267 const cypher_astnode_t *node);
3268
3269
3270 /**
3271 * Construct a `CYPHER_AST_BINARY_OPERATOR` node.
3272 *
3273 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3274 *
3275 * @param [op] The operator.
3276 * @param [arg1] The first (left) argument to the binary operator, of type
3277 * `CYPHER_AST_EXPRESSION`.
3278 * @param [arg2] The second (right) argument to the binary operator, of type
3279 * `CYPHER_AST_EXPRESSION`.
3280 * @param [children] The children of the node.
3281 * @param [nchildren] The number of children.
3282 * @param [range] The input range.
3283 * @return An AST node, or NULL if an error occurs (errno will be set).
3284 */
3285 __cypherlang_must_check
3286 cypher_astnode_t *cypher_ast_binary_operator(const cypher_operator_t *op,
3287 const cypher_astnode_t *arg1, const cypher_astnode_t *arg2,
3288 cypher_astnode_t **children, unsigned int nchildren,
3289 struct cypher_input_range range);
3290
3291 /**
3292 * Get the operator of a `CYPHER_AST_BINARY_OPERATOR` node.
3293 *
3294 * If the node is not an instance of `CYPHER_AST_BINARY_OPERATOR` then the
3295 * result will be undefined.
3296 *
3297 * @param [node] The AST node.
3298 * @return The operator.
3299 */
3300 __cypherlang_pure
3301 const cypher_operator_t *cypher_ast_binary_operator_get_operator(
3302 const cypher_astnode_t *node);
3303
3304 /**
3305 * Get the first (left) argument of a `CYPHER_AST_BINARY_OPERATOR` node.
3306 *
3307 * If the node is not an instance of `CYPHER_AST_BINARY_OPERATOR` then the
3308 * result will be undefined.
3309 *
3310 * @param [node] The AST node.
3311 * @return The argument, of type `CYPHER_AST_EXPRESSION`.
3312 */
3313 __cypherlang_pure
3314 const cypher_astnode_t *cypher_ast_binary_operator_get_argument1(
3315 const cypher_astnode_t *node);
3316
3317 /**
3318 * Get the second (right) argument of a `CYPHER_AST_BINARY_OPERATOR` node.
3319 *
3320 * If the node is not an instance of `CYPHER_AST_BINARY_OPERATOR` then the
3321 * result will be undefined.
3322 *
3323 * @param [node] The AST node.
3324 * @return The argument, of type `CYPHER_AST_EXPRESSION`.
3325 */
3326 __cypherlang_pure
3327 const cypher_astnode_t *cypher_ast_binary_operator_get_argument2(
3328 const cypher_astnode_t *node);
3329
3330
3331 /**
3332 * Construct a `CYPHER_AST_COMPARISON` node.
3333 *
3334 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3335 *
3336 * @param [length] The length of the comparison chain.
3337 * @param [ops] The operators in the comparison chain, which must be
3338 * length pointers.
3339 * @param [args] The arguments in the comparison chain, which must be
3340 * length+1 pointers all of type `CYPHER_AST_EXPRESSION`.
3341 * @param [children] The children of the node.
3342 * @param [nchildren] The number of children.
3343 * @param [range] The input range.
3344 * @return An AST node, or NULL if an error occurs (errno will be set).
3345 */
3346 __cypherlang_must_check
3347 cypher_astnode_t *cypher_ast_comparison(unsigned int length,
3348 const cypher_operator_t * const *ops, cypher_astnode_t * const *args,
3349 cypher_astnode_t **children, unsigned int nchildren,
3350 struct cypher_input_range range);
3351
3352 /**
3353 * Get the comparsion chain length of a `CYPHER_AST_COMPARISON` node.
3354 *
3355 * If the node is not an instance of `CYPHER_AST_COMPARISON` then the result
3356 * will be undefined.
3357 *
3358 * @param [node] The AST node.
3359 * @return The length of the chain.
3360 */
3361 unsigned int cypher_ast_comparison_get_length(const cypher_astnode_t *node);
3362
3363 /**
3364 * Get an operator in the chain of a `CYPHER_AST_COMPARISON` node.
3365 *
3366 * If the node is not an instance of `CYPHER_AST_COMPARISON` then the result
3367 * will be undefined.
3368 *
3369 * @param [node] The AST node.
3370 * @param [pos] The position in the comparison chain.
3371 * @return The operator at the specified position in the chain, or null if
3372 * the position is greater than the chain length.
3373 */
3374 __cypherlang_pure
3375 const cypher_operator_t *cypher_ast_comparison_get_operator(
3376 const cypher_astnode_t *node, unsigned int pos);
3377
3378 /**
3379 * Get the argument in the chain of a `CYPHER_AST_COMPARISON` node.
3380 *
3381 * If the node is not an instance of `CYPHER_AST_COMPARISON` then the result
3382 * will be undefined.
3383 *
3384 * @param [node] The AST node.
3385 * @param [pos] The position in the comparison chain.
3386 * @return A `CYPHER_AST_EXPRESSION` node at the specified position in the
3387 * chain, or null if the position is greater than the chain length.
3388 */
3389 __cypherlang_pure
3390 const cypher_astnode_t *cypher_ast_comparison_get_argument(
3391 const cypher_astnode_t *node, unsigned int pos);
3392
3393
3394 /**
3395 * Construct a `CYPHER_AST_APPLY_OPERATOR` node.
3396 *
3397 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3398 *
3399 * @param [func_name] A `CYPHER_AST_FUNCTION_NAME` node.
3400 * @param [distinct] `true` if the `DISTINCT` keyword is specified.
3401 * @param [args] An array of `CYPHER_AST_EXPRESSION` nodes.
3402 * @param [nargs] The number of args.
3403 * @param [children] The children of the node.
3404 * @param [nchildren] The number of children.
3405 * @param [range] The input range.
3406 * @return An AST node, or NULL if an error occurs (errno will be set).
3407 */
3408 __cypherlang_must_check
3409 cypher_astnode_t *cypher_ast_apply_operator(const cypher_astnode_t *func_name,
3410 bool distinct, cypher_astnode_t * const *args, unsigned int nargs,
3411 cypher_astnode_t **children, unsigned int nchildren,
3412 struct cypher_input_range range);
3413
3414 /**
3415 * Get the function name of a `CYPHER_AST_APPLY_OPERATOR` node.
3416 *
3417 * If the node is not an instance of `CYPHER_AST_APPLY_OPERATOR` then the result
3418 * will be undefined.
3419 *
3420 * @param [node] The AST node.
3421 * @return A `CYPHER_AST_FUNCTION_NAME` node.
3422 */
3423 __cypherlang_pure
3424 const cypher_astnode_t *cypher_ast_apply_operator_get_func_name(
3425 const cypher_astnode_t *node);
3426
3427 /**
3428 * Check if a `CYPHER_AST_APPLY_OPERATOR` node is `DISTINCT`.
3429 *
3430 * If the node is not an instance of `CYPHER_AST_APPLY_OPERATOR` then the
3431 * result will be undefined.
3432 *
3433 * @param [node] The AST node.
3434 * @return `true` if `DISTINCT` is specified, and `false` otherwise.
3435 */
3436 __cypherlang_pure
3437 bool cypher_ast_apply_operator_get_distinct(const cypher_astnode_t *node);
3438
3439 /**
3440 * Get the number of arguments of a `CYPHER_AST_APPLY_OPERATOR` node.
3441 *
3442 * If the node is not an instance of `CYPHER_AST_APPLY_OPERATOR` then the
3443 * result will be undefined.
3444 *
3445 * @param [node] The AST node.
3446 * @return The number of arguments.
3447 */
3448 __cypherlang_pure
3449 unsigned int cypher_ast_apply_operator_narguments(const cypher_astnode_t *node);
3450
3451 /**
3452 * Get an argument of a `CYPHER_AST_APPLY_OPERATOR` node.
3453 *
3454 * If the node is not an instance of `CYPHER_AST_APPLY_OPERATOR` then the
3455 * result will be undefined.
3456 *
3457 * @param [node] The AST node.
3458 * @param [index] The index of the argument.
3459 * @return A `CYPHER_AST_EXPRESSION` node.
3460 */
3461 __cypherlang_pure
3462 const cypher_astnode_t *cypher_ast_apply_operator_get_argument(
3463 const cypher_astnode_t *node, unsigned int index);
3464
3465
3466 /**
3467 * Construct a `CYPHER_AST_APPLY_ALL_OPERATOR` node.
3468 *
3469 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3470 *
3471 * @param [func_name] A `CYPHER_AST_FUNCTION_NAME` node.
3472 * @param [distinct] `true` if the function removes duplicate results.
3473 * @param [children] The children of the node.
3474 * @param [nchildren] The number of children.
3475 * @param [range] The input range.
3476 * @return An AST node, or NULL if an error occurs (errno will be set).
3477 */
3478 __cypherlang_must_check
3479 cypher_astnode_t *cypher_ast_apply_all_operator(
3480 const cypher_astnode_t *func_name,
3481 bool distinct, cypher_astnode_t **children, unsigned int nchildren,
3482 struct cypher_input_range range);
3483
3484 /**
3485 * Get the function name of a `CYPHER_AST_APPLY_ALL_OPERATOR` node.
3486 *
3487 * If the node is not an instance of `CYPHER_AST_APPLY_ALL_OPERATOR` then the
3488 * result will be undefined.
3489 *
3490 * @param [node] The AST node.
3491 * @return A `CYPHER_AST_FUNCTION_NAME` node.
3492 */
3493 __cypherlang_pure
3494 const cypher_astnode_t *cypher_ast_apply_all_operator_get_func_name(
3495 const cypher_astnode_t *node);
3496
3497 /**
3498 * Check if a `CYPHER_AST_APPLY_ALL_OPERATOR` node is `DISTINCT`.
3499 *
3500 * If the node is not an instance of `CYPHER_AST_APPLY_ALL_OPERATOR` then the
3501 * result will be undefined.
3502 *
3503 * @param [node] The AST node.
3504 * @return `true` if `DISTINCT` is specified, and `false` otherwise.
3505 */
3506 __cypherlang_pure
3507 bool cypher_ast_apply_all_operator_get_distinct(const cypher_astnode_t *node);
3508
3509
3510 /**
3511 * Construct a `CYPHER_AST_PROPERTY_OPERATOR` node.
3512 *
3513 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3514 *
3515 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3516 * @param [prop_name] A `CYPHER_AST_PROP_NAME` node.
3517 * @param [children] The children of the node.
3518 * @param [nchildren] The number of children.
3519 * @param [range] The input range.
3520 * @return An AST node, or NULL if an error occurs (errno will be set).
3521 */
3522 __cypherlang_must_check
3523 cypher_astnode_t *cypher_ast_property_operator(
3524 const cypher_astnode_t *expression, const cypher_astnode_t *prop_name,
3525 cypher_astnode_t **children, unsigned int nchildren,
3526 struct cypher_input_range range);
3527
3528 /**
3529 * Get the expression of a `CYPHER_AST_PROPERTY_OPERATOR` node.
3530 *
3531 * If the node is not an instance of `CYPHER_AST_PROPERTY_OPERATOR` then the
3532 * result will be undefined.
3533 *
3534 * @param [node] The AST node.
3535 * @return A `CYPHER_AST_EXPRESSION` node.
3536 */
3537 __cypherlang_pure
3538 const cypher_astnode_t *cypher_ast_property_operator_get_expression(
3539 const cypher_astnode_t *node);
3540
3541 /**
3542 * Get the property name of a `CYPHER_AST_PROPERTY_OPERATOR` node.
3543 *
3544 * If the node is not an instance of `CYPHER_AST_PROPERTY_OPERATOR` then the
3545 * result will be undefined.
3546 *
3547 * @param [node] The AST node.
3548 * @return A `CYPHER_AST_PROP_NAME` node.
3549 */
3550 __cypherlang_pure
3551 const cypher_astnode_t *cypher_ast_property_operator_get_prop_name(
3552 const cypher_astnode_t *node);
3553
3554
3555 /**
3556 * Construct a `CYPHER_AST_SUBSCRIPT_OPERATOR` node.
3557 *
3558 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3559 *
3560 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3561 * @param [subscript] A `CYPHER_AST_EXPRESSION` node.
3562 * @param [children] The children of the node.
3563 * @param [nchildren] The number of children.
3564 * @param [range] The input range.
3565 * @return An AST node, or NULL if an error occurs (errno will be set).
3566 */
3567 __cypherlang_must_check
3568 cypher_astnode_t *cypher_ast_subscript_operator(
3569 const cypher_astnode_t *expression, const cypher_astnode_t *subscript,
3570 cypher_astnode_t **children, unsigned int nchildren,
3571 struct cypher_input_range range);
3572
3573 /**
3574 * Get the expression of a `CYPHER_AST_SUBSCRIPT_OPERATOR` node.
3575 *
3576 * If the node is not an instance of `CYPHER_AST_SUBSCRIPT_OPERATOR` then the
3577 * result will be undefined.
3578 *
3579 * @param [node] The AST node.
3580 * @return A `CYPHER_AST_EXPRESSION` node.
3581 */
3582 __cypherlang_pure
3583 const cypher_astnode_t *cypher_ast_subscript_operator_get_expression(
3584 const cypher_astnode_t *node);
3585
3586 /**
3587 * Get the subscript of a `CYPHER_AST_SUBSCRIPT_OPERATOR` node.
3588 *
3589 * If the node is not an instance of `CYPHER_AST_SUBSCRIPT_OPERATOR` then the
3590 * result will be undefined.
3591 *
3592 * @param [node] The AST node.
3593 * @return A `CYPHER_AST_EXPRESSION` node.
3594 */
3595 __cypherlang_pure
3596 const cypher_astnode_t *cypher_ast_subscript_operator_get_subscript(
3597 const cypher_astnode_t *node);
3598
3599
3600 /**
3601 * Construct a `CYPHER_AST_SLICE_OPERATOR` node.
3602 *
3603 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3604 *
3605 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3606 * @param [start] A `CYPHER_AST_EXPRESSION` node, or null.
3607 * @param [end] A `CYPHER_AST_EXPRESSION` node, or null.
3608 * @param [children] The children of the node.
3609 * @param [nchildren] The number of children.
3610 * @param [range] The input range.
3611 * @return An AST node, or NULL if an error occurs (errno will be set).
3612 */
3613 __cypherlang_must_check
3614 cypher_astnode_t *cypher_ast_slice_operator(const cypher_astnode_t *expression,
3615 const cypher_astnode_t *start, const cypher_astnode_t *end,
3616 cypher_astnode_t **children, unsigned int nchildren,
3617 struct cypher_input_range range);
3618
3619 /**
3620 * Get the expression of a `CYPHER_AST_SLICE_OPERATOR` node.
3621 *
3622 * If the node is not an instance of `CYPHER_AST_SLICE_OPERATOR` then the
3623 * result will be undefined.
3624 *
3625 * @param [node] The AST node.
3626 * @return A `CYPHER_AST_EXPRESSION` node.
3627 */
3628 __cypherlang_pure
3629 const cypher_astnode_t *cypher_ast_slice_operator_get_expression(
3630 const cypher_astnode_t *node);
3631
3632 /**
3633 * Get the start of a `CYPHER_AST_SLICE_OPERATOR` node.
3634 *
3635 * If the node is not an instance of `CYPHER_AST_SLICE_OPERATOR` then the
3636 * result will be undefined.
3637 *
3638 * @param [node] The AST node.
3639 * @return A `CYPHER_AST_EXPRESSION` node, or null.
3640 */
3641 __cypherlang_pure
3642 const cypher_astnode_t *cypher_ast_slice_operator_get_start(
3643 const cypher_astnode_t *node);
3644
3645 /**
3646 * Get the end of a `CYPHER_AST_SLICE_OPERATOR` node.
3647 *
3648 * If the node is not an instance of `CYPHER_AST_SLICE_OPERATOR` then the
3649 * result will be undefined.
3650 *
3651 * @param [node] The AST node.
3652 * @return A `CYPHER_AST_EXPRESSION` node, or null.
3653 */
3654 __cypherlang_pure
3655 const cypher_astnode_t *cypher_ast_slice_operator_get_end(
3656 const cypher_astnode_t *node);
3657
3658
3659 /**
3660 * Construct a `CYPHER_AST_MAP_PROJECTION` node.
3661 *
3662 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3663 *
3664 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3665 * @param [selectors] Selectors for the projection, all of type
3666 * `CYPHER_AST_MAP_PROJECTION_SELECTOR`.
3667 * @param [nselectors] The number of selectors (may be zero).
3668 * @param [children] The children of the node.
3669 * @param [nchildren] The number of children.
3670 * @param [range] The input range.
3671 * @return An AST node, or NULL if an error occurs (errno will be set).
3672 */
3673 __cypherlang_must_check
3674 cypher_astnode_t *cypher_ast_map_projection(
3675 const cypher_astnode_t *expression,
3676 cypher_astnode_t * const *selectors, unsigned int nselectors,
3677 cypher_astnode_t **children, unsigned int nchildren,
3678 struct cypher_input_range range);
3679
3680 /**
3681 * Get the expression of a `CYPHER_AST_MAP_PROJECTION` node.
3682 *
3683 * If the node is not an instance of `CYPHER_AST_MAP_PROJECTION` then the
3684 * result will be undefined.
3685 *
3686 * @param [node] The AST node.
3687 * @return A `CYPHER_AST_EXPRESSION` node.
3688 */
3689 __cypherlang_pure
3690 const cypher_astnode_t *cypher_ast_map_projection_get_expression(
3691 const cypher_astnode_t *node);
3692
3693 /**
3694 * Get the number of selectors in a `CYPHER_AST_MAP_PROJECTION` node.
3695 *
3696 * If the node is not an instance of `CYPHER_AST_MAP_PROJECTION` then the
3697 * result will be undefined.
3698 *
3699 * @param [node] The AST node.
3700 * @return The number of selectors.
3701 */
3702 __cypherlang_pure
3703 unsigned int cypher_ast_map_projection_nselectors(const cypher_astnode_t *node);
3704
3705 /**
3706 * Get a selector from a `CYPHER_AST_MAP_PROJECTION` node.
3707 *
3708 * If the node is not an instance of `CYPHER_AST_MAP_PROJECTION` then the
3709 * result will be undefined.
3710 *
3711 * @param [node] The AST node.
3712 * @param [index] The index of the selector.
3713 * @return A `CYPHER_AST_MAP_PROJECTION_SELECTOR` node, or null.
3714 */
3715 __cypherlang_pure
3716 const cypher_astnode_t *cypher_ast_map_projection_get_selector(
3717 const cypher_astnode_t *node, unsigned int index);
3718
3719
3720 /**
3721 * Construct a `CYPHER_AST_MAP_PROJECTION_LITERAL` node.
3722 *
3723 * The node will also be an instance of `CYPHER_AST_MAP_PROJECTION_SELECTOR`.
3724 *
3725 * @param [prop_name] A `CYPHER_AST_PROP_NAME` node.
3726 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3727 * @param [children] The children of the node.
3728 * @param [nchildren] The number of children.
3729 * @param [range] The input range.
3730 * @return An AST node, or NULL if an error occurs (errno will be set).
3731 */
3732 __cypherlang_must_check
3733 cypher_astnode_t *cypher_ast_map_projection_literal(
3734 const cypher_astnode_t *prop_name, const cypher_astnode_t *expression,
3735 cypher_astnode_t **children, unsigned int nchildren,
3736 struct cypher_input_range range);
3737
3738 /**
3739 * Get the property name of a `CYPHER_AST_MAP_PROJECTION_LITERAL` node.
3740 *
3741 * If the node is not an instance of `CYPHER_AST_MAP_PROJECTION_LITERAL` then
3742 * the result will be undefined.
3743 *
3744 * @param [node] The AST node.
3745 * @return A `CYPHER_AST_PROP_NAME` node.
3746 */
3747 __cypherlang_pure
3748 const cypher_astnode_t *cypher_ast_map_projection_literal_get_prop_name(
3749 const cypher_astnode_t *node);
3750
3751 /**
3752 * Get the expression of a `CYPHER_AST_MAP_PROJECTION_LITERAL` node.
3753 *
3754 * If the node is not an instance of `CYPHER_AST_MAP_PROJECTION_LITERAL` then
3755 * the result will be undefined.
3756 *
3757 * @param [node] The AST node.
3758 * @return A `CYPHER_AST_EXPRESSION` node.
3759 */
3760 __cypherlang_pure
3761 const cypher_astnode_t *cypher_ast_map_projection_literal_get_expression(
3762 const cypher_astnode_t *node);
3763
3764
3765 /**
3766 * Construct a `CYPHER_AST_MAP_PROJECTION_PROPERTY` node.
3767 *
3768 * The node will also be an instance of `CYPHER_AST_MAP_PROJECTION_SELECTOR`.
3769 *
3770 * @param [prop_name] A `CYPHER_AST_PROP_NAME` node.
3771 * @param [children] The children of the node.
3772 * @param [nchildren] The number of children.
3773 * @param [range] The input range.
3774 * @return An AST node, or NULL if an error occurs (errno will be set).
3775 */
3776 __cypherlang_must_check
3777 cypher_astnode_t *cypher_ast_map_projection_property(
3778 const cypher_astnode_t *prop_name,
3779 cypher_astnode_t **children, unsigned int nchildren,
3780 struct cypher_input_range range);
3781
3782 /**
3783 * Get the property name of a `CYPHER_AST_MAP_PROJECTION_PROPERTY` node.
3784 *
3785 * If the node is not an instance of `CYPHER_AST_MAP_PROJECTION_PROPERTY` then
3786 * the result will be undefined.
3787 *
3788 * @param [node] The AST node.
3789 * @return A `CYPHER_AST_PROP_NAME` node.
3790 */
3791 __cypherlang_pure
3792 const cypher_astnode_t *cypher_ast_map_projection_property_get_prop_name(
3793 const cypher_astnode_t *node);
3794
3795
3796 /**
3797 * Construct a `CYPHER_AST_MAP_PROJECTION_IDENTIFIER` node.
3798 *
3799 * The node will also be an instance of `CYPHER_AST_MAP_PROJECTION_SELECTOR`.
3800 *
3801 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
3802 * @param [children] The children of the node.
3803 * @param [nchildren] The number of children.
3804 * @param [range] The input range.
3805 * @return An AST node, or NULL if an error occurs (errno will be set).
3806 */
3807 __cypherlang_must_check
3808 cypher_astnode_t *cypher_ast_map_projection_identifier(
3809 const cypher_astnode_t *identifier,
3810 cypher_astnode_t **children, unsigned int nchildren,
3811 struct cypher_input_range range);
3812
3813 /**
3814 * Get the identifier of a `CYPHER_AST_MAP_PROJECTION_IDENTIFIER` node.
3815 *
3816 * If the node is not an instance of `CYPHER_AST_MAP_PROJECTION_IDENTIFIER`
3817 * then the result will be undefined.
3818 *
3819 * @param [node] The AST node.
3820 * @return A `CYPHER_AST_IDENTIFIER` node.
3821 */
3822 __cypherlang_pure
3823 const cypher_astnode_t *cypher_ast_map_projection_identifier_get_identifier(
3824 const cypher_astnode_t *node);
3825
3826
3827 /**
3828 * Construct a `CYPHER_AST_MAP_PROJECTION_ALL_PROPERTIES` node.
3829 *
3830 * The node will also be an instance of `CYPHER_AST_MAP_PROJECTION_SELECTOR`.
3831 *
3832 * @param [children] The children of the node.
3833 * @param [nchildren] The number of children.
3834 * @param [range] The input range.
3835 * @return An AST node, or NULL if an error occurs (errno will be set).
3836 */
3837 __cypherlang_must_check
3838 cypher_astnode_t *cypher_ast_map_projection_all_properties(
3839 cypher_astnode_t **children, unsigned int nchildren,
3840 struct cypher_input_range range);
3841
3842
3843 /**
3844 * Construct a `CYPHER_AST_LABELS_OPERATOR` node.
3845 *
3846 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3847 *
3848 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3849 * @param [labels] Labels for the operator, all of type `CYPHER_AST_LABEL`.
3850 * @param [nlabels] The number of labels.
3851 * @param [children] The children of the node.
3852 * @param [nchildren] The number of children.
3853 * @param [range] The input range.
3854 * @return An AST node, or NULL if an error occurs (errno will be set).
3855 */
3856 __cypherlang_must_check
3857 cypher_astnode_t *cypher_ast_labels_operator(const cypher_astnode_t *expression,
3858 cypher_astnode_t * const *labels, unsigned int nlabels,
3859 cypher_astnode_t **children, unsigned int nchildren,
3860 struct cypher_input_range range);
3861
3862 /**
3863 * Get the expression of a `CYPHER_AST_PROPERTY_OPERATOR` node.
3864 *
3865 * If the node is not an instance of `CYPHER_AST_PROPERTY_OPERATOR` then the
3866 * result will be undefined.
3867 *
3868 * @param [node] The AST node.
3869 * @return A `CYPHER_AST_EXPRESSION` node.
3870 */
3871 __cypherlang_pure
3872 const cypher_astnode_t *cypher_ast_labels_operator_get_expression(
3873 const cypher_astnode_t *node);
3874
3875 /**
3876 * Get the number of labels from a `CYPHER_AST_LABELS_OPERATOR` node.
3877 *
3878 * If the node is not an instance of `CYPHER_AST_LABELS_OPERATOR` then the
3879 * result will be undefined.
3880 *
3881 * @param [node] The AST node.
3882 * @return The number of labels.
3883 */
3884 __cypherlang_pure
3885 unsigned int cypher_ast_labels_operator_nlabels(const cypher_astnode_t *node);
3886
3887 /**
3888 * Get a label from a `CYPHER_AST_LABELS_OPERATOR` node.
3889 *
3890 * If the node is not an instance of `CYPHER_AST_LABELS_OPERATOR` then the
3891 * result will be undefined.
3892 *
3893 * @param [node] The AST node.
3894 * @param [index] The index of the label.
3895 * @return A `CYPHER_AST_LABEL` node, or null.
3896 */
3897 __cypherlang_pure
3898 const cypher_astnode_t *cypher_ast_labels_operator_get_label(
3899 const cypher_astnode_t *node, unsigned int index);
3900
3901
3902 /**
3903 * Construct a `CYPHER_AST_LIST_COMPREHENSION` node.
3904 *
3905 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
3906 *
3907 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
3908 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3909 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
3910 * @param [eval] A `CYPHER_AST_EXPRESSION` node, or null.
3911 * @param [children] The children of the node.
3912 * @param [nchildren] The number of children.
3913 * @param [range] The input range.
3914 * @return An AST node, or NULL if an error occurs (errno will be set).
3915 */
3916 __cypherlang_must_check
3917 cypher_astnode_t *cypher_ast_list_comprehension(
3918 const cypher_astnode_t *identifier, const cypher_astnode_t *expression,
3919 const cypher_astnode_t *predicate, const cypher_astnode_t *eval,
3920 cypher_astnode_t **children, unsigned int nchildren,
3921 struct cypher_input_range range);
3922
3923 /**
3924 * Get the identifier from a `CYPHER_AST_LIST_COMPREHENSION` node.
3925 *
3926 * If the node is not an instance of `CYPHER_AST_LIST_COMPREHENSION` then the
3927 * result will be undefined.
3928 *
3929 * @param [node] The AST node.
3930 * @return A `CYPHER_AST_IDENTIFIER` node.
3931 */
3932 __cypherlang_pure
3933 const cypher_astnode_t *cypher_ast_list_comprehension_get_identifier(
3934 const cypher_astnode_t *node);
3935
3936 /**
3937 * Get the expression from a `CYPHER_AST_LIST_COMPREHENSION` node.
3938 *
3939 * If the node is not an instance of `CYPHER_AST_LIST_COMPREHENSION` then the
3940 * result will be undefined.
3941 *
3942 * @param [node] The AST node.
3943 * @return A `CYPHER_AST_EXPRESSION` node.
3944 */
3945 __cypherlang_pure
3946 const cypher_astnode_t *cypher_ast_list_comprehension_get_expression(
3947 const cypher_astnode_t *node);
3948
3949 /**
3950 * Get the predicate from a `CYPHER_AST_LIST_COMPREHENSION` node.
3951 *
3952 * If the node is not an instance of `CYPHER_AST_LIST_COMPREHENSION` then the
3953 * result will be undefined.
3954 *
3955 * @param [node] The AST node.
3956 * @return A `CYPHER_AST_EXPRESSION` node, or null.
3957 */
3958 __cypherlang_pure
3959 const cypher_astnode_t *cypher_ast_list_comprehension_get_predicate(
3960 const cypher_astnode_t *node);
3961
3962 /**
3963 * Get the evaluation from a `CYPHER_AST_LIST_COMPREHENSION` node.
3964 *
3965 * If the node is not an instance of `CYPHER_AST_LIST_COMPREHENSION` then the
3966 * result will be undefined.
3967 *
3968 * @param [node] The AST node.
3969 * @return A `CYPHER_AST_EXPRESSION` node, or null.
3970 */
3971 __cypherlang_pure
3972 const cypher_astnode_t *cypher_ast_list_comprehension_get_eval(
3973 const cypher_astnode_t *node);
3974
3975
3976 /**
3977 * Construct a `CYPHER_AST_FILTER` node.
3978 *
3979 * The node will also be an instance of `CYPHER_AST_LIST_COMPREHENSION`.
3980 *
3981 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
3982 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
3983 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
3984 * @param [children] The children of the node.
3985 * @param [nchildren] The number of children.
3986 * @param [range] The input range.
3987 * @return An AST node, or NULL if an error occurs (errno will be set).
3988 */
3989 __cypherlang_must_check
3990 cypher_astnode_t *cypher_ast_filter(const cypher_astnode_t *identifier,
3991 const cypher_astnode_t *expression, const cypher_astnode_t *predicate,
3992 cypher_astnode_t **children, unsigned int nchildren,
3993 struct cypher_input_range range);
3994
3995
3996 /**
3997 * Construct a `CYPHER_AST_EXTRACT` node.
3998 *
3999 * The node will also be an instance of `CYPHER_AST_LIST_COMPREHENSION`.
4000 *
4001 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
4002 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
4003 * @param [eval] A `CYPHER_AST_EXPRESSION` node, or null.
4004 * @param [children] The children of the node.
4005 * @param [nchildren] The number of children.
4006 * @param [range] The input range.
4007 * @return An AST node, or NULL if an error occurs (errno will be set).
4008 */
4009 __cypherlang_must_check
4010 cypher_astnode_t *cypher_ast_extract(const cypher_astnode_t *identifier,
4011 const cypher_astnode_t *expression, const cypher_astnode_t *eval,
4012 cypher_astnode_t **children, unsigned int nchildren,
4013 struct cypher_input_range range);
4014
4015
4016 /**
4017 * Construct a `CYPHER_AST_ALL` node.
4018 *
4019 * The node will also be an instance of `CYPHER_AST_LIST_COMPREHENSION`.
4020 *
4021 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
4022 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
4023 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
4024 * @param [children] The children of the node.
4025 * @param [nchildren] The number of children.
4026 * @param [range] The input range.
4027 * @return An AST node, or NULL if an error occurs (errno will be set).
4028 */
4029 __cypherlang_must_check
4030 cypher_astnode_t *cypher_ast_all(const cypher_astnode_t *identifier,
4031 const cypher_astnode_t *expression, const cypher_astnode_t *predicate,
4032 cypher_astnode_t **children, unsigned int nchildren,
4033 struct cypher_input_range range);
4034
4035
4036 /**
4037 * Construct a `CYPHER_AST_ANY` node.
4038 *
4039 * The node will also be an instance of `CYPHER_AST_LIST_COMPREHENSION`.
4040 *
4041 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
4042 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
4043 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
4044 * @param [children] The children of the node.
4045 * @param [nchildren] The number of children.
4046 * @param [range] The input range.
4047 * @return An AST node, or NULL if an error occurs (errno will be set).
4048 */
4049 __cypherlang_must_check
4050 cypher_astnode_t *cypher_ast_any(const cypher_astnode_t *identifier,
4051 const cypher_astnode_t *expression, const cypher_astnode_t *predicate,
4052 cypher_astnode_t **children, unsigned int nchildren,
4053 struct cypher_input_range range);
4054
4055
4056 /**
4057 * Construct a `CYPHER_AST_SINGLE` node.
4058 *
4059 * The node will also be an instance of `CYPHER_AST_LIST_COMPREHENSION`.
4060 *
4061 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
4062 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
4063 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
4064 * @param [children] The children of the node.
4065 * @param [nchildren] The number of children.
4066 * @param [range] The input range.
4067 * @return An AST node, or NULL if an error occurs (errno will be set).
4068 */
4069 __cypherlang_must_check
4070 cypher_astnode_t *cypher_ast_single(const cypher_astnode_t *identifier,
4071 const cypher_astnode_t *expression, const cypher_astnode_t *predicate,
4072 cypher_astnode_t **children, unsigned int nchildren,
4073 struct cypher_input_range range);
4074
4075
4076 /**
4077 * Construct a `CYPHER_AST_NONE` node.
4078 *
4079 * The node will also be an instance of `CYPHER_AST_LIST_COMPREHENSION`.
4080 *
4081 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
4082 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
4083 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
4084 * @param [children] The children of the node.
4085 * @param [nchildren] The number of children.
4086 * @param [range] The input range.
4087 * @return An AST node, or NULL if an error occurs (errno will be set).
4088 */
4089 __cypherlang_must_check
4090 cypher_astnode_t *cypher_ast_none(const cypher_astnode_t *identifier,
4091 const cypher_astnode_t *expression, const cypher_astnode_t *predicate,
4092 cypher_astnode_t **children, unsigned int nchildren,
4093 struct cypher_input_range range);
4094
4095
4096 /**
4097 * Construct a `CYPHER_AST_PATTERN_COMPREHENSION` node.
4098 *
4099 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4100 *
4101 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node, or null.
4102 * @param [pattern] A `CYPHER_AST_PATTERN` node.
4103 * @param [predicate] A `CYPHER_AST_EXPRESSION` node, or null.
4104 * @param [eval] A `CYPHER_AST_EXPRESSION` node.
4105 * @param [children] The children of the node.
4106 * @param [nchildren] The number of children.
4107 * @param [range] The input range.
4108 * @return An AST node, or NULL if an error occurs (errno will be set).
4109 */
4110 __cypherlang_must_check
4111 cypher_astnode_t *cypher_ast_pattern_comprehension(
4112 const cypher_astnode_t *identifier, const cypher_astnode_t *pattern,
4113 const cypher_astnode_t *predicate, const cypher_astnode_t *eval,
4114 cypher_astnode_t **children, unsigned int nchildren,
4115 struct cypher_input_range range);
4116
4117
4118 /**
4119 * Get the identifier from a `CYPHER_AST_PATTERN_COMPREHENSION` node.
4120 *
4121 * If the node is not an instance of `CYPHER_AST_PATTERN_COMPREHENSION` then the
4122 * result will be undefined.
4123 *
4124 * @param [node] The AST node.
4125 * @return A `CYPHER_AST_IDENTIFIER` node, or null.
4126 */
4127 __cypherlang_pure
4128 const cypher_astnode_t *cypher_ast_pattern_comprehension_get_identifier(
4129 const cypher_astnode_t *node);
4130
4131 /**
4132 * Get the expression from a `CYPHER_AST_PATTERN_COMPREHENSION` node.
4133 *
4134 * If the node is not an instance of `CYPHER_AST_PATTERN_COMPREHENSION` then the
4135 * result will be undefined.
4136 *
4137 * @param [node] The AST node.
4138 * @return A `CYPHER_AST_PATTERN_PATH` node.
4139 */
4140 __cypherlang_pure
4141 const cypher_astnode_t *cypher_ast_pattern_comprehension_get_pattern(
4142 const cypher_astnode_t *node);
4143
4144 /**
4145 * Get the predicate from a `CYPHER_AST_PATTERN_COMPREHENSION` node.
4146 *
4147 * If the node is not an instance of `CYPHER_AST_PATTERN_COMPREHENSION` then the
4148 * result will be undefined.
4149 *
4150 * @param [node] The AST node.
4151 * @return A `CYPHER_AST_EXPRESSION` node, or null.
4152 */
4153 __cypherlang_pure
4154 const cypher_astnode_t *cypher_ast_pattern_comprehension_get_predicate(
4155 const cypher_astnode_t *node);
4156
4157 /**
4158 * Get the evaluation from a `CYPHER_AST_PATTERN_COMPREHENSION` node.
4159 *
4160 * If the node is not an instance of `CYPHER_AST_PATTERN_COMPREHENSION` then the
4161 * result will be undefined.
4162 *
4163 * @param [node] The AST node.
4164 * @return A `CYPHER_AST_EXPRESSION` node.
4165 */
4166 __cypherlang_pure
4167 const cypher_astnode_t *cypher_ast_pattern_comprehension_get_eval(
4168 const cypher_astnode_t *node);
4169
4170
4171 /**
4172 * Construct a `CYPHER_AST_REDUCE` node.
4173 *
4174 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4175 *
4176 * @param [accumulator] A `CYPHER_AST_IDENTIFIER` node.
4177 * @param [init] A `CYPHER_AST_EXPRESSION` node.
4178 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
4179 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
4180 * @param [eval] A `CYPHER_AST_EXPRESSION` node, or null.
4181 * @param [children] The children of the node.
4182 * @param [nchildren] The number of children.
4183 * @param [range] The input range.
4184 * @return An AST node, or NULL if an error occurs (errno will be set).
4185 */
4186 __cypherlang_must_check
4187 cypher_astnode_t *cypher_ast_reduce(const cypher_astnode_t *accumulator,
4188 const cypher_astnode_t *init, const cypher_astnode_t *identifier,
4189 const cypher_astnode_t *expression, const cypher_astnode_t *eval,
4190 cypher_astnode_t **children, unsigned int nchildren,
4191 struct cypher_input_range range);
4192
4193 /**
4194 * Get the accumulator from a `CYPHER_AST_REDUCE` node.
4195 *
4196 * If the node is not an instance of `CYPHER_AST_REDUCE` then the
4197 * result will be undefined.
4198 *
4199 * @param [node] The AST node.
4200 * @return A `CYPHER_AST_IDENTIFIER` node.
4201 */
4202 __cypherlang_pure
4203 const cypher_astnode_t *cypher_ast_reduce_get_accumulator(
4204 const cypher_astnode_t *node);
4205
4206 /**
4207 * Get the accumulator init expression from a `CYPHER_AST_REDUCE` node.
4208 *
4209 * If the node is not an instance of `CYPHER_AST_REDUCE` then the
4210 * result will be undefined.
4211 *
4212 * @param [node] The AST node.
4213 * @return A `CYPHER_AST_EXPRESSION` node.
4214 */
4215 __cypherlang_pure
4216 const cypher_astnode_t *cypher_ast_reduce_get_init(
4217 const cypher_astnode_t *node);
4218
4219 /**
4220 * Get the identifier from a `CYPHER_AST_REDUCE` node.
4221 *
4222 * If the node is not an instance of `CYPHER_AST_REDUCE` then the
4223 * result will be undefined.
4224 *
4225 * @param [node] The AST node.
4226 * @return A `CYPHER_AST_IDENTIFIER` node.
4227 */
4228 __cypherlang_pure
4229 const cypher_astnode_t *cypher_ast_reduce_get_identifier(
4230 const cypher_astnode_t *node);
4231
4232 /**
4233 * Get the expression from a `CYPHER_AST_REDUCE` node.
4234 *
4235 * If the node is not an instance of `CYPHER_AST_REDUCE` then the
4236 * result will be undefined.
4237 *
4238 * @param [node] The AST node.
4239 * @return A `CYPHER_AST_EXPRESSION` node.
4240 */
4241 __cypherlang_pure
4242 const cypher_astnode_t *cypher_ast_reduce_get_expression(
4243 const cypher_astnode_t *node);
4244
4245 /**
4246 * Get the evaluation from a `CYPHER_AST_REDUCE` node.
4247 *
4248 * If the node is not an instance of `CYPHER_AST_REDUCE` then the
4249 * result will be undefined.
4250 *
4251 * @param [node] The AST node.
4252 * @return A `CYPHER_AST_EXPRESSION` node, or null.
4253 */
4254 __cypherlang_pure
4255 const cypher_astnode_t *cypher_ast_reduce_get_eval(
4256 const cypher_astnode_t *node);
4257
4258
4259 /**
4260 * Construct a `CYPHER_AST_CASE` node.
4261 *
4262 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4263 *
4264 * @param [expression] A `CYPHER_AST_EXPRESSION` node.
4265 * @param [alternatives] An alternating list of predicate expressions and
4266 * values, all of type `CYPHER_AST_EXPRESSION`.
4267 * @param [nalternatives] The number of predicate and result pairs.
4268 * @param [deflt] A `CYPHER_AST_EXPRESSION` node, or `NULL`.
4269 * @param [children] The children of the node.
4270 * @param [nchildren] The number of children.
4271 * @param [range] The input range.
4272 * @return An AST node, or NULL if an error occurs (errno will be set).
4273 */
4274 __cypherlang_must_check
4275 cypher_astnode_t *cypher_ast_case(const cypher_astnode_t *expression,
4276 cypher_astnode_t * const *alternatives, unsigned int nalternatives,
4277 const cypher_astnode_t *deflt, cypher_astnode_t **children,
4278 unsigned int nchildren, struct cypher_input_range range);
4279
4280 /**
4281 * Get the expression from a `CYPHER_AST_CASE` node.
4282 *
4283 * If the node is not an instance of `CYPHER_AST_CASE` then the
4284 * result will be undefined.
4285 *
4286 * @param [node] The AST node.
4287 * @return A `CYPHER_AST_EXPRESSION` node.
4288 */
4289 __cypherlang_pure
4290 const cypher_astnode_t *cypher_ast_case_get_expression(
4291 const cypher_astnode_t *node);
4292
4293 /**
4294 * Get the number of alternatives from a `CYPHER_AST_CASE` node.
4295 *
4296 * If the node is not an instance of `CYPHER_AST_CASE` then the
4297 * result will be undefined.
4298 *
4299 * @param [node] The AST node.
4300 * @return The number of alternatives.
4301 */
4302 __cypherlang_pure
4303 unsigned int cypher_ast_case_nalternatives(const cypher_astnode_t *node);
4304
4305 /**
4306 * Get a predicate from a `CYPHER_AST_CASE` node.
4307 *
4308 * If the node is not an instance of `CYPHER_AST_CASE` then the
4309 * result will be undefined.
4310 *
4311 * @param [node] The AST node.
4312 * @param [index] The index of the alternative.
4313 * @return A `CYPHER_AST_EXPRESSION` node, or null.
4314 */
4315 __cypherlang_pure
4316 const cypher_astnode_t *cypher_ast_case_get_predicate(
4317 const cypher_astnode_t *node, unsigned int index);
4318
4319 /**
4320 * Get a value from a `CYPHER_AST_CASE` node.
4321 *
4322 * If the node is not an instance of `CYPHER_AST_CASE` then the
4323 * result will be undefined.
4324 *
4325 * @param [node] The AST node.
4326 * @param [index] The index of the alternative.
4327 * @return A `CYPHER_AST_EXPRESSION` node, or null.
4328 */
4329 __cypherlang_pure
4330 const cypher_astnode_t *cypher_ast_case_get_value(
4331 const cypher_astnode_t *node, unsigned int index);
4332
4333 /**
4334 * Get the default from a `CYPHER_AST_CASE` node.
4335 *
4336 * If the node is not an instance of `CYPHER_AST_CASE` then the
4337 * result will be undefined.
4338 *
4339 * @param [node] The AST node.
4340 * @return A `CYPHER_AST_EXPRESSION` node, or null.
4341 */
4342 __cypherlang_pure
4343 const cypher_astnode_t *cypher_ast_case_get_default(
4344 const cypher_astnode_t *node);
4345
4346
4347 /**
4348 * Construct a `CYPHER_AST_COLLECTION` node.
4349 *
4350 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4351 *
4352 * @param [elements] The elements for the collection.
4353 * @param [nelements] The number of elements.
4354 * @param [children] The children of the node.
4355 * @param [nchildren] The number of children.
4356 * @param [range] The input range.
4357 * @return An AST node, or NULL if an error occurs (errno will be set).
4358 */
4359 __cypherlang_must_check
4360 cypher_astnode_t *cypher_ast_collection(
4361 cypher_astnode_t * const *elements, unsigned int nelements,
4362 cypher_astnode_t **children, unsigned int nchildren,
4363 struct cypher_input_range range);
4364
4365 /**
4366 * Get the collection length from a `CYPHER_AST_COLLECTION` node.
4367 *
4368 * If the node is not an instance of `CYPHER_AST_COLLECTION` then the result will
4369 * be undefined.
4370 *
4371 * @param [node] The AST node.
4372 * @return The length of the collection.
4373 */
4374 __cypherlang_pure
4375 unsigned int cypher_ast_collection_length(const cypher_astnode_t *node);
4376
4377 /**
4378 * Get an element from a `CYPHER_AST_COLLECTION` node.
4379 *
4380 * If the node is not an instance of `CYPHER_AST_COLLECTION` then the result will
4381 * be undefined.
4382 *
4383 * @param [node] The AST node.
4384 * @param [index] The index of the element.
4385 * @return A pointer to the element of the collection, or `NULL` if there is no
4386 * element at the specified index.
4387 */
4388 __cypherlang_pure
4389 const cypher_astnode_t *cypher_ast_collection_get(const cypher_astnode_t *node,
4390 unsigned int index);
4391
4392
4393 /**
4394 * Construct a `CYPHER_AST_MAP` node.
4395 *
4396 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4397 *
4398 * @param [keys] The keys for the map, all of type `CYPHER_AST_PROP_NAME`.
4399 * @param [values] The values for the map, all of type `CYPEHR_AST_EXPRESSION`.
4400 * @param [nentries] The number of keys and values.
4401 * @param [children] The children of the node.
4402 * @param [nchildren] The number of children.
4403 * @param [range] The input range.
4404 * @return An AST node, or NULL if an error occurs (errno will be set).
4405 */
4406 cypher_astnode_t *cypher_ast_map(cypher_astnode_t * const *keys,
4407 cypher_astnode_t * const *values, unsigned int nentries,
4408 cypher_astnode_t **children, unsigned int nchildren,
4409 struct cypher_input_range range);
4410
4411 /**
4412 * Construct a `CYPHER_AST_MAP` node.
4413 *
4414 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4415 *
4416 * @param [pairs] An alternating list of keys for the map, of type
4417 * `CYPHER_AST_PROP_NAME`, and values for the map, of type
4418 * `CYPHER_AST_EXPRESSION`.
4419 * @param [nentries] The number of pairs (i.e. `pairs` must contain
4420 * `nentries*2` pointers).
4421 * @param [children] The children of the node.
4422 * @param [nchildren] The number of children.
4423 * @param [range] The input range.
4424 * @return An AST node, or NULL if an error occurs (errno will be set).
4425 */
4426 __cypherlang_must_check
4427 cypher_astnode_t *cypher_ast_pair_map(cypher_astnode_t * const *pairs,
4428 unsigned int nentries, cypher_astnode_t **children,
4429 unsigned int nchildren, struct cypher_input_range range);
4430
4431 /**
4432 * Get the number of entries in a `CYPHER_AST_MAP` node.
4433 *
4434 * If the node is not an instance of `CYPHER_AST_MAP` then the result will
4435 * be undefined.
4436 *
4437 * @param [node] The AST node.
4438 * @return The number of entries.
4439 */
4440 __cypherlang_pure
4441 unsigned int cypher_ast_map_nentries(const cypher_astnode_t *node);
4442
4443 /**
4444 * Get a key from a `CYPHER_AST_MAP` node.
4445 *
4446 * If the node is not an instance of `CYPHER_AST_MAP` then the
4447 * result will be undefined.
4448 *
4449 * @param [node] The AST node.
4450 * @param [index] The index of the entry.
4451 * @return A `CYPHER_AST_PROP_NAME` node.
4452 */
4453 __cypherlang_pure
4454 const cypher_astnode_t *cypher_ast_map_get_key(const cypher_astnode_t *node,
4455 unsigned int index);
4456
4457 /**
4458 * Get a value from a `CYPHER_AST_MAP` node.
4459 *
4460 * If the node is not an instance of `CYPHER_AST_MAP` then the
4461 * result will be undefined.
4462 *
4463 * @param [node] The AST node.
4464 * @param [index] The index of the entry.
4465 * @return A `CYPHER_AST_EXPRESSION` node.
4466 */
4467 __cypherlang_pure
4468 const cypher_astnode_t *cypher_ast_map_get_value(
4469 const cypher_astnode_t *node, unsigned int index);
4470
4471
4472 /**
4473 * Construct a `CYPHER_AST_IDENTIFIER` node.
4474 *
4475 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4476 *
4477 * @param [s] A pointer to a character string containing the identifier name.
4478 * @param [n] The length of the character string.
4479 * @param [range] The input range.
4480 * @return An AST node, or NULL if an error occurs (errno will be set).
4481 */
4482 __cypherlang_must_check
4483 cypher_astnode_t *cypher_ast_identifier(const char *s, size_t n,
4484 struct cypher_input_range range);
4485
4486 /**
4487 * Get a null terminated name string for a `CYPHER_AST_IDENTIFIER` node.
4488 *
4489 * If the node is not an instance of `CYPHER_AST_IDENTIFIER` then the result
4490 * will be undefined.
4491 *
4492 * @param [node] The AST node.
4493 * @return A pointer to the null terminated string.
4494 */
4495 __cypherlang_pure
4496 const char *cypher_ast_identifier_get_name(const cypher_astnode_t *node);
4497
4498
4499 /**
4500 * Construct a `CYPHER_AST_PARAMETER` node.
4501 *
4502 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4503 *
4504 * @param [s] A pointer to a character string containing the identifier name.
4505 * @param [n] The length of the character string.
4506 * @param [range] The input range.
4507 * @return An AST node, or NULL if an error occurs (errno will be set).
4508 */
4509 __cypherlang_must_check
4510 cypher_astnode_t *cypher_ast_parameter(const char *s, size_t n,
4511 struct cypher_input_range range);
4512
4513 /**
4514 * Get a null terminated name string for a `CYPHER_AST_PARAMETER` node.
4515 *
4516 * If the node is not an instance of `CYPHER_AST_PARAMETER` then the result
4517 * will be undefined.
4518 *
4519 * @param [node] The AST node.
4520 * @return A pointer to the null terminated string.
4521 */
4522 __cypherlang_pure
4523 const char *cypher_ast_parameter_get_name(const cypher_astnode_t *node);
4524
4525
4526 /**
4527 * Construct a `CYPHER_AST_STRING` node.
4528 *
4529 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4530 *
4531 * @param [s] A pointer to a character string.
4532 * @param [n] The length of the character string.
4533 * @param [range] The input range.
4534 * @return An AST node, or NULL if an error occurs (errno will be set).
4535 */
4536 __cypherlang_must_check
4537 cypher_astnode_t *cypher_ast_string(const char *s, size_t n,
4538 struct cypher_input_range range);
4539
4540 /**
4541 * Get the null terminated string value from a `CYPHER_AST_STRING` node.
4542 *
4543 * If the node is not an instance of `CYPHER_AST_STRING` then the result will
4544 * be undefined.
4545 *
4546 * @param [node] The AST node.
4547 * @return A pointer to the null terminated string.
4548 */
4549 __cypherlang_pure
4550 const char *cypher_ast_string_get_value(const cypher_astnode_t *node);
4551
4552
4553 /**
4554 * Construct a `CYPHER_AST_INTEGER` node.
4555 *
4556 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4557 *
4558 * @param [s] A pointer to a character string.
4559 * @param [n] The length of the character string.
4560 * @param [range] The input range.
4561 * @return An AST node, or NULL if an error occurs (errno will be set).
4562 */
4563 __cypherlang_must_check
4564 cypher_astnode_t *cypher_ast_integer(const char *s, size_t n,
4565 struct cypher_input_range range);
4566
4567 /**
4568 * Get the null terminated string value from a `CYPHER_AST_INTEGER` node.
4569 *
4570 * If the node is not an instance of `CYPHER_AST_INTEGER` then the result will
4571 * be undefined.
4572 *
4573 * @param [node] The AST node.
4574 * @return A pointer to the null terminated string.
4575 */
4576 __cypherlang_pure
4577 const char *cypher_ast_integer_get_valuestr(const cypher_astnode_t *node);
4578
4579
4580 /**
4581 * Construct a `CYPHER_AST_FLOAT` node.
4582 *
4583 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4584 *
4585 * @param [s] A pointer to a character string.
4586 * @param [n] The length of the character string.
4587 * @param [range] The input range.
4588 * @return An AST node, or NULL if an error occurs (errno will be set).
4589 */
4590 __cypherlang_must_check
4591 cypher_astnode_t *cypher_ast_float(const char *s, size_t n,
4592 struct cypher_input_range range);
4593
4594 /**
4595 * Get the null terminated string value from a `CYPHER_AST_FLOAT` node.
4596 *
4597 * If the node is not an instance of `CYPHER_AST_FLOAT` then the result will
4598 * be undefined.
4599 *
4600 * @param [node] The AST node.
4601 * @return A pointer to the null terminated string.
4602 */
4603 __cypherlang_pure
4604 const char *cypher_ast_float_get_valuestr(const cypher_astnode_t *node);
4605
4606
4607 /**
4608 * Construct a `CYPHER_AST_TRUE` node.
4609 *
4610 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4611 *
4612 * @param [range] The input range.
4613 * @return An AST node, or NULL if an error occurs (errno will be set).
4614 */
4615 __cypherlang_must_check
4616 cypher_astnode_t *cypher_ast_true(struct cypher_input_range range);
4617
4618
4619 /**
4620 * Construct a `CYPHER_AST_FALSE` node.
4621 *
4622 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4623 *
4624 * @param [range] The input range.
4625 * @return An AST node, or NULL if an error occurs (errno will be set).
4626 */
4627 __cypherlang_must_check
4628 cypher_astnode_t *cypher_ast_false(struct cypher_input_range range);
4629
4630
4631 /**
4632 * Construct a `CYPHER_AST_NULL` node.
4633 *
4634 * The node will also be an instance of `CYPHER_AST_EXPRESSION`.
4635 *
4636 * @param [range] The input range.
4637 * @return An AST node, or NULL if an error occurs (errno will be set).
4638 */
4639 __cypherlang_must_check
4640 cypher_astnode_t *cypher_ast_null(struct cypher_input_range range);
4641
4642
4643 /**
4644 * Construct a `CYPHER_AST_LABEL` node.
4645 *
4646 * @param [s] A pointer to a character string containing the label name.
4647 * @param [n] The length of the character string.
4648 * @param [range] The input range.
4649 * @return An AST node, or NULL if an error occurs (errno will be set).
4650 */
4651 __cypherlang_must_check
4652 cypher_astnode_t *cypher_ast_label(const char *s, size_t n,
4653 struct cypher_input_range range);
4654
4655 /**
4656 * Get a null terminated name string for a `CYPHER_AST_LABEL` node.
4657 *
4658 * If the node is not an instance of `CYPHER_AST_LABEL` then the result will
4659 * be undefined.
4660 *
4661 * @param [node] The AST node.
4662 * @return A pointer to the null terminated string.
4663 */
4664 __cypherlang_pure
4665 const char *cypher_ast_label_get_name(const cypher_astnode_t *node);
4666
4667
4668 /**
4669 * Construct a `CYPHER_AST_RELTYPE` node.
4670 *
4671 * @param [s] A pointer to a character string containing the label name.
4672 * @param [n] The length of the character string.
4673 * @param [range] The input range.
4674 * @return An AST node, or NULL if an error occurs (errno will be set).
4675 */
4676 __cypherlang_must_check
4677 cypher_astnode_t *cypher_ast_reltype(const char *s, size_t n,
4678 struct cypher_input_range range);
4679
4680 /**
4681 * Get a null terminated name string for a `CYPHER_AST_RELTYPE` node.
4682 *
4683 * If the node is not an instance of `CYPHER_AST_RELTYPE` then the result will
4684 * be undefined.
4685 *
4686 * @param [node] The AST node.
4687 * @return A pointer to the null terminated string.
4688 */
4689 __cypherlang_pure
4690 const char *cypher_ast_reltype_get_name(const cypher_astnode_t *node);
4691
4692
4693 /**
4694 * Construct a `CYPHER_AST_PROP_NAME` node.
4695 *
4696 * @param [s] A pointer to a character string containing the property name.
4697 * @param [n] The length of the character string.
4698 * @param [range] The input range.
4699 * @return An AST node, or NULL if an error occurs (errno will be set).
4700 */
4701 __cypherlang_must_check
4702 cypher_astnode_t *cypher_ast_prop_name(const char *s, size_t n,
4703 struct cypher_input_range range);
4704
4705 /**
4706 * Get a null terminated name string for a `CYPHER_AST_PROP_NAME` node.
4707 *
4708 * If the node is not an instance of `CYPHER_AST_PROP_NAME` then the result will
4709 * be undefined.
4710 *
4711 * @param [node] The AST node.
4712 * @return A pointer to the null terminated string.
4713 */
4714 __cypherlang_pure
4715 const char *cypher_ast_prop_name_get_value(const cypher_astnode_t *node);
4716
4717
4718 /**
4719 * Construct a `CYPHER_AST_FUNCTION_NAME` node.
4720 *
4721 * @param [s] A pointer to a character string containing the function name.
4722 * @param [n] The length of the character string.
4723 * @param [range] The input range.
4724 * @return An AST node, or NULL if an error occurs (errno will be set).
4725 */
4726 __cypherlang_must_check
4727 cypher_astnode_t *cypher_ast_function_name(const char *s, size_t n,
4728 struct cypher_input_range range);
4729
4730 /**
4731 * Get a null terminated name string for a `CYPHER_AST_FUNCTION_NAME` node.
4732 *
4733 * If the node is not an instance of `CYPHER_AST_FUNCTION_NAME` then the result
4734 * will be undefined.
4735 *
4736 * @param [node] The AST node.
4737 * @return A pointer to the null terminated string.
4738 */
4739 __cypherlang_pure
4740 const char *cypher_ast_function_name_get_value(const cypher_astnode_t *node);
4741
4742
4743 /**
4744 * Construct a `CYPHER_AST_INDEX_NAME` node.
4745 *
4746 * @param [s] A pointer to a character string containing the index name.
4747 * @param [n] The length of the character string.
4748 * @param [range] The input range.
4749 * @return An AST node, or NULL if an error occurs (errno will be set).
4750 */
4751 __cypherlang_must_check
4752 cypher_astnode_t *cypher_ast_index_name(const char *s, size_t n,
4753 struct cypher_input_range range);
4754
4755 /**
4756 * Get a null terminated name string for a `CYPHER_AST_INDEX_NAME` node.
4757 *
4758 * If the node is not an instance of `CYPHER_AST_INDEX_NAME` then the result
4759 * will be undefined.
4760 *
4761 * @param [node] The AST node.
4762 * @return A pointer to the null terminated string.
4763 */
4764 __cypherlang_pure
4765 const char *cypher_ast_index_name_get_value(const cypher_astnode_t *node);
4766
4767
4768 /**
4769 * Construct a `CYPHER_AST_PROC_NAME` node.
4770 *
4771 * @param [s] A pointer to a character string containing the proc name.
4772 * @param [n] The length of the character string.
4773 * @param [range] The input range.
4774 * @return An AST node, or NULL if an error occurs (errno will be set).
4775 */
4776 __cypherlang_must_check
4777 cypher_astnode_t *cypher_ast_proc_name(const char *s, size_t n,
4778 struct cypher_input_range range);
4779
4780 /**
4781 * Get a null terminated name string for a `CYPHER_AST_PROC_NAME` node.
4782 *
4783 * If the node is not an instance of `CYPHER_AST_PROC_NAME` then the result
4784 * will be undefined.
4785 *
4786 * @param [node] The AST node.
4787 * @return A pointer to the null terminated string.
4788 */
4789 __cypherlang_pure
4790 const char *cypher_ast_proc_name_get_value(const cypher_astnode_t *node);
4791
4792
4793 /**
4794 * Construct a `CYPHER_AST_PATTERN` node.
4795 *
4796 * @param [paths] The paths in the pattern, which must be all of type
4797 * `CYPHER_AST_PATTERN_PATH`.
4798 * @param [npaths] The number of paths.
4799 * @param [children] The children of the node.
4800 * @param [nchildren] The number of children.
4801 * @param [range] The input range.
4802 * @return An AST node, or NULL if an error occurs (errno will be set).
4803 */
4804 __cypherlang_must_check
4805 cypher_astnode_t *cypher_ast_pattern(cypher_astnode_t * const *paths,
4806 unsigned int npaths, cypher_astnode_t **children,
4807 unsigned int nchildren, struct cypher_input_range range);
4808
4809 /**
4810 * Get the number of paths in a `CYPHER_AST_PATTERN` node.
4811 *
4812 * If the node is not an instance of `CYPHER_AST_PATTERN` then the result will
4813 * be undefined.
4814 *
4815 * @param [node] The AST node.
4816 * @return The number of paths.
4817 */
4818 __cypherlang_pure
4819 unsigned int cypher_ast_pattern_npaths(const cypher_astnode_t *node);
4820
4821 /**
4822 * Get a path from a `CYPHER_AST_PATTERN` node.
4823 *
4824 * If the node is not an instance of `CYPHER_AST_PATTERN` then the result will
4825 * be undefined.
4826 *
4827 * @param [node] The AST node.
4828 * @param [index] The index of the path.
4829 * @return A `CYPHER_AST_PATTERN_PATH` node, or null.
4830 */
4831 __cypherlang_pure
4832 const cypher_astnode_t *cypher_ast_pattern_get_path(
4833 const cypher_astnode_t *node, unsigned int index);
4834
4835
4836 /**
4837 * Construct a `CYPHER_AST_NAMED_PATH` node.
4838 *
4839 * The node will also be an instance of `CYPHER_AST_PATTERN_PATH`.
4840 *
4841 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node.
4842 * @param [path] A `CYPHER_AST_PATTERN_PATH` node.
4843 * @param [children] The children of the node.
4844 * @param [nchildren] The number of children.
4845 * @param [range] The input range.
4846 * @return An AST node, or NULL if an error occurs (errno will be set).
4847 */
4848 __cypherlang_must_check
4849 cypher_astnode_t *cypher_ast_named_path(const cypher_astnode_t *identifier,
4850 const cypher_astnode_t *path, cypher_astnode_t **children,
4851 unsigned int nchildren, struct cypher_input_range range);
4852
4853 /**
4854 * Get the identifier from a `CYPHER_AST_NAMED_PATH` node.
4855 *
4856 * If the node is not an instance of `CYPHER_AST_NAMED_PATH` then the result
4857 * will be undefined.
4858 *
4859 * @param [node] The AST node.
4860 * @return A `CYPHER_AST_IDENTIFIER` node.
4861 */
4862 __cypherlang_pure
4863 const cypher_astnode_t *cypher_ast_named_path_get_identifier(
4864 const cypher_astnode_t *node);
4865
4866 /**
4867 * Get the unnamed pattern path from a `CYPHER_AST_NAMED_PATH` node.
4868 *
4869 * If the node is not an instance of `CYPHER_AST_NAMED_PATH` then the result
4870 * will be undefined.
4871 *
4872 * @param [node] The AST node.
4873 * @return A `CYPHER_AST_PATTERN_PATH` node.
4874 */
4875 __cypherlang_pure
4876 const cypher_astnode_t *cypher_ast_named_path_get_path(
4877 const cypher_astnode_t *node);
4878
4879
4880 /**
4881 * Construct a `CYPHER_AST_SHORTEST_PATH` node.
4882 *
4883 * The node will also be an instance of `CYPHER_AST_PATTERN_PATH` and
4884 * `CYPHER_AST_EXPRESSION`.
4885 *
4886 * @param [single] true if `shortestPath`, and false if `allShortestPaths`.
4887 * @param [path] A `CYPHER_AST_PATTERN_PATH` node.
4888 * @param [children] The children of the node.
4889 * @param [nchildren] The number of children.
4890 * @param [range] The input range.
4891 * @return An AST node, or NULL if an error occurs (errno will be set).
4892 */
4893 __cypherlang_must_check
4894 cypher_astnode_t *cypher_ast_shortest_path(bool single,
4895 const cypher_astnode_t *path, cypher_astnode_t **children,
4896 unsigned int nchildren, struct cypher_input_range range);
4897
4898 /**
4899 * Check if a `CYPHER_AST_SHORTEST_PATH` node is for a single path.
4900 *
4901 * If the node is not an instance of `CYPHER_AST_SHORTEST_PATH` then the result
4902 * will be undefined.
4903 *
4904 * @param [node] The AST node.
4905 * @return true if `shortestPath`, and false if `allShortestPaths`.
4906 */
4907 __cypherlang_pure
4908 bool cypher_ast_shortest_path_is_single(const cypher_astnode_t *node);
4909
4910 /**
4911 * Get the unnamed pattern path from a `CYPHER_AST_SHORTEST_PATH` node.
4912 *
4913 * If the node is not an instance of `CYPHER_AST_SHORTEST_PATH` then the result
4914 * will be undefined.
4915 *
4916 * @param [node] The AST node.
4917 * @return A `CYPHER_AST_PATTERN_PATH` node.
4918 */
4919 __cypherlang_pure
4920 const cypher_astnode_t *cypher_ast_shortest_path_get_path(
4921 const cypher_astnode_t *node);
4922
4923
4924 /**
4925 * Construct a `CYPHER_AST_PATTERN_PATH` node.
4926 *
4927 * @param [elements] The elements in the pattern, which must be of alternating
4928 * types `CYPHER_AST_NODE_PATTERN` and `CYPHER_AST_REL_PATTERN`.
4929 * @param [nelements] The number of elements in the path, which must be odd.
4930 * @param [children] The children of the node.
4931 * @param [nchildren] The number of children.
4932 * @param [range] The input range.
4933 * @return An AST node, or NULL if an error occurs (errno will be set).
4934 */
4935 __cypherlang_must_check
4936 cypher_astnode_t *cypher_ast_pattern_path(cypher_astnode_t * const *elements,
4937 unsigned int nelements, cypher_astnode_t **children,
4938 unsigned int nchildren, struct cypher_input_range range);
4939
4940 /**
4941 * Get the number of elements in a `CYPHER_AST_PATTERN_PATH` node.
4942 *
4943 * If the node is not an instance of `CYPHER_AST_PATTERN_PATH` then the result
4944 * will be undefined.
4945 *
4946 * @param [node] The AST node.
4947 * @return The number of elements, which will be odd.
4948 */
4949 __cypherlang_pure
4950 unsigned int cypher_ast_pattern_path_nelements(const cypher_astnode_t *node);
4951
4952 /**
4953 * Get an element from a `CYPHER_AST_PATTERN_PATH` node.
4954 *
4955 * If the node is not an instance of `CYPHER_AST_PATTERN_PATH` then the result
4956 * will be undefined.
4957 *
4958 * @param [node] The AST node.
4959 * @param [index] The index of the element.
4960 * @return Either a `CYPHER_AST_NODE_PATTERN` node or a
4961 * `CYPHER_AST_REL_PATTERN` node, depending on whether the index
4962 * is even or odd respectively, or null if the index is larger than the
4963 * number of elements..
4964 */
4965 __cypherlang_pure
4966 const cypher_astnode_t *cypher_ast_pattern_path_get_element(
4967 const cypher_astnode_t *node, unsigned int index);
4968
4969
4970 /**
4971 * Construct a `CYPHER_AST_NODE_PATTERN` node.
4972 *
4973 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node, or null.
4974 * @param [labels] The labels in the pattern, which must all be of type
4975 * `CYPHER_AST_LABEL`.
4976 * @param [nlabels] The number of labels in the pattern.
4977 * @param [properties] A `CYPHER_AST_MAP` node, a `CYPHER_AST_PARAMETER` node,
4978 * or null.
4979 * @param [children] The children of the node.
4980 * @param [nchildren] The number of children.
4981 * @param [range] The input range.
4982 * @return An AST node, or NULL if an error occurs (errno will be set).
4983 */
4984 __cypherlang_must_check
4985 cypher_astnode_t *cypher_ast_node_pattern(const cypher_astnode_t *identifier,
4986 cypher_astnode_t * const *labels, unsigned int nlabels,
4987 const cypher_astnode_t *properties, cypher_astnode_t **children,
4988 unsigned int nchildren, struct cypher_input_range range);
4989
4990 /**
4991 * Get the identifier of a `CYPHER_AST_NODE_PATTERN` node.
4992 *
4993 * If the node is not an instance of `CYPHER_AST_NODE_PATTERN` then the result
4994 * will be undefined.
4995 *
4996 * @param [node] The AST node.
4997 * @return A `CYPHER_AST_IDENTIFIER` node, or null.
4998 */
4999 __cypherlang_pure
5000 const cypher_astnode_t *cypher_ast_node_pattern_get_identifier(
5001 const cypher_astnode_t *node);
5002
5003 /**
5004 * Get the number of labels in a `CYPHER_AST_NODE_PATTERN` node.
5005 *
5006 * If the node is not an instance of `CYPHER_AST_NODE_PATTERN` then the result
5007 * will be undefined.
5008 *
5009 * @param [node] The AST node.
5010 * @return The number of labels.
5011 */
5012 __cypherlang_pure
5013 unsigned int cypher_ast_node_pattern_nlabels(const cypher_astnode_t *node);
5014
5015 /**
5016 * Get a label from a `CYPHER_AST_NODE_PATTERN` node.
5017 *
5018 * If the node is not an instance of `CYPHER_AST_NODE_PATTERN` then the result
5019 * will be undefined.
5020 *
5021 * @param [node] The AST node.
5022 * @param [index] The index of the label.
5023 * @return A `CYPHER_AST_LABEL` node, or null.
5024 */
5025 __cypherlang_pure
5026 const cypher_astnode_t *cypher_ast_node_pattern_get_label(
5027 const cypher_astnode_t *node, unsigned int index);
5028
5029 /**
5030 * Get the properties of a `CYPHER_AST_NODE_PATTERN` node.
5031 *
5032 * If the node is not an instance of `CYPHER_AST_NODE_PATTERN` then the result
5033 * will be undefined.
5034 *
5035 * @param [node] The AST node.
5036 * @return A `CYPHER_AST_MAP` node, a `CYPHER_AST_PARAMETER` node, or null.
5037 */
5038 __cypherlang_pure
5039 const cypher_astnode_t *cypher_ast_node_pattern_get_properties(
5040 const cypher_astnode_t *node);
5041
5042
5043 /**
5044 * Construct a `CYPHER_AST_REL_PATTERN` node.
5045 *
5046 * @param [direction] The direction of the relationship.
5047 * @param [identifier] A `CYPHER_AST_IDENTIFIER` node, or null.
5048 * @param [reltypes] The relationship types in the pattern, all of type
5049 * `CYPHER_AST_RELTYPE`.
5050 * @param [nreltypes] The number of relationship types in the pattern.
5051 * @param [properties] A `CYPHER_AST_MAP` node, a `CYPHER_AST_PARAMETER` node,
5052 * or null.
5053 * @param [varlength] A `CYPHER_AST_RANGE` node, or null.
5054 * @param [children] The children of the node.
5055 * @param [nchildren] The number of children.
5056 * @param [range] The input range.
5057 * @return An AST node, or NULL if an error occurs (errno will be set).
5058 */
5059 __cypherlang_must_check
5060 cypher_astnode_t *cypher_ast_rel_pattern(enum cypher_rel_direction direction,
5061 const cypher_astnode_t *identifier, cypher_astnode_t * const *reltypes,
5062 unsigned int nreltypes, const cypher_astnode_t *properties,
5063 const cypher_astnode_t *varlength, cypher_astnode_t **children,
5064 unsigned int nchildren, struct cypher_input_range range);
5065
5066
5067 /**
5068 * Get the direction of a `CYPHER_AST_REL_PATTERN` node.
5069 *
5070 * If the node is not an instance of `CYPHER_AST_REL_PATTERN` then the result
5071 * will be undefined.
5072 *
5073 * @param [node] The AST node.
5074 * @return The direction of the relationship.
5075 */
5076 __cypherlang_pure
5077 enum cypher_rel_direction cypher_ast_rel_pattern_get_direction(
5078 const cypher_astnode_t *node);
5079
5080 /**
5081 * Get the identifier of a `CYPHER_AST_REL_PATTERN` node.
5082 *
5083 * If the node is not an instance of `CYPHER_AST_REL_PATTERN` then the result
5084 * will be undefined.
5085 *
5086 * @param [node] The AST node.
5087 * @return A `CYPHER_AST_IDENTIFIER` node, or null.
5088 */
5089 __cypherlang_pure
5090 const cypher_astnode_t *cypher_ast_rel_pattern_get_identifier(
5091 const cypher_astnode_t *node);
5092
5093 /**
5094 * Get the number of reltypes in a `CYPHER_AST_REL_PATTERN` node.
5095 *
5096 * If the node is not an instance of `CYPHER_AST_REL_PATTERN` then the result
5097 * will be undefined.
5098 *
5099 * @param [node] The AST node.
5100 * @return The number of reltypes.
5101 */
5102 __cypherlang_pure
5103 unsigned int cypher_ast_rel_pattern_nreltypes(const cypher_astnode_t *node);
5104
5105 /**
5106 * Get a reltypes from a `CYPHER_AST_REL_PATTERN` node.
5107 *
5108 * If the node is not an instance of `CYPHER_AST_REL_PATTERN` then the result
5109 * will be undefined.
5110 *
5111 * @param [node] The AST node.
5112 * @param [index] The index of the reltypes.
5113 * @return A `CYPHER_AST_LABEL` node, or null.
5114 */
5115 __cypherlang_pure
5116 const cypher_astnode_t *cypher_ast_rel_pattern_get_reltype(
5117 const cypher_astnode_t *node, unsigned int index);
5118
5119 /**
5120 * Get the varlength range of a `CYPHER_AST_REL_PATTERN` node.
5121 *
5122 * If the node is not an instance of `CYPHER_AST_REL_PATTERN` then the result
5123 * will be undefined.
5124 *
5125 * @param [node] The AST node.
5126 * @return A `CYPHER_AST_RANGE` node, or null.
5127 */
5128 __cypherlang_pure
5129 const cypher_astnode_t *cypher_ast_rel_pattern_get_varlength(
5130 const cypher_astnode_t *node);
5131
5132 /**
5133 * Get the properties of a `CYPHER_AST_REL_PATTERN` node.
5134 *
5135 * If the node is not an instance of `CYPHER_AST_REL_PATTERN` then the result
5136 * will be undefined.
5137 *
5138 * @param [node] The AST node.
5139 * @return A `CYPHER_AST_MAP` node, a `CYPHER_AST_PARAMETER` node, or null.
5140 */
5141 __cypherlang_pure
5142 const cypher_astnode_t *cypher_ast_rel_pattern_get_properties(
5143 const cypher_astnode_t *node);
5144
5145
5146 /**
5147 * Construct a `CYPHER_AST_RANGE` node.
5148 *
5149 * @param [start] A `CYPHER_AST_INTEGER`, or null.
5150 * @param [end] A `CYPHER_AST_INTEGER`, or null.
5151 * @param [children] The children of the node.
5152 * @param [nchildren] The number of children.
5153 * @param [range] The input range.
5154 * @return An AST node, or NULL if an error occurs (errno will be set).
5155 */
5156 __cypherlang_must_check
5157 cypher_astnode_t *cypher_ast_range(const cypher_astnode_t *start,
5158 const cypher_astnode_t *end, cypher_astnode_t **children,
5159 unsigned int nchildren, struct cypher_input_range range);
5160
5161 /**
5162 * Get the start of a `CYPHER_AST_RANGE` node.
5163 *
5164 * If the node is not an instance of `CYPHER_AST_RANGE` then the result
5165 * will be undefined.
5166 *
5167 * @param [node] The AST node.
5168 * @return A `CYPHER_AST_RANGE` node, or null.
5169 */
5170 __cypherlang_pure
5171 const cypher_astnode_t *cypher_ast_range_get_start(
5172 const cypher_astnode_t *node);
5173
5174 /**
5175 * Get the end of a `CYPHER_AST_RANGE` node.
5176 *
5177 * If the node is not an instance of `CYPHER_AST_RANGE` then the result
5178 * will be undefined.
5179 *
5180 * @param [node] The AST node.
5181 * @return A `CYPHER_AST_RANGE` node, or null.
5182 */
5183 __cypherlang_pure
5184 const cypher_astnode_t *cypher_ast_range_get_end(
5185 const cypher_astnode_t *node);
5186
5187
5188 /**
5189 * Construct a `CYPHER_AST_COMMAND` node.
5190 *
5191 * @param [name] A `CYPHER_AST_STRING` node.
5192 * @param [args] Arguments for the command, all of type `CYPHER_AST_STRING`.
5193 * @param [nargs] The number of clauses.
5194 * @param [children] The children of the node.
5195 * @param [nchildren] The number of children.
5196 * @param [range] The input range.
5197 * @return An AST node, or NULL if an error occurs (errno will be set).
5198 */
5199 __cypherlang_must_check
5200 cypher_astnode_t *cypher_ast_command(const cypher_astnode_t *name,
5201 cypher_astnode_t * const *args, unsigned int nargs,
5202 cypher_astnode_t **children, unsigned int nchildren,
5203 struct cypher_input_range range);
5204
5205 /**
5206 * Get the name from a CYPHER_AST_COMMAND node.
5207 *
5208 * If the node is not an instance of `CYPHER_AST_COMMAND` then the result will
5209 * be undefined.
5210 *
5211 * @param [node] The AST node.
5212 * @return A pointer to the name of the command, which will be of type
5213 * `CYPHER_AST_STRING`.
5214 */
5215 __cypherlang_pure
5216 const cypher_astnode_t *cypher_ast_command_get_name(
5217 const cypher_astnode_t *node);
5218
5219 /**
5220 * Get the number of arguments from a CYPHER_AST_COMMAND node.
5221 *
5222 * If the node is not an instance of `CYPHER_AST_COMMAND` then the result will
5223 * be undefined.
5224 *
5225 * @param [node] The AST node.
5226 * @return The number of arguments to the command.
5227 */
5228 __cypherlang_pure
5229 unsigned int cypher_ast_command_narguments(const cypher_astnode_t *node);
5230
5231 /**
5232 * Get an argument from a CYPHER_AST_COMMAND node.
5233 *
5234 * If the node is not an instance of `CYPHER_AST_COMMAND` then the result will
5235 * be undefined.
5236 *
5237 * @param [node] The AST node.
5238 * @param [index] The index of the argument.
5239 * @return A pointer to the argument of the command, which will be of type
5240 * `CYPHER_AST_STRING`, or `NULL` if there is no argument at the
5241 * specified index.
5242 */
5243 __cypherlang_pure
5244 const cypher_astnode_t *cypher_ast_command_get_argument(
5245 const cypher_astnode_t *node, unsigned int index);
5246
5247
5248 /**
5249 * Construct a `CYPHER_AST_LINE_COMMENT` node.
5250 *
5251 * The node will also be an instance of `CYPHER_AST_COMMENT`.
5252 *
5253 * @param [s] A pointer to a character string containing the comment.
5254 * @param [n] The length of the character string.
5255 * @param [range] The input range.
5256 * @return An AST node, or NULL if an error occurs (errno will be set).
5257 */
5258 __cypherlang_must_check
5259 cypher_astnode_t *cypher_ast_line_comment(const char *s, size_t n,
5260 struct cypher_input_range range);
5261
5262 /**
5263 * Get a null terminated string for a `CYPHER_AST_LINE_COMMENT` node.
5264 *
5265 * If the node is not an instance of `CYPHER_AST_LINE_COMMENT` then the result
5266 * will be undefined.
5267 *
5268 * @param [node] The AST node.
5269 * @return A pointer to the null terminated string.
5270 */
5271 __cypherlang_pure
5272 const char *cypher_ast_line_comment_get_value(const cypher_astnode_t *node);
5273
5274
5275 /**
5276 * Construct a `CYPHER_AST_BLOCK_COMMENT` node.
5277 *
5278 * The node will also be an instance of `CYPHER_AST_COMMENT`.
5279 *
5280 * @param [s] A pointer to a character string containing the comment.
5281 * @param [n] The length of the character string.
5282 * @param [range] The input range.
5283 * @return An AST node, or NULL if an error occurs (errno will be set).
5284 */
5285 __cypherlang_must_check
5286 cypher_astnode_t *cypher_ast_block_comment(const char *s, size_t n,
5287 struct cypher_input_range range);
5288
5289 /**
5290 * Get a null terminated string for a `CYPHER_AST_BLOCK_COMMENT` node.
5291 *
5292 * If the node is not an instance of `CYPHER_AST_BLOCK_COMMENT` then the result
5293 * will be undefined.
5294 *
5295 * @param [node] The AST node.
5296 * @return A pointer to the null terminated string.
5297 */
5298 __cypherlang_pure
5299 const char *cypher_ast_block_comment_get_value(const cypher_astnode_t *node);
5300
5301
5302 /**
5303 * Construct a `CYPHER_AST_ERROR` node.
5304 *
5305 * @param [s] A pointer to a character string containing the erroneous input.
5306 * @param [n] The length of the character string.
5307 * @param [range] The input range.
5308 * @return An AST node, or NULL if an error occurs (errno will be set).
5309 */
5310 __cypherlang_must_check
5311 cypher_astnode_t *cypher_ast_error(const char *s, size_t n,
5312 struct cypher_input_range range);
5313
5314 /**
5315 * Get a null terminated string for a `CYPHER_AST_ERROR` node.
5316 *
5317 * If the node is not an instance of `CYPHER_AST_BLOCK_COMMENT` then the result
5318 * will be undefined.
5319 *
5320 * @param [node] The AST node.
5321 * @return A pointer to the null terminated string.
5322 */
5323 __cypherlang_pure
5324 const char *cypher_ast_error_get_value(const cypher_astnode_t *node);
5325
5326
5327 /**
5328 * Release an entire AST tree.
5329 *
5330 * @param [ast] The root of the AST tree.
5331 */
5332 void cypher_ast_free(cypher_astnode_t *ast);
5333
5334
5335 #define CYPHER_AST_RENDER_DEFAULT 0
5336
5337 /**
5338 * Print a represetation of an AST to a stream.
5339 *
5340 * Useful for debugging purposes.
5341 *
5342 * @param [ast] The AST node.
5343 * @param [stream] The stream to print to.
5344 * @param [width] The width to render, which is advisory and may be exceeded.
5345 * A value of 0 implies no restriction on width.
5346 * @param [colorization] A colorization scheme to apply, or null.
5347 * @param [flags] A bitmask of flags to control rendering.
5348 * @return 0 on success, or -1 if an error occurs (errno will be set).
5349 */
5350 int cypher_ast_fprint(const cypher_astnode_t *ast, FILE *stream,
5351 unsigned int width,
5352 const struct cypher_parser_colorization *colorization,
5353 uint_fast32_t flags);
5354
5355
5356 /*
5357 * =====================================
5358 * parser
5359 * =====================================
5360 */
5361
5362 /**
5363 * Configuration for a cypher parser.
5364 */
5365 typedef struct cypher_parser_config cypher_parser_config_t;
5366
5367 /**
5368 * Generate a new parser configuration.
5369 *
5370 * The returned configuration must be later released using
5371 * cypher_parser_config_free().
5372 *
5373 * @return A pointer to a new parser configuration, or `NULL` if an error
5374 * occurs (errno will be set).
5375 */
5376 __cypherlang_must_check
5377 cypher_parser_config_t *cypher_parser_new_config(void);
5378
5379 /**
5380 * Release a parser configuration.
5381 *
5382 * @param [config] A pointer to a parser configuration. This pointer will
5383 * be invalid after the function returns.
5384 */
5385 void cypher_parser_config_free(cypher_parser_config_t *config);
5386
5387 /**
5388 * Set the initial input position for parsing.
5389 *
5390 * By default, the initial position is line 1, column 1 (offset 0). By setting
5391 * a different position, all ranges in the AST, and positions in any error
5392 * messages, will be offset by the specified position - as if the input had
5393 * contained unparsed whitespace up until that point.
5394 *
5395 * @param [config] The parser configuration.
5396 * @param [position] The initial input position.
5397 */
5398 void cypher_parser_config_set_initial_position(cypher_parser_config_t *config,
5399 struct cypher_input_position position);
5400
5401 /**
5402 * Set the initial ordinal for parsing.
5403 *
5404 * All AST nodes parsed will be numbered starting from the specified initial
5405 * ordinal, which is 0 by default. This affects the numbering of AST nodes
5406 * in rendering.
5407 *
5408 * @param [config] The parser configuration.
5409 * @param [n] The initial oridinal.
5410 */
5411 void cypher_parser_config_set_initial_ordinal(cypher_parser_config_t *config,
5412 unsigned int n);
5413
5414
5415 /**
5416 * Set the colorization scheme for error messages.
5417 *
5418 * @param [config] The parser configuration.
5419 * @param [colorization] The colorization scheme to use.
5420 */
5421 void cypher_parser_config_set_error_colorization(cypher_parser_config_t *config,
5422 const struct cypher_parser_colorization *colorization);
5423
5424 /**
5425 * A parse segment.
5426 */
5427 typedef struct cypher_parse_segment cypher_parse_segment_t;
5428
5429 /**
5430 * A parse result.
5431 */
5432 typedef struct cypher_parse_result cypher_parse_result_t;
5433
5434 /**
5435 * A parse error.
5436 */
5437 typedef struct cypher_parse_error cypher_parse_error_t;
5438
5439
5440 /**
5441 * A parse callback.
5442 */
5443 typedef int (*cypher_parser_segment_callback_t)(void *userdata,
5444 cypher_parse_segment_t *segment);
5445
5446
5447 #define CYPHER_PARSE_DEFAULT 0
5448 #define CYPHER_PARSE_SINGLE (1<<0)
5449 #define CYPHER_PARSE_ONLY_STATEMENTS (1<<1)
5450
5451
5452 /**
5453 * @fn int cypher_parse_each(const char *s, cypher_parser_segment_callback_t callback, void *userdata, struct cypher_input_position *last, cypher_parser_config_t *config, uint_fast32_t flags);
5454 * @brief Parse segments from a string.
5455 *
5456 * The provided callback is invoked for every segment of parsed input, where
5457 * each segments is separated by either a newline or semicolon (`;`),
5458 * respectively depending on whether a client command is being parsed or not.
5459 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, then only semicolons will
5460 * be used for delimiting segments, and client commands will not be parsed.
5461 *
5462 * The segment will be released after the callback is complete, unless retained
5463 * using cypher_parse_segment_retain().
5464 *
5465 * @param [s] A null terminated string to parse.
5466 * @param [callback] The callback to be invoked for each parsed segment.
5467 * @param [userdata] A pointer that will be provided to the callback.
5468 * @param [last] Either `NULL`, or a pointer to a `struct cypher_input_position`
5469 * that will be set position of the last character consumed from the
5470 * input.
5471 * @param [config] Either `NULL`, or a pointer to configuration for the parser.
5472 * @param [flags] A bitmask of flags to control parsing.
5473 * @return 0 on success, -1 on failure (errno will be set).
5474 */
5475 #define cypher_parse_each(s,b,d,l,c,f) (cypher_uparse_each(s,strlen(s),b,d,l,c,f))
5476
5477 /**
5478 * @fn cypher_parse_result_t *cypher_parse(const char *s, struct cypher_input_position *last, cypher_parser_config_t *config, uint_fast32_t flags);
5479 * @brief Parse a command or statement from a string.
5480 *
5481 * All statements and/or client commands are parsed from the input string, and
5482 * a result returned. The result must be passed to
5483 * cypher_parse_result_free() to release dynamically allocated memory.
5484 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, client commands will not be
5485 * parsed.
5486 *
5487 * @param [s] A null terminated string to parse.
5488 * @param [last] Either `NULL`, or a pointer to a `struct cypher_input_position`
5489 * that will be set position of the last character consumed from the
5490 * input.
5491 * @param [config] Either `NULL`, or a pointer to configuration for the parser.
5492 * @param [flags] A bitmask of flags to control parsing.
5493 * @return A pointer to a `cypher_parse_result_t`, or `NULL` if an error occurs
5494 * (errno will be set).
5495 */
5496 #define cypher_parse(s,l,c,f) (cypher_uparse(s,strlen(s),l,c,f))
5497
5498 /**
5499 * Parse segments from a string.
5500 *
5501 * The provided callback is invoked for every segment of parsed input, where
5502 * each segments is separated by either a newline or semicolon (`;`),
5503 * respectively depending on whether a client command is being parsed or not.
5504 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, then only semicolons will
5505 * be used for delimiting segments, and client commands will not be parsed.
5506 *
5507 * The segment will be released after the callback is complete, unless retained
5508 * using cypher_parse_segment_retain().
5509 *
5510 * @param [s] The string to parse.
5511 * @param [n] The size of the string.
5512 * @param [callback] The callback to be invoked for each parsed segment.
5513 * @param [userdata] A pointer that will be provided to the callback.
5514 * @param [last] Either `NULL`, or a pointer to a `struct cypher_input_position`
5515 * that will be set position of the last character consumed from the
5516 * input.
5517 * @param [config] Either `NULL`, or a pointer to configuration for the parser.
5518 * @param [flags] A bitmask of flags to control parsing.
5519 * @return A pointer to a `cypher_parse_result_t`, or `NULL` if an error occurs
5520 * (errno will be set).
5521 */
5522 __cypherlang_must_check
5523 int cypher_uparse_each(const char *s, size_t n,
5524 cypher_parser_segment_callback_t callback, void *userdata,
5525 struct cypher_input_position *last, cypher_parser_config_t *config,
5526 uint_fast32_t flags);
5527
5528 /**
5529 * Parse a statement or command from a string.
5530 *
5531 * All statements and/or client commands are parsed from the input string, and
5532 * a result returned. The result must be passed to
5533 * cypher_parse_result_free() to release dynamically allocated memory.
5534 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, client commands will not be
5535 * parsed.
5536 *
5537 * @param [s] The string to parse.
5538 * @param [n] The size of the string.
5539 * @param [last] Either `NULL`, or a pointer to a `struct cypher_input_position`
5540 * that will be set position of the last character consumed from the
5541 * input.
5542 * @param [config] Either `NULL`, or a pointer to configuration for the parser.
5543 * @param [flags] A bitmask of flags to control parsing.
5544 * @return A pointer to a `cypher_parse_result_t`, or `NULL` if an error occurs
5545 * (errno will be set).
5546 */
5547 __cypherlang_must_check
5548 cypher_parse_result_t *cypher_uparse(const char *s, size_t n,
5549 struct cypher_input_position *last, cypher_parser_config_t *config,
5550 uint_fast32_t flags);
5551
5552 /**
5553 * Parse segments from a stream.
5554 *
5555 * The provided callback is invoked for every segment of parsed input, where
5556 * each segments is separated by either a newline or semicolon (`;`),
5557 * respectively depending on whether a client command is being parsed or not.
5558 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, then only semicolons will
5559 * be used for delimiting segments, and client commands will not be parsed.
5560 *
5561 * The segment will be released after the callback is complete, unless retained
5562 * using cypher_parse_segment_retain().
5563 *
5564 * @param [stream] The stream to parse.
5565 * @param [callback] The callback to be invoked for each parsed segment.
5566 * @param [userdata] A pointer that will be provided to the callback.
5567 * @param [last] Either `NULL`, or a pointer to a `struct cypher_input_position`
5568 * that will be set position of the last character consumed from the
5569 * input.
5570 * @param [config] Either `NULL`, or a pointer to configuration for the parser.
5571 * @param [flags] A bitmask of flags to control parsing.
5572 * @return A pointer to a `cypher_parse_result_t`, or `NULL` if an error occurs
5573 * (errno will be set).
5574 */
5575 __cypherlang_must_check
5576 int cypher_fparse_each(FILE *stream, cypher_parser_segment_callback_t callback,
5577 void *userdata, struct cypher_input_position *last,
5578 cypher_parser_config_t *config, uint_fast32_t flags);
5579
5580 /**
5581 * Parse a statement or command from a stream.
5582 *
5583 * All statements and/or client commands are parsed from the input string, and
5584 * a result returned. The result must be passed to
5585 * cypher_parse_result_free() to release dynamically allocated memory.
5586 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, client commands will not be
5587 * parsed.
5588 *
5589 * @param [stream] The stream to parse.
5590 * @param [last] Either `NULL`, or a pointer to a `struct cypher_input_position`
5591 * that will be set position of the last character consumed from the
5592 * input.
5593 * @param [config] Either `NULL`, or a pointer to configuration for the parser.
5594 * @param [flags] A bitmask of flags to control parsing.
5595 * @return A pointer to a `cypher_parse_result_t`, or `NULL` if an error occurs
5596 * (errno will be set).
5597 */
5598 __cypherlang_must_check
5599 cypher_parse_result_t *cypher_fparse(FILE *stream,
5600 struct cypher_input_position *last, cypher_parser_config_t *config,
5601 uint_fast32_t flags);
5602
5603
5604 /**
5605 * Get the range of a parse segment.
5606 *
5607 * @param [segment] The parse segment.
5608 * @return The input range.
5609 */
5610 __cypherlang_pure
5611 struct cypher_input_range cypher_parse_segment_get_range(
5612 const cypher_parse_segment_t *segment);
5613
5614 /**
5615 * Get the number of errors encountered in a parse segment.
5616 *
5617 * @param [segment] The parse segment.
5618 * @return The number of errors.
5619 */
5620 __cypherlang_pure
5621 unsigned int cypher_parse_segment_nerrors(
5622 const cypher_parse_segment_t *segment);
5623
5624 /**
5625 * Get an error from a parse segment.
5626 *
5627 * @param [segment] The parse segment.
5628 * @param [index] The error index.
5629 * @return A pointer to the error description, or `NULL` if there is no error
5630 * at the specified index.
5631 */
5632 __cypherlang_pure
5633 const cypher_parse_error_t *cypher_parse_segment_get_error(
5634 const cypher_parse_segment_t *segment, unsigned int index);
5635
5636 /**
5637 * Get the number of root AST nodes parsed in a segment.
5638 *
5639 * @param [segment] The parse segment.
5640 * @return The number of root AST nodes.
5641 */
5642 __cypherlang_pure
5643 unsigned int cypher_parse_segment_nroots(const cypher_parse_segment_t *segment);
5644
5645 /**
5646 * Get a root AST node from a parse segment.
5647 *
5648 * @param [segment] The parse segment.
5649 * @param [index] The node index.
5650 * @return A pointer to the AST node, or `NULL` if there is no node at the
5651 * specified index.
5652 */
5653 __cypherlang_pure
5654 const cypher_astnode_t *cypher_parse_segment_get_root(
5655 const cypher_parse_segment_t *segment, unsigned int index);
5656
5657 /**
5658 * Get the total number of AST nodes parsed in a segment.
5659 *
5660 * Includes all root nodes and their children, at any depth.
5661 *
5662 * @param [segment] The parse segment.
5663 * @return The number of elements.
5664 */
5665 __cypherlang_pure
5666 unsigned int cypher_parse_segment_nnodes(const cypher_parse_segment_t *segment);
5667
5668 /**
5669 * Get the statement or client command parsed in a segment.
5670 *
5671 * @param [segment] The parse segment.
5672 * @return Either a CYPHER_AST_STATEMENT, a CYPHER_AST_COMMAND node,
5673 * or `NULL` if neither was encountered in the segment.
5674 */
5675 __cypherlang_pure
5676 const cypher_astnode_t *cypher_parse_segment_get_directive(
5677 const cypher_parse_segment_t *segment);
5678
5679 /**
5680 * Check if the parse encountered the end of the input.
5681 *
5682 * Indicates if the segment was terminated by to the end of the input.
5683 *
5684 * @param [segment] The parse segment.
5685 * @return `true` if the end of input was encountered, `false` if the
5686 * segment was terminated with an expected character.
5687 */
5688 __cypherlang_pure
5689 bool cypher_parse_segment_is_eof(const cypher_parse_segment_t *segment);
5690
5691 /**
5692 * Print a represetation of the AST from a parse segment to a stream.
5693 *
5694 * Useful for debugging purposes.
5695 *
5696 * @param [segment] The parse segment.
5697 * @param [stream] The stream to print to.
5698 * @param [width] The width to render, which is advisory and may be exceeded.
5699 * A value of 0 implies no restriction on width.
5700 * @param [colorization] A colorization scheme to apply, or null.
5701 * @param [flags] A bitmask of flags to control rendering.
5702 * @return 0 on success, or -1 if an error occurs (errno will be set).
5703 */
5704 int cypher_parse_segment_fprint_ast(const cypher_parse_segment_t *segment,
5705 FILE *stream, unsigned int width,
5706 const struct cypher_parser_colorization *colorization,
5707 uint_fast32_t flags);
5708
5709 /**
5710 * Retain a reference to a parse segment.
5711 *
5712 * The segment must later be passed to cypher_parse_segment_release().
5713 *
5714 * @param [segment] The parse segment.
5715 */
5716 void cypher_parse_segment_retain(cypher_parse_segment_t *segment);
5717
5718
5719 /**
5720 * Release a reference to a parse segment.
5721 *
5722 * The segment must have been previously retained using
5723 * cypher_parse_segment_retain().
5724 *
5725 * @param [segment] The parse segment.
5726 */
5727 void cypher_parse_segment_release(cypher_parse_segment_t *segment);
5728
5729
5730 /**
5731 * Get the number of root AST nodes parsed.
5732 *
5733 * @param [result] The parse result.
5734 * @return The number of root AST nodes.
5735 */
5736 __cypherlang_pure
5737 unsigned int cypher_parse_result_nroots(const cypher_parse_result_t *result);
5738
5739 /**
5740 * Get a root AST nodes from a parse result.
5741 *
5742 * @param [result] The parse result.
5743 * @param [index] The node index.
5744 * @return A pointer to the AST node, or `NULL` if there is no element at the
5745 * specified index.
5746 */
5747 __cypherlang_pure
5748 const cypher_astnode_t *cypher_parse_result_get_root(
5749 const cypher_parse_result_t *result, unsigned int index);
5750
5751 /**
5752 * Get the total number of AST nodes parsed.
5753 *
5754 * Includes all children, at any depth, of all result elements.
5755 *
5756 * @param [result] The parse result.
5757 * @return The number of elements.
5758 */
5759 __cypherlang_pure
5760 unsigned int cypher_parse_result_nnodes(const cypher_parse_result_t *result);
5761
5762 /**
5763 * Get the number of statements or commands parsed.
5764 *
5765 * @param [result] The parse result.
5766 * @return The number of statements or commands parsed.
5767 */
5768 __cypherlang_pure
5769 unsigned int cypher_parse_result_ndirectives(
5770 const cypher_parse_result_t *result);
5771
5772 /**
5773 * Get the AST for a parsed statement or command from a parse result.
5774 *
5775 * @param [result] The parse result.
5776 * @param [index] The directive index.
5777 * @return Either a CYPHER_AST_STATEMENT, a CYPHER_AST_COMMAND node,
5778 * or `NULL` if there is no directive at the specified index.
5779 */
5780 __cypherlang_pure
5781 const cypher_astnode_t *cypher_parse_result_get_directive(
5782 const cypher_parse_result_t *result, unsigned int index);
5783
5784 /**
5785 * Get the number of errors encountered during parsing.
5786 *
5787 * @param [result] The parse result.
5788 * @return The number of errors.
5789 */
5790 __cypherlang_pure
5791 unsigned int cypher_parse_result_nerrors(const cypher_parse_result_t *result);
5792
5793 /**
5794 * Get an error description from a parse result.
5795 *
5796 * @param [result] The parse result.
5797 * @param [index] The error index.
5798 * @return A pointer to the error description, or `NULL` if there is no value
5799 * at the specified index.
5800 */
5801 __cypherlang_pure
5802 const cypher_parse_error_t *cypher_parse_result_get_error(
5803 const cypher_parse_result_t *result, unsigned int index);
5804
5805 /**
5806 * Check if the parse encountered the end of the input.
5807 *
5808 * Indicates if the last parsed command or statement was terminated
5809 * (with a newline or `;` respectively), or with EOF.
5810 *
5811 * @param [result] The parse result.
5812 * @return `true` if the end of input was encountered, `false` if the
5813 * command or statement was terminated with the expected character.
5814 */
5815 __cypherlang_pure
5816 bool cypher_parse_result_eof(const cypher_parse_result_t *result);
5817
5818
5819 /**
5820 * Print a represetation of a parse result to a stream.
5821 *
5822 * Useful for debugging purposes.
5823 *
5824 * @param [result] The parse result.
5825 * @param [stream] The stream to print to.
5826 * @param [width] The width to render, which is advisory and may be exceeded.
5827 * A value of 0 implies no restriction on width.
5828 * @param [colorization] A colorization scheme to apply, or null.
5829 * @param [flags] A bitmask of flags to control rendering.
5830 * @return 0 on success, or -1 if an error occurs (errno will be set).
5831 */
5832 int cypher_parse_result_fprint_ast(const cypher_parse_result_t *result,
5833 FILE *stream, unsigned int width,
5834 const struct cypher_parser_colorization *colorization,
5835 uint_fast32_t flags);
5836
5837 /**
5838 * Free memory associated with a parse result.
5839 *
5840 * The result will no longer be valid after this function is invoked.
5841 *
5842 * @param [result] The parse result.
5843 */
5844 void cypher_parse_result_free(cypher_parse_result_t *result);
5845
5846
5847 /**
5848 * Get the position of an error.
5849 *
5850 * @param [error] The parse error.
5851 * @return The input position.
5852 */
5853 __cypherlang_pure
5854 struct cypher_input_position cypher_parse_error_position(
5855 const cypher_parse_error_t *error);
5856
5857 /**
5858 * Get the error message of an error.
5859 *
5860 * @param [error] The parse error.
5861 * @return The message.
5862 */
5863 __cypherlang_pure
5864 const char *cypher_parse_error_message(const cypher_parse_error_t *error);
5865
5866 /**
5867 * Get the error context of an error.
5868 *
5869 * This returns a pointer to a null-terminated string, which contains a
5870 * section of the input around where the error occurred, that is limited
5871 * in length and suitable for presentation to a user.
5872 *
5873 * @param [error] The parse error.
5874 * @return The context string.
5875 */
5876 __cypherlang_pure
5877 const char *cypher_parse_error_context(const cypher_parse_error_t *error);
5878
5879 /**
5880 * Get the offset into the context of an error.
5881 *
5882 * Identifies the point of the error within the context string, allowing
5883 * this to be reported to the user, typically with an arrow pointing to the
5884 * invalid character.
5885 *
5886 * @param [error] The parse error.
5887 * @return The offset into the errors context string.
5888 */
5889 __cypherlang_pure
5890 size_t cypher_parse_error_context_offset(const cypher_parse_error_t *error);
5891
5892
5893 /*
5894 * ====================================
5895 * quick parser
5896 * ====================================
5897 */
5898
5899 /**
5900 * A quick parse segment.
5901 */
5902 typedef struct cypher_quick_parse_segment cypher_quick_parse_segment_t;
5903
5904
5905 /**
5906 * A quick parse callback.
5907 */
5908 typedef int (*cypher_parser_quick_segment_callback_t)(void *userdata,
5909 const cypher_quick_parse_segment_t *segment);
5910
5911 /**
5912 * @fn int cypher_quick_parse(const char *s, cypher_parser_quick_segment_callback_t callback, void *userdata, uint_fast32_t flags);
5913 * @brief Quick parse segments from a string.
5914 *
5915 * The provided callback is invoked for every segment of parsed input, where
5916 * each segments is separated by either a newline or semicolon (`;`),
5917 * respectively depending on whether a client command is being parsed or not.
5918 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, then only semicolons will
5919 * be used for delimiting segments, and client commands will not be parsed.
5920 *
5921 * @param [s] The string to parse.
5922 * @param [callback] The callback to be invoked for each parsed segment.
5923 * @param [userdata] A pointer that will be provided to the callback.
5924 * @param [flags] A bitmask of flags to control parsing.
5925 * @return 0 on success, or -1 on failure (errno will be set).
5926 */
5927 #define cypher_quick_parse(s,c,u,f) (cypher_quick_uparse(s,strlen(s),c,u,f))
5928
5929 /**
5930 * Quick parse segments from a string.
5931 *
5932 * The provided callback is invoked for every segment of parsed input, where
5933 * each segments is separated by either a newline or semicolon (`;`),
5934 * respectively depending on whether a client command is being parsed or not.
5935 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, then only semicolons will
5936 * be used for delimiting segments, and client commands will not be parsed.
5937 *
5938 * @param [s] The string to parse.
5939 * @param [n] The size of the string.
5940 * @param [callback] The callback to be invoked for each parsed segment.
5941 * @param [userdata] A pointer that will be provided to the callback.
5942 * @param [flags] A bitmask of flags to control parsing.
5943 * @return 0 on success, or -1 on failure (errno will be set).
5944 */
5945 __cypherlang_must_check
5946 int cypher_quick_uparse(const char *s, size_t n,
5947 cypher_parser_quick_segment_callback_t callback, void *userdata,
5948 uint_fast32_t flags);
5949
5950 /**
5951 * Quick parse a statement or command from a stream.
5952 *
5953 * The provided callback is invoked for every segment of parsed input, where
5954 * each segments is separated by either a newline or semicolon (`;`),
5955 * respectively depending on whether a client command is being parsed or not.
5956 * If the flag CYPHER_PARSE_ONLY_STATEMENTS is set, then only semicolons will
5957 * be used for delimiting segments, and client commands will not be parsed.
5958 *
5959 * @param [stream] The stream to parse.
5960 * @param [callback] The callback to be invoked for each parsed segment.
5961 * @param [userdata] A pointer that will be provided to the callback.
5962 * @param [flags] A bitmask of flags to control parsing.
5963 * @return 0 on success, or -1 on failure (errno will be set).
5964 */
5965 int cypher_quick_fparse(FILE *stream,
5966 cypher_parser_quick_segment_callback_t callback, void *userdata,
5967 uint_fast32_t flags);
5968
5969 /**
5970 * Check if the quick parse segment is for a statement.
5971 *
5972 * @param [segment] The quick parse segment.
5973 * @return `true` if the parsed segment was for a statement
5974 * (vs a command), `false` otherwise.
5975 */
5976 __cypherlang_pure
5977 bool cypher_quick_parse_segment_is_statement(
5978 const cypher_quick_parse_segment_t *segment);
5979
5980 /**
5981 * Check if the quick parse segment is for a command.
5982 *
5983 * @param [segment] The quick parse segment.
5984 * @return `true` if the parsed segment was for a command
5985 * (vs a statement), `false` otherwise.
5986 */
5987 __cypherlang_pure
5988 bool cypher_quick_parse_segment_is_command(
5989 const cypher_quick_parse_segment_t *segment);
5990
5991 /**
5992 * Get the character string of a segment.
5993 *
5994 * Will include all characters within the parsed statement or command,
5995 * excepting any leading or trailing comments or whitespace.
5996 *
5997 * @param [segment] The quick parse segment.
5998 * @param [n] A `size_t` pointer that will be updated to the length of the
5999 * character string.
6000 * @return A pointer to a character string.
6001 */
6002 const char *cypher_quick_parse_segment_get_text(
6003 const cypher_quick_parse_segment_t *segment, size_t *n);
6004
6005 /**
6006 * Get the range of a quick parse segment.
6007 *
6008 * @param [segment] The quick parse segment.
6009 * @return The input range.
6010 */
6011 __cypherlang_pure
6012 struct cypher_input_range cypher_quick_parse_segment_get_range(
6013 const cypher_quick_parse_segment_t *segment);
6014
6015 /**
6016 * Get the next input position that will be parsed.
6017 *
6018 * @param [segment] The parse segment.
6019 * @return The input position.
6020 */
6021 __cypherlang_pure
6022 struct cypher_input_position cypher_quick_parse_segment_get_next(
6023 const cypher_quick_parse_segment_t *segment);
6024
6025 /**
6026 * Check if the quick parse encountered the end of the input.
6027 *
6028 * Indicates if the segment was terminated by to the end of the input.
6029 *
6030 * @param [segment] The quick parse segment.
6031 * @return `true` if the end of input was encountered, `false` if the
6032 * segment was terminated with an expected character.
6033 */
6034 __cypherlang_pure
6035 bool cypher_quick_parse_segment_is_eof(
6036 const cypher_quick_parse_segment_t *segment);
6037
6038
6039 #pragma GCC visibility pop
6040
6041 #ifdef __cplusplus
6042 }
6043 #endif
6044
6045 #endif/*CYPHER_PARSER_H*/
9393 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_doxygen.m4 \
9494 $(top_srcdir)/m4/ax_pthread.m4 \
9595 $(top_srcdir)/m4/ax_thread_local.m4 \
96 $(top_srcdir)/m4/declare_versions.m4 \
9697 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
9798 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
98 $(top_srcdir)/m4/lt~obsolete.m4 \
99 $(top_srcdir)/m4/macro_static_assert.m4 \
100 $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/prog_cc_c11.m4 \
99 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
100 $(top_srcdir)/m4/prog_cc_c11.m4 \
101 $(top_srcdir)/m4/static_assert.m4 \
101102 $(top_srcdir)/m4/with_libs.m4 $(top_srcdir)/configure.ac
102103 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
103104 $(ACLOCAL_M4)
501502 OTOOL64 = @OTOOL64@
502503 PACKAGE = @PACKAGE@
503504 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
505 PACKAGE_DEVELOPMENT_VERSION = @PACKAGE_DEVELOPMENT_VERSION@
506 PACKAGE_MAJOR_VERSION = @PACKAGE_MAJOR_VERSION@
507 PACKAGE_MINOR_VERSION = @PACKAGE_MINOR_VERSION@
504508 PACKAGE_NAME = @PACKAGE_NAME@
509 PACKAGE_PATCH_VERSION = @PACKAGE_PATCH_VERSION@
510 PACKAGE_STATUS_VERSION = @PACKAGE_STATUS_VERSION@
505511 PACKAGE_STRING = @PACKAGE_STRING@
506512 PACKAGE_TARNAME = @PACKAGE_TARNAME@
507513 PACKAGE_URL = @PACKAGE_URL@