checkpoint while splitting out the dependency graph build tool to its own project
authorThomas Walker Lynch <xtujpz@reasoningtechnology.com>
Tue, 1 Oct 2024 14:15:24 +0000 (14:15 +0000)
committerThomas Walker Lynch <xtujpz@reasoningtechnology.com>
Tue, 1 Oct 2024 14:15:24 +0000 (14:15 +0000)
217 files changed:
#README.md# [new file with mode: 0644]
.gitignore
Erebus/.gitignore [deleted file]
README.md
build.gradle
developer/ANTLR/ANTLRv4Lexer.g4 [deleted file]
developer/ANTLR/ANTLRv4Parser.g4 [deleted file]
developer/ANTLR/Arithmetic.g4 [deleted file]
developer/ANTLR/Arithmetic2.g4 [deleted file]
developer/ANTLR/GQL_20240412.g4 [deleted file]
developer/ANTLR/GQL_20240412_rf1_literals.g4 [deleted file]
developer/ANTLR/GQL_20240412_substituted.g4 [deleted file]
developer/ANTLR/LexBasic.g4 [deleted file]
developer/ANTLR/LexerAdaptor.java [deleted file]
developer/ANTLR/lexer_rules.g4 [deleted file]
developer/Erebus/.gitignore [deleted file]
developer/Lethe/.githolder [deleted file]
developer/Lethe/Hibou_build.gradle [deleted file]
developer/Lethe/buid_from_leaf.gradle [deleted file]
developer/Lethe/build.gradle [deleted file]
developer/Lethe/build.html [deleted file]
developer/Lethe/make [deleted file]
developer/Lethe/makefile-project.mk [deleted file]
developer/Lethe/makefile-tool.mk [deleted file]
developer/Lethe/makefile-top.mk [deleted file]
developer/build.gradle [deleted file]
developer/executor/ANTLR_OUT_FL [deleted file]
developer/executor/cat_w_names [deleted file]
developer/executor/clean [deleted file]
developer/executor/clean_directory [deleted file]
developer/executor/clean_file_list [deleted file]
developer/executor/clean_grammar [deleted file]
developer/executor/clean_program [deleted file]
developer/executor/env_build [deleted file]
developer/executor/gradle [deleted file]
developer/experiment/.githolder [deleted file]
developer/experiment/script2.sh [deleted file]
developer/javac/ANTLR/.gitignore [deleted file]
developer/javac/leaf/ANTLR_OUT_FL.java [deleted file]
developer/javac/leaf/Arithmetic_Echo.java [deleted file]
developer/javac/leaf/Arithmetic_Echo_PrintVisitor.java [deleted file]
developer/javac/leaf/Arithmetic_Echo__Test.java [deleted file]
developer/javac/leaf/Arithmetic_Swap.java [deleted file]
developer/javac/leaf/Arithmetic_SwapVisitor.java [deleted file]
developer/javac/leaf/Arithmetic_SyntaxAnnotate.java [deleted file]
developer/javac/leaf/Arithmetic_SyntaxAnnotate_PrintVisitor.java [deleted file]
developer/javac/leaf/Arithmetic_SyntaxAnnotate__Test.java [deleted file]
developer/javac/leaf/RuleNameList.java [deleted file]
developer/javac/leaf/RuleNameListRegx.java [deleted file]
developer/javac/leaf/StringUtils.java [deleted file]
developer/javac/leaf/Synthesize_SyntaxAnnotate.java [deleted file]
developer/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitor.java [deleted file]
developer/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java [deleted file]
developer/javac/leaf/TestBench.java [deleted file]
developer/javac/synthesized/Arithmetic2_SyntaxAnnotate.java [deleted file]
developer/javac/synthesized/Arithmetic2_SyntaxAnnotate_PrintVisitor.java [deleted file]
developer/jvm/.gitignore [deleted file]
developer/ologist/#rule_list.txt# [deleted file]
developer/ologist/.githolder [deleted file]
developer/ologist/.ispell_antlr [deleted file]
developer/ologist/Cypher_GQL_differences.txt [deleted file]
developer/ologist/GQL_20240412_rule_list.txt [deleted file]
developer/ologist/antlr-mode.el [deleted file]
developer/ologist/cycle_dection.html [deleted file]
developer/ologist/dependency_graph.html [deleted file]
developer/ologist/deps.gradle [deleted file]
developer/ologist/emacs.txt [deleted file]
developer/ologist/for_developers.md [deleted file]
developer/ologist/grammar_source.txt [deleted file]
developer/ologist/groovy.el [deleted file]
developer/ologist/node_labels_unique_q.txt [deleted file]
developer/ologist/rule_list.txt [deleted file]
developer/ologist/rules_by_catebory.txt [deleted file]
developer/ologist/rules_by_category.html [deleted file]
developer/ologist/terminal_symbol_list.txt [deleted file]
developer/ologist/terminal_symbol_list_unsorted.txt [deleted file]
developer/test/Arithmetic_SyntaxAnnotate__Test_0.txt [deleted file]
developer/test/Arithmetic_SyntaxAnnotate__Test_1.txt [deleted file]
developer/test/Arithmetic_SyntaxAnnotate__Test_2.txt [deleted file]
developer/test/Arithmetic_SyntaxAnnotate__Test_3.txt [deleted file]
developer/test/Arithmetic_SyntaxAnnotate__Test_4.txt [deleted file]
developer/test/Neo4NBA/create_relationship_0.cypher [deleted file]
developer/test/Neo4NBA/create_team_0.cypher [deleted file]
developer/test/Neo4NBA/delete_player_and_relationship.cypher [deleted file]
developer/test/Neo4NBA/notes.txt [deleted file]
developer/test/Neo4NBA/query_players_by_team_0.cypher [deleted file]
developer/test/Neo4NBA/updating_nodes_0.cypher [deleted file]
developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(double_colon).gql [deleted file]
developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(lexical).gql [deleted file]
developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_nested_graph_type_(double_colon).gql [deleted file]
developer/test/opengql_grammar_samples_20240801/create_graph.gql [deleted file]
developer/test/opengql_grammar_samples_20240801/create_schema.gql [deleted file]
developer/test/opengql_grammar_samples_20240801/insert_statement.gql [deleted file]
developer/test/opengql_grammar_samples_20240801/match_and_insert_example.gql [deleted file]
developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_braces).gql [deleted file]
developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_parentheses).gql [deleted file]
developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(nested_match_statement).gql [deleted file]
developer/test/opengql_grammar_samples_20240801/session_set_graph_to_current_graph.gql [deleted file]
developer/test/opengql_grammar_samples_20240801/session_set_graph_to_current_property_graph.gql [deleted file]
developer/test/opengql_grammar_samples_20240801/session_set_property_as_value.gql [deleted file]
developer/test/opengql_grammar_samples_20240801/session_set_time_zone.gql [deleted file]
developer/test/transcript_Arithmetic_Syntax__Test.sh [deleted file]
developer/test/transcript_RuleNameList.sh [deleted file]
developer/test/transcript_notes.txt [deleted file]
developer/test/transcript_test_Arithmetic_Echo.sh [deleted file]
developer/test/transcript_test_Arithmetic_Syntax.sh [deleted file]
developer/test/transcript_test_PrintRuleNameListRegx.sh [deleted file]
developers/ANTLR/ANTLRv4Lexer.g4 [new file with mode: 0644]
developers/ANTLR/ANTLRv4Parser.g4 [new file with mode: 0644]
developers/ANTLR/Arithmetic.g4 [new file with mode: 0644]
developers/ANTLR/Arithmetic2.g4 [new file with mode: 0644]
developers/ANTLR/GQL_20240412.g4 [new file with mode: 0644]
developers/ANTLR/GQL_20240412_rf1_literals.g4 [new file with mode: 0644]
developers/ANTLR/GQL_20240412_substituted.g4 [new file with mode: 0644]
developers/ANTLR/LexBasic.g4 [new file with mode: 0644]
developers/ANTLR/LexerAdaptor.java [new file with mode: 0644]
developers/ANTLR/lexer_rules.g4 [new file with mode: 0644]
developers/Somnus/.gitignore [new file with mode: 0644]
developers/build.gradle [new file with mode: 0644]
developers/dependency_graph_definition.groovy [new file with mode: 0644]
developers/executor/ANTLR_OUT_FL [new file with mode: 0755]
developers/executor/build_from_dependency_graph.groovy [new file with mode: 0644]
developers/executor/cat_w_names [new file with mode: 0755]
developers/executor/clean [new file with mode: 0755]
developers/executor/clean_directory [new file with mode: 0755]
developers/executor/clean_file_list [new file with mode: 0755]
developers/executor/clean_grammar [new file with mode: 0755]
developers/executor/clean_program [new file with mode: 0755]
developers/executor/gradle [new file with mode: 0755]
developers/experiment/.githolder [new file with mode: 0644]
developers/experiment/script2.sh [new file with mode: 0644]
developers/javac/ANTLR/.gitignore [new file with mode: 0644]
developers/javac/leaf/ANTLR_OUT_FL.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_Echo.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_Echo_PrintVisitor.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_Echo__Test.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_Swap.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_SwapVisitor.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_SyntaxAnnotate.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_SyntaxAnnotate_PrintVisitor.java [new file with mode: 0644]
developers/javac/leaf/Arithmetic_SyntaxAnnotate__Test.java [new file with mode: 0644]
developers/javac/leaf/RuleNameList.java [new file with mode: 0644]
developers/javac/leaf/RuleNameListRegx.java [new file with mode: 0644]
developers/javac/leaf/StringUtils.java [new file with mode: 0644]
developers/javac/leaf/Synthesize_SyntaxAnnotate.java [new file with mode: 0644]
developers/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitor.java [new file with mode: 0644]
developers/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java [new file with mode: 0644]
developers/javac/leaf/TestBench.java [new file with mode: 0644]
developers/javac/synthesized/.gitignore [new file with mode: 0644]
developers/jvm/.gitignore [new file with mode: 0644]
developers/readers/#rule_list.txt# [new file with mode: 0644]
developers/readers/.githolder [new file with mode: 0644]
developers/readers/.ispell_antlr [new file with mode: 0644]
developers/readers/Cypher_GQL_differences.txt [new file with mode: 0644]
developers/readers/GQL_20240412_rule_list.txt [new file with mode: 0644]
developers/readers/antlr-mode.el [new file with mode: 0644]
developers/readers/cycle_dection.html [new file with mode: 0644]
developers/readers/dependency_graph.html [new file with mode: 0644]
developers/readers/deps.gradle [new file with mode: 0644]
developers/readers/emacs.txt [new file with mode: 0644]
developers/readers/for_developers.md [new file with mode: 0644]
developers/readers/grammar_source.txt [new file with mode: 0644]
developers/readers/groovy.el [new file with mode: 0644]
developers/readers/node_labels_unique_q.txt [new file with mode: 0644]
developers/readers/rule_list.txt [new file with mode: 0644]
developers/readers/rules_by_catebory.txt [new file with mode: 0644]
developers/readers/rules_by_category.html [new file with mode: 0644]
developers/readers/terminal_symbol_list.txt [new file with mode: 0644]
developers/readers/terminal_symbol_list_unsorted.txt [new file with mode: 0644]
developers/tanuki/.gitignore [new file with mode: 0644]
developers/test/Arithmetic_SyntaxAnnotate__Test_0.txt [new file with mode: 0644]
developers/test/Arithmetic_SyntaxAnnotate__Test_1.txt [new file with mode: 0644]
developers/test/Arithmetic_SyntaxAnnotate__Test_2.txt [new file with mode: 0644]
developers/test/Arithmetic_SyntaxAnnotate__Test_3.txt [new file with mode: 0644]
developers/test/Arithmetic_SyntaxAnnotate__Test_4.txt [new file with mode: 0644]
developers/test/Neo4NBA/create_relationship_0.cypher [new file with mode: 0644]
developers/test/Neo4NBA/create_team_0.cypher [new file with mode: 0644]
developers/test/Neo4NBA/delete_player_and_relationship.cypher [new file with mode: 0644]
developers/test/Neo4NBA/notes.txt [new file with mode: 0644]
developers/test/Neo4NBA/query_players_by_team_0.cypher [new file with mode: 0644]
developers/test/Neo4NBA/updating_nodes_0.cypher [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(double_colon).gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(lexical).gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_nested_graph_type_(double_colon).gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/create_graph.gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/create_schema.gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/insert_statement.gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/match_and_insert_example.gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_braces).gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_parentheses).gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(nested_match_statement).gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/session_set_graph_to_current_graph.gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/session_set_graph_to_current_property_graph.gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/session_set_property_as_value.gql [new file with mode: 0644]
developers/test/opengql_grammar_samples_20240801/session_set_time_zone.gql [new file with mode: 0644]
developers/test/transcript_Arithmetic_Syntax__Test.sh [new file with mode: 0644]
developers/test/transcript_RuleNameList.sh [new file with mode: 0644]
developers/test/transcript_notes.txt [new file with mode: 0644]
developers/test/transcript_test_Arithmetic_Echo.sh [new file with mode: 0644]
developers/test/transcript_test_Arithmetic_Syntax.sh [new file with mode: 0644]
developers/test/transcript_test_PrintRuleNameListRegx.sh [new file with mode: 0644]
executor/clean_ANTLR
executor/clean_Java
executor/clean_upstream
executor/env_dev
executor/env_pm
executor/install_tools.txt [new file with mode: 0644]
ologist/README.md [deleted file]
ologist/directory_structure.md [deleted file]
ologist/gradle_notes.txt [deleted file]
ologist/log.md [deleted file]
readers/README.md [new file with mode: 0644]
readers/directory_naming.txt [new file with mode: 0644]
readers/log.md [new file with mode: 0644]
tanuki/.gitignore [new file with mode: 0644]
tool/.gitignore [deleted file]
toolsmiths/.gitignore [new file with mode: 0644]

diff --git a/#README.md# b/#README.md#
new file mode 100644 (file)
index 0000000..a089cdd
--- /dev/null
@@ -0,0 +1,31 @@
+
+Directories are named after the agent that uses the files in them. See
+`readers/directory_naming.txt` for more information.
+
+
+
+Document readers will find material in the 'readers' directory.
+
+As you are reading this you might be a GQL_to_Cypter-ologist.  Please read
+documents in the ./ologist directory for project information, and the
+documents in the developer/ologist directory for documents on building
+the project.
+
+The project top level is for project management and imported tools. Developers
+do development work in the `developer` directory.
+
+For developers, from the top of the project get started by typing:
+```
+> . executor/env_dev
+``
+
+This will setup the environment and `cd` to the developer directory.  (`env_dev`
+is analogous to the Python virtual environment `activate`.)
+
+# About
+
+This is a project to develope a transpiler from GQL to Cypher.
+
+
+
+
index 02b640c..79a93aa 100644 (file)
@@ -1,5 +1,4 @@
-#note also the .gitignore files in the tool and developer directories and any
-# other directory that might have one.
+# be careful to note also the .gitignore files in various directories.
 
 #*#
 *~
diff --git a/Erebus/.gitignore b/Erebus/.gitignore
deleted file mode 100644 (file)
index 120f485..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!/.gitignore
index 6d0d30a..ad94442 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,5 +1,17 @@
 
-# Project management
+Directories are named after the agent that uses the files in them. See
+`readers/directory_naming.txt` for more information.
+
+The top level directory is reserved for project management. This includes
+the git repo, virtual environment tool installs, and the startup scripts.
+
+An `executor` is a generic name for a program that runs a file. It is used to
+name directories that might have a mix of directly loaded, interpreted, and
+shell script files. Files in an 'exector' directory are for the executor.
+
+
+
+Document readers will find material in the 'readers' directory.
 
 As you are reading this you might be a GQL_to_Cypter-ologist.  Please read
 documents in the ./ologist directory for project information, and the
index 4312062..1358aa3 100644 (file)
@@ -121,9 +121,27 @@ task installJava {
   }
 }
 
+task installGroovyWrapper {
+  doLast {
+    def groovyJar = file("${gradle.gradleHomeDir}/lib/groovy-all.jar")
+    def wrapperDest = file("${toolDir}/bin/groovy-wrapper")
+    
+    if (groovyJar.exists()) {
+      println "Creating Groovy wrapper script in ${wrapperDest}"
+      wrapperDest.text = 
+      '''#!/bin/bash
+      exec java -cp ${groovyJar.absolutePath} groovy.ui.GroovyMain "$@"
+      '''
+      wrapperDest.setExecutable(true)
+    } else {
+      throw new GradleException("Groovy .jar file not found in Gradle library")
+    }
+  }
+}
+
 // Add a task to install both tools
 task installTools {
-  dependsOn installAntlr, installJava
+  dependsOn installAntlr, installJava, installGroovyWrapper
 }
 
 //--------------------------------------------------------------------------------
@@ -152,8 +170,8 @@ task cleanTool {
   }
 }
 
-task cleanErebus {
-  description = "Cleans the project level temporary directory 'Erebus'"  
+task Tanuki {
+  description = "Cleans the project level temporary directory"  
   doLast {
     if (erebusDir.exists()) {
       erebusDir.eachFile { file ->
diff --git a/developer/ANTLR/ANTLRv4Lexer.g4 b/developer/ANTLR/ANTLRv4Lexer.g4
deleted file mode 100644 (file)
index bf389d0..0000000
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * [The "BSD license"]
- *  Copyright (c) 2012-2015 Terence Parr
- *  Copyright (c) 2012-2015 Sam Harwell
- *  Copyright (c) 2015 Gerald Rosenberg
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
- *  are met:
- *
- *  1. Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *  2. Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *  3. The name of the author may not be used to endorse or promote products
- *     derived from this software without specific prior written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- *     A grammar for ANTLR v4 implemented using v4 syntax
- *
- *     Modified 2015.06.16 gbr
- *     -- update for compatibility with Antlr v4.5
- */
-
-// $antlr-format alignTrailingComments on, columnLimit 130, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments off
-// $antlr-format useTab off, allowShortRulesOnASingleLine off, allowShortBlocksOnASingleLine on, alignSemicolons hanging
-// $antlr-format alignColons hanging
-
-// ======================================================
-// Lexer specification
-// ======================================================
-
-lexer grammar ANTLRv4Lexer;
-
-options {
-    superClass = LexerAdaptor;
-}
-
-import LexBasic;
-
-// Standard set of fragments
-tokens {
-    TOKEN_REF,
-    RULE_REF,
-    LEXER_CHAR_SET
-}
-
-channels {
-    OFF_CHANNEL,
-    COMMENT
-}
-
-// -------------------------
-// Comments
-DOC_COMMENT
-    : DocComment -> channel (COMMENT)
-    ;
-
-BLOCK_COMMENT
-    : BlockComment -> channel (COMMENT)
-    ;
-
-LINE_COMMENT
-    : LineComment -> channel (COMMENT)
-    ;
-
-// -------------------------
-// Integer
-
-INT
-    : DecimalNumeral
-    ;
-
-// -------------------------
-// Literal string
-//
-// ANTLR makes no distinction between a single character literal and a
-// multi-character string. All literals are single quote delimited and
-// may contain unicode escape sequences of the form \uxxxx, where x
-// is a valid hexadecimal number (per Unicode standard).
-STRING_LITERAL
-    : SQuoteLiteral
-    ;
-
-UNTERMINATED_STRING_LITERAL
-    : USQuoteLiteral
-    ;
-
-// -------------------------
-// Arguments
-//
-// Certain argument lists, such as those specifying call parameters
-// to a rule invocation, or input parameters to a rule specification
-// are contained within square brackets.
-BEGIN_ARGUMENT
-    : LBrack { this.handleBeginArgument(); }
-    ;
-
-// -------------------------
-// Target Language Actions
-BEGIN_ACTION
-    : LBrace -> pushMode (TargetLanguageAction)
-    ;
-
-// -------------------------
-// Keywords
-//
-// 'options', 'tokens', and 'channels' are considered keywords
-// but only when followed by '{', and considered as a single token.
-// Otherwise, the symbols are tokenized as RULE_REF and allowed as
-// an identifier in a labeledElement.
-OPTIONS
-    : 'options' WSNLCHARS* '{'
-    ;
-
-TOKENS
-    : 'tokens' WSNLCHARS* '{'
-    ;
-
-CHANNELS
-    : 'channels' WSNLCHARS* '{'
-    ;
-
-fragment WSNLCHARS
-    : ' '
-    | '\t'
-    | '\f'
-    | '\n'
-    | '\r'
-    ;
-
-IMPORT
-    : 'import'
-    ;
-
-FRAGMENT
-    : 'fragment'
-    ;
-
-LEXER
-    : 'lexer'
-    ;
-
-PARSER
-    : 'parser'
-    ;
-
-GRAMMAR
-    : 'grammar'
-    ;
-
-PROTECTED
-    : 'protected'
-    ;
-
-PUBLIC
-    : 'public'
-    ;
-
-PRIVATE
-    : 'private'
-    ;
-
-RETURNS
-    : 'returns'
-    ;
-
-LOCALS
-    : 'locals'
-    ;
-
-THROWS
-    : 'throws'
-    ;
-
-CATCH
-    : 'catch'
-    ;
-
-FINALLY
-    : 'finally'
-    ;
-
-MODE
-    : 'mode'
-    ;
-
-// -------------------------
-// Punctuation
-
-COLON
-    : Colon
-    ;
-
-COLONCOLON
-    : DColon
-    ;
-
-COMMA
-    : Comma
-    ;
-
-SEMI
-    : Semi
-    ;
-
-LPAREN
-    : LParen
-    ;
-
-RPAREN
-    : RParen
-    ;
-
-LBRACE
-    : LBrace
-    ;
-
-RBRACE
-    : RBrace
-    ;
-
-RARROW
-    : RArrow
-    ;
-
-LT
-    : Lt
-    ;
-
-GT
-    : Gt
-    ;
-
-ASSIGN
-    : Equal
-    ;
-
-QUESTION
-    : Question
-    ;
-
-STAR
-    : Star
-    ;
-
-PLUS_ASSIGN
-    : PlusAssign
-    ;
-
-PLUS
-    : Plus
-    ;
-
-OR
-    : Pipe
-    ;
-
-DOLLAR
-    : Dollar
-    ;
-
-RANGE
-    : Range
-    ;
-
-DOT
-    : Dot
-    ;
-
-AT
-    : At
-    ;
-
-POUND
-    : Pound
-    ;
-
-NOT
-    : Tilde
-    ;
-
-// -------------------------
-// Identifiers - allows unicode rule/token names
-
-ID
-    : Id
-    ;
-
-// -------------------------
-// Whitespace
-
-WS
-    : Ws+ -> channel (OFF_CHANNEL)
-    ;
-
-// -------------------------
-// Illegal Characters
-//
-// This is an illegal character trap which is always the last rule in the
-// lexer specification. It matches a single character of any value and being
-// the last rule in the file will match when no other rule knows what to do
-// about the character. It is reported as an error but is not passed on to the
-// parser. This means that the parser to deal with the gramamr file anyway
-// but we will not try to analyse or code generate from a file with lexical
-// errors.
-
-// Comment this rule out to allow the error to be propagated to the parser
-ERRCHAR
-    : . -> channel (HIDDEN)
-    ;
-
-// ======================================================
-// Lexer modes
-// -------------------------
-// Arguments
-mode Argument;
-
-// E.g., [int x, List<String> a[]]
-NESTED_ARGUMENT
-    : LBrack -> type (ARGUMENT_CONTENT), pushMode (Argument)
-    ;
-
-ARGUMENT_ESCAPE
-    : EscAny -> type (ARGUMENT_CONTENT)
-    ;
-
-ARGUMENT_STRING_LITERAL
-    : DQuoteLiteral -> type (ARGUMENT_CONTENT)
-    ;
-
-ARGUMENT_CHAR_LITERAL
-    : SQuoteLiteral -> type (ARGUMENT_CONTENT)
-    ;
-
-END_ARGUMENT
-    : RBrack { this.handleEndArgument(); }
-    ;
-
-// added this to return non-EOF token type here. EOF does something weird
-UNTERMINATED_ARGUMENT
-    : EOF -> popMode
-    ;
-
-ARGUMENT_CONTENT
-    : .
-    ;
-
-// TODO: This grammar and the one used in the Intellij Antlr4 plugin differ
-// for "actions". This needs to be resolved at some point.
-// The Intellij Antlr4 grammar is here:
-// https://github.com/antlr/intellij-plugin-v4/blob/1f36fde17f7fa63cb18d7eeb9cb213815ac658fb/src/main/antlr/org/antlr/intellij/plugin/parser/ANTLRv4Lexer.g4#L587
-
-// -------------------------
-// Target Language Actions
-//
-// Many language targets use {} as block delimiters and so we
-// must recursively match {} delimited blocks to balance the
-// braces. Additionally, we must make some assumptions about
-// literal string representation in the target language. We assume
-// that they are delimited by ' or " and so consume these
-// in their own alts so as not to inadvertantly match {}.
-mode TargetLanguageAction;
-
-NESTED_ACTION
-    : LBrace -> type (ACTION_CONTENT), pushMode (TargetLanguageAction)
-    ;
-
-ACTION_ESCAPE
-    : EscAny -> type (ACTION_CONTENT)
-    ;
-
-ACTION_STRING_LITERAL
-    : DQuoteLiteral -> type (ACTION_CONTENT)
-    ;
-
-ACTION_CHAR_LITERAL
-    : SQuoteLiteral -> type (ACTION_CONTENT)
-    ;
-
-ACTION_DOC_COMMENT
-    : DocComment -> type (ACTION_CONTENT)
-    ;
-
-ACTION_BLOCK_COMMENT
-    : BlockComment -> type (ACTION_CONTENT)
-    ;
-
-ACTION_LINE_COMMENT
-    : LineComment -> type (ACTION_CONTENT)
-    ;
-
-END_ACTION
-    : RBrace { this.handleEndAction(); }
-    ;
-
-UNTERMINATED_ACTION
-    : EOF -> popMode
-    ;
-
-ACTION_CONTENT
-    : .
-    ;
-
-// -------------------------
-mode LexerCharSet;
-
-LEXER_CHAR_SET_BODY
-    : (~ [\]\\] | EscAny)+ -> more
-    ;
-
-LEXER_CHAR_SET
-    : RBrack -> popMode
-    ;
-
-UNTERMINATED_CHAR_SET
-    : EOF -> popMode
-    ;
-
-// ------------------------------------------------------------------------------
-// Grammar specific Keywords, Punctuation, etc.
-fragment Id
-    : NameStartChar NameChar*
-    ;
\ No newline at end of file
diff --git a/developer/ANTLR/ANTLRv4Parser.g4 b/developer/ANTLR/ANTLRv4Parser.g4
deleted file mode 100644 (file)
index a4ff765..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * [The "BSD license"]
- *  Copyright (c) 2012-2014 Terence Parr
- *  Copyright (c) 2012-2014 Sam Harwell
- *  Copyright (c) 2015 Gerald Rosenberg
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
- *  are met:
- *
- *  1. Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *  2. Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *  3. The name of the author may not be used to endorse or promote products
- *     derived from this software without specific prior written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*     A grammar for ANTLR v4 written in ANTLR v4.
- *
- *     Modified 2015.06.16 gbr
- *     -- update for compatibility with Antlr v4.5
- *     -- add mode for channels
- *     -- moved members to LexerAdaptor
- *     -- move fragments to imports
- */
-
-// $antlr-format alignTrailingComments on, columnLimit 130, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments off
-// $antlr-format useTab off, allowShortRulesOnASingleLine off, allowShortBlocksOnASingleLine on, alignSemicolons hanging
-// $antlr-format alignColons hanging
-
-parser grammar ANTLRv4Parser;
-
-options {
-    tokenVocab = ANTLRv4Lexer;
-}
-
-// The main entry point for parsing a v4 grammar.
-grammarSpec
-    : grammarDecl prequelConstruct* rules modeSpec* EOF
-    ;
-
-grammarDecl
-    : grammarType identifier SEMI
-    ;
-
-grammarType
-    : LEXER GRAMMAR
-    | PARSER GRAMMAR
-    | GRAMMAR
-    ;
-
-// This is the list of all constructs that can be declared before
-// the set of rules that compose the grammar, and is invoked 0..n
-// times by the grammarPrequel rule.
-
-prequelConstruct
-    : optionsSpec
-    | delegateGrammars
-    | tokensSpec
-    | channelsSpec
-    | action_
-    ;
-
-// ------------
-// Options - things that affect analysis and/or code generation
-
-optionsSpec
-    : OPTIONS (option SEMI)* RBRACE
-    ;
-
-option
-    : identifier ASSIGN optionValue
-    ;
-
-optionValue
-    : identifier (DOT identifier)*
-    | STRING_LITERAL
-    | actionBlock
-    | INT
-    ;
-
-// ------------
-// Delegates
-
-delegateGrammars
-    : IMPORT delegateGrammar (COMMA delegateGrammar)* SEMI
-    ;
-
-delegateGrammar
-    : identifier ASSIGN identifier
-    | identifier
-    ;
-
-// ------------
-// Tokens & Channels
-
-tokensSpec
-    : TOKENS idList? RBRACE
-    ;
-
-channelsSpec
-    : CHANNELS idList? RBRACE
-    ;
-
-idList
-    : identifier (COMMA identifier)* COMMA?
-    ;
-
-// Match stuff like @parser::members {int i;}
-
-action_
-    : AT (actionScopeName COLONCOLON)? identifier actionBlock
-    ;
-
-// Scope names could collide with keywords; allow them as ids for action scopes
-
-actionScopeName
-    : identifier
-    | LEXER
-    | PARSER
-    ;
-
-actionBlock
-    : BEGIN_ACTION ACTION_CONTENT* END_ACTION
-    ;
-
-argActionBlock
-    : BEGIN_ARGUMENT ARGUMENT_CONTENT* END_ARGUMENT
-    ;
-
-modeSpec
-    : MODE identifier SEMI lexerRuleSpec*
-    ;
-
-rules
-    : ruleSpec*
-    ;
-
-ruleSpec
-    : parserRuleSpec
-    | lexerRuleSpec
-    ;
-
-parserRuleSpec
-    : ruleModifiers? RULE_REF argActionBlock? ruleReturns? throwsSpec? localsSpec? rulePrequel* COLON ruleBlock SEMI
-        exceptionGroup
-    ;
-
-exceptionGroup
-    : exceptionHandler* finallyClause?
-    ;
-
-exceptionHandler
-    : CATCH argActionBlock actionBlock
-    ;
-
-finallyClause
-    : FINALLY actionBlock
-    ;
-
-rulePrequel
-    : optionsSpec
-    | ruleAction
-    ;
-
-ruleReturns
-    : RETURNS argActionBlock
-    ;
-
-// --------------
-// Exception spec
-throwsSpec
-    : THROWS identifier (COMMA identifier)*
-    ;
-
-localsSpec
-    : LOCALS argActionBlock
-    ;
-
-/** Match stuff like @init {int i;} */
-ruleAction
-    : AT identifier actionBlock
-    ;
-
-ruleModifiers
-    : ruleModifier+
-    ;
-
-// An individual access modifier for a rule. The 'fragment' modifier
-// is an internal indication for lexer rules that they do not match
-// from the input but are like subroutines for other lexer rules to
-// reuse for certain lexical patterns. The other modifiers are passed
-// to the code generation templates and may be ignored by the template
-// if they are of no use in that language.
-
-ruleModifier
-    : PUBLIC
-    | PRIVATE
-    | PROTECTED
-    | FRAGMENT
-    ;
-
-ruleBlock
-    : ruleAltList
-    ;
-
-ruleAltList
-    : labeledAlt (OR labeledAlt)*
-    ;
-
-labeledAlt
-    : alternative (POUND identifier)?
-    ;
-
-// --------------------
-// Lexer rules
-
-lexerRuleSpec
-    : FRAGMENT? TOKEN_REF optionsSpec? COLON lexerRuleBlock SEMI
-    ;
-
-lexerRuleBlock
-    : lexerAltList
-    ;
-
-lexerAltList
-    : lexerAlt (OR lexerAlt)*
-    ;
-
-lexerAlt
-    : lexerElements lexerCommands?
-    |
-    // explicitly allow empty alts
-    ;
-
-lexerElements
-    : lexerElement+
-    |
-    ;
-
-lexerElement
-    : lexerAtom ebnfSuffix?
-    | lexerBlock ebnfSuffix?
-    | actionBlock QUESTION?
-    ;
-
-// but preds can be anywhere
-
-lexerBlock
-    : LPAREN lexerAltList RPAREN
-    ;
-
-// E.g., channel(HIDDEN), skip, more, mode(INSIDE), push(INSIDE), pop
-
-lexerCommands
-    : RARROW lexerCommand (COMMA lexerCommand)*
-    ;
-
-lexerCommand
-    : lexerCommandName LPAREN lexerCommandExpr RPAREN
-    | lexerCommandName
-    ;
-
-lexerCommandName
-    : identifier
-    | MODE
-    ;
-
-lexerCommandExpr
-    : identifier
-    | INT
-    ;
-
-// --------------------
-// Rule Alts
-
-altList
-    : alternative (OR alternative)*
-    ;
-
-alternative
-    : elementOptions? element+
-    |
-    // explicitly allow empty alts
-    ;
-
-element
-    : labeledElement (ebnfSuffix |)
-    | atom (ebnfSuffix |)
-    | ebnf
-    | actionBlock (QUESTION predicateOptions?)?
-    ;
-
-predicateOptions
-    : LT predicateOption (COMMA predicateOption)* GT
-    ;
-
-predicateOption
-    : elementOption
-    | identifier ASSIGN actionBlock
-    ;
-
-labeledElement
-    : identifier (ASSIGN | PLUS_ASSIGN) (atom | block)
-    ;
-
-// --------------------
-// EBNF and blocks
-
-ebnf
-    : block blockSuffix?
-    ;
-
-blockSuffix
-    : ebnfSuffix
-    ;
-
-ebnfSuffix
-    : QUESTION QUESTION?
-    | STAR QUESTION?
-    | PLUS QUESTION?
-    ;
-
-lexerAtom
-    : characterRange
-    | terminalDef
-    | notSet
-    | LEXER_CHAR_SET
-    | DOT elementOptions?
-    ;
-
-atom
-    : terminalDef
-    | ruleref
-    | notSet
-    | DOT elementOptions?
-    ;
-
-// --------------------
-// Inverted element set
-notSet
-    : NOT setElement
-    | NOT blockSet
-    ;
-
-blockSet
-    : LPAREN setElement (OR setElement)* RPAREN
-    ;
-
-setElement
-    : TOKEN_REF elementOptions?
-    | STRING_LITERAL elementOptions?
-    | characterRange
-    | LEXER_CHAR_SET
-    ;
-
-// -------------
-// Grammar Block
-block
-    : LPAREN (optionsSpec? ruleAction* COLON)? altList RPAREN
-    ;
-
-// ----------------
-// Parser rule ref
-ruleref
-    : RULE_REF argActionBlock? elementOptions?
-    ;
-
-// ---------------
-// Character Range
-characterRange
-    : STRING_LITERAL RANGE STRING_LITERAL
-    ;
-
-terminalDef
-    : TOKEN_REF elementOptions?
-    | STRING_LITERAL elementOptions?
-    ;
-
-// Terminals may be adorned with certain options when
-// reference in the grammar: TOK<,,,>
-elementOptions
-    : LT elementOption (COMMA elementOption)* GT
-    ;
-
-elementOption
-    : identifier
-    | identifier ASSIGN (identifier | STRING_LITERAL)
-    ;
-
-identifier
-    : RULE_REF
-    | TOKEN_REF
-    ;
\ No newline at end of file
diff --git a/developer/ANTLR/Arithmetic.g4 b/developer/ANTLR/Arithmetic.g4
deleted file mode 100644 (file)
index 4a61ec4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-grammar Arithmetic;
-
-program:   expression EOF;
-
-expression
-    : expression ('*'|'/') expression
-    | expression ('+'|'-') expression
-    | '(' expression ')'
-    | INT
-    ;
-
-INT: [0-9]+;
-
-WS: [ \t\r\n]+ -> skip;
diff --git a/developer/ANTLR/Arithmetic2.g4 b/developer/ANTLR/Arithmetic2.g4
deleted file mode 100644 (file)
index 88fea64..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-grammar Arithmetic2;
-
-program:   statement+ EOF;
-
-statement
-    : expression
-    | variable '=' expression
-    ;
-
-expression
-    : expression ('*'|'/') expression
-    | expression ('+'|'-') expression
-    | '(' expression ')'
-    | variable
-    | INT
-    ;
-
-variable: VARIABLE;
-
-INT: [0-9]+;
-
-VARIABLE: [a-zA-Z]+;
-
-WS: [ \t\r\n]+ -> skip;
diff --git a/developer/ANTLR/GQL_20240412.g4 b/developer/ANTLR/GQL_20240412.g4
deleted file mode 100644 (file)
index ea8517c..0000000
+++ /dev/null
@@ -1,3778 +0,0 @@
-grammar GQL_20240412;
-        
-options { caseInsensitive = true; }
-
-// 6 <GQL-program>
-
-gqlProgram
-    : programActivity sessionCloseCommand? EOF
-    | sessionCloseCommand EOF
-    ;
-
-programActivity
-    : sessionActivity
-    | transactionActivity
-    ;
-
-sessionActivity
-    : sessionResetCommand+
-    | sessionSetCommand+ sessionResetCommand*
-    ;
-
-transactionActivity
-    : startTransactionCommand (procedureSpecification endTransactionCommand?)?
-    | procedureSpecification endTransactionCommand?
-    | endTransactionCommand
-    ;
-
-endTransactionCommand
-    : rollbackCommand
-    | commitCommand
-    ;
-
-// 7.1 <session set command>
-
-sessionSetCommand
-    : SESSION SET (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
-    ;
-
-sessionSetSchemaClause
-    : SCHEMA schemaReference
-    ;
-
-sessionSetGraphClause
-    : PROPERTY? GRAPH graphExpression
-    ;
-
-sessionSetTimeZoneClause
-    : TIME ZONE setTimeZoneValue
-    ;
-
-setTimeZoneValue
-    : timeZoneString
-    ;
-
-sessionSetParameterClause
-    : sessionSetGraphParameterClause
-    | sessionSetBindingTableParameterClause
-    | sessionSetValueParameterClause
-    ;
-
-sessionSetGraphParameterClause
-    : PROPERTY? GRAPH sessionSetParameterName optTypedGraphInitializer
-    ;
-
-sessionSetBindingTableParameterClause
-    : BINDING? TABLE sessionSetParameterName optTypedBindingTableInitializer
-    ;
-
-sessionSetValueParameterClause
-    : VALUE sessionSetParameterName optTypedValueInitializer
-    ;
-
-sessionSetParameterName
-    : (IF NOT EXISTS)? sessionParameterSpecification
-    ;
-
-// 7.2 <session reset command>
-
-sessionResetCommand
-    : SESSION RESET sessionResetArguments?
-    ;
-
-sessionResetArguments
-    : ALL? (PARAMETERS | CHARACTERISTICS)
-    | SCHEMA
-    | PROPERTY? GRAPH
-    | TIME ZONE
-    | PARAMETER? sessionParameterSpecification
-    ;
-
-// 7.3 <session close command>
-
-sessionCloseCommand
-    : SESSION CLOSE
-    ;
-
-// 7.4 <session parameter specification>
-
-sessionParameterSpecification
-    : GENERAL_PARAMETER_REFERENCE
-    ;
-
-// 8.1 <start transaction command>
-
-startTransactionCommand
-    : START TRANSACTION transactionCharacteristics?
-    ;
-
-// 8.2 <transaction characteristics>
-
-transactionCharacteristics
-    : transactionMode (COMMA transactionMode)*
-    ;
-
-transactionMode
-    : transactionAccessMode
-    ;
-
-transactionAccessMode
-    : READ ONLY
-    | READ WRITE
-    ;
-
-// 8.3 <rollback command>
-
-rollbackCommand
-    : ROLLBACK
-    ;
-
-// 8.4 <commit command>
-
-commitCommand
-    : COMMIT
-    ;
-
-// 9.1 <nested procedure specification>
-
-nestedProcedureSpecification
-    : LEFT_BRACE procedureSpecification RIGHT_BRACE
-    ;
-
-// <catalog-modifying procedure specification>, <data-modifying procedure specification> and <query specification> are
-// identical productions. The specification distinguishes them in the BNF, but in the implementation, the distinction
-// has to be made sematically, in code, based on the kind of statements contained in the <procedure specification>.
-procedureSpecification
-    : procedureBody
-//    : catalogModifyingProcedureSpecification
-//    | dataModifyingProcedureSpecification
-//    | querySpecification
-    ;
-
-//catalogModifyingProcedureSpecification
-//    : procedureBody
-//    ;
-
-nestedDataModifyingProcedureSpecification
-    : LEFT_BRACE procedureBody RIGHT_BRACE
-    ;
-
-//dataModifyingProcedureSpecification
-//    : procedureBody
-//    ;
-
-nestedQuerySpecification
-    : LEFT_BRACE procedureBody RIGHT_BRACE
-    ;
-
-//querySpecification
-//    : procedureBody
-//    ;
-
-// 9.2 <procedure body>
-
-procedureBody
-    : atSchemaClause? bindingVariableDefinitionBlock? statementBlock
-    ;
-
-bindingVariableDefinitionBlock
-    : bindingVariableDefinition+
-    ;
-
-bindingVariableDefinition
-    : graphVariableDefinition
-    | bindingTableVariableDefinition
-    | valueVariableDefinition
-    ;
-
-statementBlock
-    : statement nextStatement*
-    ;
-
-statement
-    : linearCatalogModifyingStatement
-    | linearDataModifyingStatement
-    | compositeQueryStatement
-    ;
-
-nextStatement
-    : NEXT yieldClause? statement
-    ;
-
-// 10.1 <graph variable definition>
-
-graphVariableDefinition
-    : PROPERTY? GRAPH bindingVariable optTypedGraphInitializer
-    ;
-
-optTypedGraphInitializer
-    : (typed? graphReferenceValueType)? graphInitializer
-    ;
-
-graphInitializer
-    : EQUALS_OPERATOR graphExpression
-    ;
-
-// 10.2 <binding table variable definition>
-
-bindingTableVariableDefinition
-    : BINDING? TABLE bindingVariable optTypedBindingTableInitializer
-    ;
-
-optTypedBindingTableInitializer
-    : (typed? bindingTableReferenceValueType)? bindingTableInitializer
-    ;
-
-bindingTableInitializer
-    : EQUALS_OPERATOR bindingTableExpression
-    ;
-
-// 10.3 <value variable definition>
-
-valueVariableDefinition
-    : VALUE bindingVariable optTypedValueInitializer
-    ;
-
-optTypedValueInitializer
-    : (typed? valueType)? valueInitializer
-    ;
-
-valueInitializer
-    : EQUALS_OPERATOR valueExpression
-    ;
-
-// 11.1 <graph expression>
-
-graphExpression
-    : objectExpressionPrimary
-    | graphReference
-    | objectNameOrBindingVariable
-    | currentGraph
-    ;
-
-currentGraph
-    : CURRENT_PROPERTY_GRAPH
-    | CURRENT_GRAPH
-    ;
-
-// 11.2 <binding table expression>
-
-bindingTableExpression
-    : nestedBindingTableQuerySpecification
-    | objectExpressionPrimary
-    | bindingTableReference
-    | objectNameOrBindingVariable
-    ;
-
-nestedBindingTableQuerySpecification
-    : nestedQuerySpecification
-    ;
-
-// 11.3 <object expression primary>
-
-objectExpressionPrimary
-    : VARIABLE valueExpressionPrimary
-    | parenthesizedValueExpression
-    | nonParenthesizedValueExpressionPrimarySpecialCase
-    ;
-
-// 12.1 <linear catalog-modifying statement>
-
-linearCatalogModifyingStatement
-    : simpleCatalogModifyingStatement+
-    ;
-
-simpleCatalogModifyingStatement
-    : primitiveCatalogModifyingStatement
-    | callCatalogModifyingProcedureStatement
-    ;
-
-primitiveCatalogModifyingStatement
-    : createSchemaStatement
-    | dropSchemaStatement
-    | createGraphStatement
-    | dropGraphStatement
-    | createGraphTypeStatement
-    | dropGraphTypeStatement
-    ;
-
-// 12.2 <insert schema statement>
-
-createSchemaStatement
-    : CREATE SCHEMA (IF NOT EXISTS)? catalogSchemaParentAndName
-    ;
-
-// 12.3 <drop schema statement>
-
-dropSchemaStatement
-    : DROP SCHEMA (IF EXISTS)? catalogSchemaParentAndName
-    ;
-
-// 12.4 <insert graph statement>
-
-createGraphStatement
-    : CREATE (PROPERTY? GRAPH (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-    ;
-
-openGraphType
-    : typed? ANY (PROPERTY? GRAPH)?
-    ;
-
-ofGraphType
-    : graphTypeLikeGraph
-    | typed? graphTypeReference
-    | typed? (PROPERTY? GRAPH)? nestedGraphTypeSpecification
-    ;
-
-graphTypeLikeGraph
-    : LIKE graphExpression
-    ;
-
-graphSource
-    : AS COPY OF graphExpression
-    ;
-
-// 12.5 <drop graph statement>
-
-dropGraphStatement
-    : DROP PROPERTY? GRAPH (IF EXISTS)? catalogGraphParentAndName
-    ;
-
-// 12.6 <graph type statement>
-
-createGraphTypeStatement
-    : CREATE (PROPERTY? GRAPH TYPE (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH TYPE) catalogGraphTypeParentAndName graphTypeSource
-    ;
-
-graphTypeSource
-    : AS? copyOfGraphType
-    | graphTypeLikeGraph
-    | AS? nestedGraphTypeSpecification
-    ;
-
-copyOfGraphType
-    : COPY OF graphTypeReference
-    ;
-
-// 12.7 <drop graph statement>
-
-dropGraphTypeStatement
-    : DROP PROPERTY? GRAPH TYPE (IF EXISTS)? catalogGraphTypeParentAndName
-    ;
-
-// 12.8 <call catalog-modifying statement>
-
-callCatalogModifyingProcedureStatement
-    : callProcedureStatement
-    ;
-
-// 13.1 <linear data-modifying statement>
-
-linearDataModifyingStatement
-    : focusedLinearDataModifyingStatement
-    | ambientLinearDataModifyingStatement
-    ;
-
-focusedLinearDataModifyingStatement
-    : focusedLinearDataModifyingStatementBody
-    | focusedNestedDataModifyingProcedureSpecification
-    ;
-
-focusedLinearDataModifyingStatementBody
-    : useGraphClause simpleLinearDataAccessingStatement primitiveResultStatement?
-    ;
-
-focusedNestedDataModifyingProcedureSpecification
-    : useGraphClause nestedDataModifyingProcedureSpecification
-    ;
-
-ambientLinearDataModifyingStatement
-    : ambientLinearDataModifyingStatementBody
-    | nestedDataModifyingProcedureSpecification
-    ;
-
-ambientLinearDataModifyingStatementBody
-    : simpleLinearDataAccessingStatement primitiveResultStatement?
-    ;
-
-simpleLinearDataAccessingStatement
-    : simpleQueryStatement* simpleDataModifyingStatement+
-    ;
-
-// Subsumed by previous rule to enforce 13.1 SR 5
-//simpleDataAccessingStatement
-//    : simpleQueryStatement
-//    | simpleDataModifyingStatement
-//    ;
-
-simpleDataModifyingStatement
-    : primitiveDataModifyingStatement
-    | callDataModifyingProcedureStatement
-    ;
-
-primitiveDataModifyingStatement
-    : insertStatement
-    | setStatement
-    | removeStatement
-    | deleteStatement
-    ;
-
-// 13.2 <insertStatement>
-
-insertStatement
-    : INSERT insertGraphPattern
-    ;
-
-// 13.3 <set statement>
-
-setStatement
-    : SET setItemList
-    ;
-
-setItemList
-    : setItem (COMMA setItem)*
-    ;
-
-setItem
-    : setPropertyItem
-    | setAllPropertiesItem
-    | setLabelItem
-    ;
-
-setPropertyItem
-    : bindingVariableReference PERIOD propertyName EQUALS_OPERATOR valueExpression
-    ;
-
-setAllPropertiesItem
-    : bindingVariableReference EQUALS_OPERATOR LEFT_BRACE propertyKeyValuePairList? RIGHT_BRACE
-    ;
-
-setLabelItem
-    : bindingVariableReference isOrColon labelName
-    ;
-
-// 13.4 <remove statement>
-
-removeStatement
-    : REMOVE removeItemList
-    ;
-
-removeItemList
-    : removeItem (COMMA removeItem)*
-    ;
-
-removeItem
-    : removePropertyItem
-    | removeLabelItem
-    ;
-
-removePropertyItem
-    : bindingVariableReference PERIOD propertyName
-    ;
-
-removeLabelItem
-    : bindingVariableReference isOrColon labelName
-    ;
-
-// 13.5 <delete statement>
-
-deleteStatement
-    : (DETACH | NODETACH)? DELETE deleteItemList
-    ;
-
-deleteItemList
-    : deleteItem (COMMA deleteItem)*
-    ;
-
-deleteItem
-    : valueExpression
-    ;
-
-// 13.6 <call data-modifying procedure statement>
-
-callDataModifyingProcedureStatement
-    : callProcedureStatement
-    ;
-
-// 14.1 <composite query statement>
-
-compositeQueryStatement
-    : compositeQueryExpression
-    ;
-
-// 14.2 <composite query expression>
-
-compositeQueryExpression
-    : compositeQueryExpression queryConjunction compositeQueryPrimary
-    | compositeQueryPrimary
-    ;
-
-queryConjunction
-    : setOperator
-    | OTHERWISE
-    ;
-
-setOperator
-    : UNION setQuantifier?
-    | EXCEPT setQuantifier?
-    | INTERSECT setQuantifier?
-    ;
-
-compositeQueryPrimary
-    : linearQueryStatement
-    ;
-
-// 14.3 <linear query statement> and <simple query statement>
-
-linearQueryStatement
-    : focusedLinearQueryStatement
-    | ambientLinearQueryStatement
-    ;
-
-focusedLinearQueryStatement
-    : focusedLinearQueryStatementPart* focusedLinearQueryAndPrimitiveResultStatementPart
-    | focusedPrimitiveResultStatement
-    | focusedNestedQuerySpecification
-    | selectStatement
-    ;
-
-focusedLinearQueryStatementPart
-    : useGraphClause simpleLinearQueryStatement
-    ;
-
-focusedLinearQueryAndPrimitiveResultStatementPart
-    : useGraphClause simpleLinearQueryStatement primitiveResultStatement
-    ;
-
-focusedPrimitiveResultStatement
-    : useGraphClause primitiveResultStatement
-    ;
-
-focusedNestedQuerySpecification
-    : useGraphClause nestedQuerySpecification
-    ;
-
-ambientLinearQueryStatement
-    : simpleLinearQueryStatement? primitiveResultStatement
-    | nestedQuerySpecification
-    ;
-
-simpleLinearQueryStatement
-    : simpleQueryStatement+
-    ;
-
-simpleQueryStatement
-    : primitiveQueryStatement
-    | callQueryStatement
-    ;
-
-primitiveQueryStatement
-    : matchStatement
-    | letStatement
-    | forStatement
-    | filterStatement
-    | orderByAndPageStatement
-    ;
-
-// 14.4 <match statement>
-
-matchStatement
-    : simpleMatchStatement
-    | optionalMatchStatement
-    ;
-
-simpleMatchStatement
-    : MATCH graphPatternBindingTable
-    ;
-
-optionalMatchStatement
-    : OPTIONAL optionalOperand
-    ;
-
-optionalOperand
-    : simpleMatchStatement
-    | LEFT_BRACE matchStatementBlock RIGHT_BRACE
-    | LEFT_PAREN matchStatementBlock RIGHT_PAREN
-    ;
-
-matchStatementBlock
-    : matchStatement+
-    ;
-
-// 14.5 <call query statement>
-
-callQueryStatement
-    : callProcedureStatement
-    ;
-
-// 14.6 <filter statement>
-
-filterStatement
-    : FILTER (whereClause | searchCondition)
-    ;
-
-// 14.7 <let statement>
-
-letStatement
-    : LET letVariableDefinitionList
-    ;
-
-letVariableDefinitionList
-    : letVariableDefinition (COMMA letVariableDefinition)*
-    ;
-
-letVariableDefinition
-    : valueVariableDefinition
-    | bindingVariable EQUALS_OPERATOR valueExpression
-    ;
-
-// 14.8 <for statement>
-
-forStatement
-    : FOR forItem forOrdinalityOrOffset?
-    ;
-
-forItem
-    : forItemAlias forItemSource
-    ;
-
-forItemAlias
-    : bindingVariable IN
-    ;
-
-forItemSource
-    : valueExpression
-    ;
-
-forOrdinalityOrOffset
-    : WITH (ORDINALITY | OFFSET) bindingVariable
-    ;
-
-// 14.9 <order by and page statement>
-
-orderByAndPageStatement
-    : orderByClause offsetClause? limitClause?
-    | offsetClause limitClause?
-    | limitClause
-    ;
-
-// 14.10 <primitive result statement>
-
-primitiveResultStatement
-    : returnStatement orderByAndPageStatement?
-    | FINISH
-    ;
-
-// 14.11 <return statement>
-
-returnStatement
-    : RETURN returnStatementBody
-    ;
-
-returnStatementBody
-    : setQuantifier? (ASTERISK | returnItemList) groupByClause?
-    | NO BINDINGS
-    ;
-
-returnItemList
-    : returnItem (COMMA returnItem)*
-    ;
-
-returnItem
-    : aggregatingValueExpression returnItemAlias?
-    ;
-
-returnItemAlias
-    : AS identifier
-    ;
-
-// 14.12 <select statement>
-
-selectStatement
-    : SELECT setQuantifier? (ASTERISK | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
-    ;
-
-selectItemList
-    : selectItem (COMMA selectItem)*
-    ;
-
-selectItem
-    : aggregatingValueExpression selectItemAlias?
-    ;
-
-selectItemAlias
-    : AS identifier
-    ;
-
-havingClause
-    : HAVING searchCondition
-    ;
-
-selectStatementBody
-    : FROM (selectGraphMatchList | selectQuerySpecification)
-    ;
-
-selectGraphMatchList
-    : selectGraphMatch (COMMA selectGraphMatch)*
-    ;
-
-selectGraphMatch
-    : graphExpression matchStatement
-    ;
-
-selectQuerySpecification
-    : nestedQuerySpecification
-    | graphExpression nestedQuerySpecification
-    ;
-
-// 15.1 <call procedure statement> and <procedure call>
-
-callProcedureStatement
-    : OPTIONAL? CALL procedureCall
-    ;
-
-procedureCall
-    : inlineProcedureCall
-    | namedProcedureCall
-    ;
-
-// 15.2 <inline procedure call>
-
-inlineProcedureCall
-    : variableScopeClause? nestedProcedureSpecification
-    ;
-
-variableScopeClause
-    : LEFT_PAREN bindingVariableReferenceList? RIGHT_PAREN
-    ;
-
-bindingVariableReferenceList
-    : bindingVariableReference (COMMA bindingVariableReference)*
-    ;
-
-// 15.3 <named procedure call>
-
-namedProcedureCall
-    : procedureReference LEFT_PAREN procedureArgumentList? RIGHT_PAREN yieldClause?
-    ;
-
-procedureArgumentList
-    : procedureArgument (COMMA procedureArgument)*
-    ;
-
-procedureArgument
-    : valueExpression
-    ;
-
-// 16.1 <at schema clasue>
-
-atSchemaClause
-    : AT schemaReference
-    ;
-
-// 16.2 <use graph clause>
-
-useGraphClause
-    : USE graphExpression
-    ;
-
-// 16.3 <graph pattern binding table>
-
-graphPatternBindingTable
-    : graphPattern graphPatternYieldClause?
-    ;
-
-graphPatternYieldClause
-    : YIELD graphPatternYieldItemList
-    ;
-
-graphPatternYieldItemList
-    : graphPatternYieldItem (COMMA graphPatternYieldItem)*
-    | NO BINDINGS
-    ;
-
-// <elemement variable reference> and <path variable reference> are identical productions, both consisting
-// of a single non-terminal <binding variable reference>. Thus <graph pattern yield item> is ambiguous
-// from a parsing standpoint. So here we simply use bindingVariableReference. Post parsing code must
-// apply the semantics assocaited with each type of <binding variable reference>.
-graphPatternYieldItem
-    : bindingVariableReference
-//    : elementVariableReference
-//    | pathVariableReference
-    ;
-
-// 16.4 <graph pattern>
-
-graphPattern
-    : matchMode? pathPatternList keepClause? graphPatternWhereClause?
-    ;
-
-matchMode
-    : repeatableElementsMatchMode
-    | differentEdgesMatchMode
-    ;
-
-repeatableElementsMatchMode
-    : REPEATABLE elementBindingsOrElements
-    ;
-
-differentEdgesMatchMode
-    : DIFFERENT edgeBindingsOrEdges
-    ;
-
-elementBindingsOrElements
-    : ELEMENT BINDINGS?
-    | ELEMENTS
-    ;
-
-edgeBindingsOrEdges
-    : edgeSynonym BINDINGS?
-    | edgesSynonym
-    ;
-
-pathPatternList
-    : pathPattern (COMMA pathPattern)*
-    ;
-
-pathPattern
-    : pathVariableDeclaration? pathPatternPrefix? pathPatternExpression
-    ;
-
-pathVariableDeclaration
-    : pathVariable EQUALS_OPERATOR
-    ;
-
-keepClause
-    : KEEP pathPatternPrefix
-    ;
-
-graphPatternWhereClause
-    : WHERE searchCondition
-    ;
-
-// 16.5 <insert graph pattern>
-
-insertGraphPattern
-    : insertPathPatternList
-    ;
-
-insertPathPatternList
-    : insertPathPattern (COMMA insertPathPattern)*
-    ;
-
-insertPathPattern
-    : insertNodePattern (insertEdgePattern insertNodePattern)*
-    ;
-
-insertNodePattern
-    : LEFT_PAREN insertElementPatternFiller? RIGHT_PAREN
-    ;
-
-insertEdgePattern
-    : insertEdgePointingLeft
-    | insertEdgePointingRight
-    | insertEdgeUndirected
-    ;
-
-insertEdgePointingLeft
-    : LEFT_ARROW_BRACKET insertElementPatternFiller? RIGHT_BRACKET_MINUS
-    ;
-
-insertEdgePointingRight
-    : MINUS_LEFT_BRACKET insertElementPatternFiller? BRACKET_RIGHT_ARROW
-    ;
-
-insertEdgeUndirected
-    : TILDE_LEFT_BRACKET insertElementPatternFiller? RIGHT_BRACKET_TILDE
-    ;
-
-insertElementPatternFiller
-    : elementVariableDeclaration labelAndPropertySetSpecification?
-    | elementVariableDeclaration? labelAndPropertySetSpecification
-    ;
-
-labelAndPropertySetSpecification
-    : isOrColon labelSetSpecification elementPropertySpecification?
-    | (isOrColon labelSetSpecification)? elementPropertySpecification
-    ;
-
-// 16.6 <path pattern prefix>
-
-pathPatternPrefix
-    : pathModePrefix
-    | pathSearchPrefix
-    ;
-
-pathModePrefix
-    : pathMode pathOrPaths?
-    ;
-
-pathMode
-    : WALK
-    | TRAIL
-    | SIMPLE
-    | ACYCLIC
-    ;
-
-pathSearchPrefix
-    : allPathSearch
-    | anyPathSearch
-    | shortestPathSearch
-    ;
-
-allPathSearch
-    : ALL pathMode? pathOrPaths?
-    ;
-
-pathOrPaths
-    : PATH
-    | PATHS
-    ;
-
-anyPathSearch
-    : ANY numberOfPaths? pathMode? pathOrPaths?
-    ;
-
-numberOfPaths
-    : nonNegativeIntegerSpecification
-    ;
-
-shortestPathSearch
-    : allShortestPathSearch
-    | anyShortestPathSearch
-    | countedShortestPathSearch
-    | countedShortestGroupSearch
-    ;
-
-allShortestPathSearch
-    : ALL SHORTEST pathMode? pathOrPaths?
-    ;
-
-anyShortestPathSearch
-    : ANY SHORTEST pathMode? pathOrPaths?
-    ;
-
-countedShortestPathSearch
-    : SHORTEST numberOfPaths pathMode? pathOrPaths?
-    ;
-
-countedShortestGroupSearch
-    : SHORTEST numberOfGroups? pathMode? pathOrPaths? (GROUP | GROUPS)
-    ;
-
-numberOfGroups
-    : nonNegativeIntegerSpecification
-    ;
-
-// 16.7 <path pattern expression>
-
-pathPatternExpression
-    : pathTerm                                              #ppePathTerm
-    | pathTerm (MULTISET_ALTERNATION_OPERATOR pathTerm)+    #ppeMultisetAlternation
-    | pathTerm (VERTICAL_BAR pathTerm)+                     #ppePatternUnion
-    ;
-
-pathTerm
-    : pathFactor+
-    ;
-
-pathFactor
-    : pathPrimary                           #pfPathPrimary
-    | pathPrimary graphPatternQuantifier    #pfQuantifiedPathPrimary
-    | pathPrimary QUESTION_MARK             #pfQuestionedPathPrimary
-    ;
-
-pathPrimary
-    : elementPattern                        #ppElementPattern
-    | parenthesizedPathPatternExpression    #ppParenthesizedPathPatternExpression
-    | simplifiedPathPatternExpression       #ppSimplifiedPathPatternExpression
-    ;
-
-elementPattern
-    : nodePattern
-    | edgePattern
-    ;
-
-nodePattern
-    : LEFT_PAREN elementPatternFiller RIGHT_PAREN
-    ;
-
-elementPatternFiller
-    : elementVariableDeclaration? isLabelExpression? elementPatternPredicate?
-    ;
-
-elementVariableDeclaration
-    : TEMP? elementVariable
-    ;
-
-isLabelExpression
-    : isOrColon labelExpression
-    ;
-
-isOrColon
-    : IS
-    | COLON
-    ;
-
-elementPatternPredicate
-    : elementPatternWhereClause
-    | elementPropertySpecification
-    ;
-
-elementPatternWhereClause
-    : WHERE searchCondition
-    ;
-
-elementPropertySpecification
-    : LEFT_BRACE propertyKeyValuePairList RIGHT_BRACE
-    ;
-
-propertyKeyValuePairList
-    : propertyKeyValuePair (COMMA propertyKeyValuePair)*
-    ;
-
-propertyKeyValuePair
-    : propertyName COLON valueExpression
-    ;
-
-edgePattern
-    : fullEdgePattern
-    | abbreviatedEdgePattern
-    ;
-
-fullEdgePattern
-    : fullEdgePointingLeft
-    | fullEdgeUndirected
-    | fullEdgePointingRight
-    | fullEdgeLeftOrUndirected
-    | fullEdgeUndirectedOrRight
-    | fullEdgeLeftOrRight
-    | fullEdgeAnyDirection
-    ;
-
-fullEdgePointingLeft
-    : LEFT_ARROW_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
-    ;
-
-fullEdgeUndirected
-    : TILDE_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
-    ;
-
-fullEdgePointingRight
-    : MINUS_LEFT_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
-    ;
-
-fullEdgeLeftOrUndirected
-    : LEFT_ARROW_TILDE_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
-    ;
-
-fullEdgeUndirectedOrRight
-    : TILDE_LEFT_BRACKET elementPatternFiller BRACKET_TILDE_RIGHT_ARROW
-    ;
-
-fullEdgeLeftOrRight
-    : LEFT_ARROW_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
-    ;
-
-fullEdgeAnyDirection
-    : MINUS_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
-    ;
-
-abbreviatedEdgePattern
-    : LEFT_ARROW
-    | TILDE
-    | RIGHT_ARROW
-    | LEFT_ARROW_TILDE
-    | TILDE_RIGHT_ARROW
-    | LEFT_MINUS_RIGHT
-    | MINUS_SIGN
-    ;
-
-parenthesizedPathPatternExpression
-    : LEFT_PAREN subpathVariableDeclaration? pathModePrefix? pathPatternExpression parenthesizedPathPatternWhereClause? RIGHT_PAREN
-    ;
-
-subpathVariableDeclaration
-    : subpathVariable EQUALS_OPERATOR
-    ;
-
-parenthesizedPathPatternWhereClause
-    : WHERE searchCondition
-    ;
-
-// 16.8 <label expression>
-
-labelExpression
-    : EXCLAMATION_MARK labelExpression                  #labelExpressionNegation
-    | labelExpression AMPERSAND labelExpression         #labelExpressionConjunction
-    | labelExpression VERTICAL_BAR labelExpression      #labelExpressionDisjunction
-    | labelName                                         #labelExpressionName
-    | PERCENT                                           #labelExpressionWildcard
-    | LEFT_PAREN labelExpression RIGHT_PAREN            #labelExpressionParenthesized
-    ;
-
-// 16.9 <path variable reference>
-
-pathVariableReference
-    : bindingVariableReference
-    ;
-
-// 16.10 <element variable reference>
-
-elementVariableReference
-    : bindingVariableReference
-    ;
-
-// 16.11 <graph pattern quantifier>
-
-graphPatternQuantifier
-    : ASTERISK
-    | PLUS_SIGN
-    | fixedQuantifier
-    | generalQuantifier
-    ;
-
-fixedQuantifier
-    : LEFT_BRACE unsignedInteger RIGHT_BRACE
-    ;
-
-generalQuantifier
-    : LEFT_BRACE lowerBound? COMMA upperBound? RIGHT_BRACE
-    ;
-
-lowerBound
-    : unsignedInteger
-    ;
-
-upperBound
-    : unsignedInteger
-    ;
-
-// 16.12 <simplified path pattern expression>
-
-simplifiedPathPatternExpression
-    : simplifiedDefaultingLeft
-    | simplifiedDefaultingUndirected
-    | simplifiedDefaultingRight
-    | simplifiedDefaultingLeftOrUndirected
-    | simplifiedDefaultingUndirectedOrRight
-    | simplifiedDefaultingLeftOrRight
-    | simplifiedDefaultingAnyDirection
-    ;
-
-simplifiedDefaultingLeft
-    : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS
-    ;
-
-simplifiedDefaultingUndirected
-    : TILDE_SLASH simplifiedContents SLASH_TILDE
-    ;
-
-simplifiedDefaultingRight
-    : MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
-    ;
-
-simplifiedDefaultingLeftOrUndirected
-    : LEFT_TILDE_SLASH simplifiedContents SLASH_TILDE
-    ;
-
-simplifiedDefaultingUndirectedOrRight
-    : TILDE_SLASH simplifiedContents SLASH_TILDE_RIGHT
-    ;
-
-simplifiedDefaultingLeftOrRight
-    : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
-    ;
-
-simplifiedDefaultingAnyDirection
-    : MINUS_SLASH simplifiedContents SLASH_MINUS
-    ;
-
-simplifiedContents
-    : simplifiedTerm
-    | simplifiedPathUnion
-    | simplifiedMultisetAlternation
-    ;
-
-simplifiedPathUnion
-    : simplifiedTerm VERTICAL_BAR simplifiedTerm (VERTICAL_BAR simplifiedTerm)*
-    ;
-
-simplifiedMultisetAlternation
-    : simplifiedTerm MULTISET_ALTERNATION_OPERATOR simplifiedTerm (MULTISET_ALTERNATION_OPERATOR simplifiedTerm)*
-    ;
-
-simplifiedTerm
-    : simplifiedFactorLow                        #simplifiedFactorLowLabel
-    | simplifiedTerm simplifiedFactorLow      #simplifiedConcatenationLabel
-    ;
-
-simplifiedFactorLow
-    : simplifiedFactorHigh                                     #simplifiedFactorHighLabel
-    | simplifiedFactorLow AMPERSAND simplifiedFactorHigh #simplifiedConjunctionLabel
-    ;
-
-simplifiedFactorHigh
-    : simplifiedTertiary
-    | simplifiedQuantified
-    | simplifiedQuestioned
-    ;
-
-simplifiedQuantified
-    : simplifiedTertiary graphPatternQuantifier
-    ;
-
-simplifiedQuestioned
-    : simplifiedTertiary QUESTION_MARK
-    ;
-
-simplifiedTertiary
-    : simplifiedDirectionOverride
-    | simplifiedSecondary
-    ;
-
-simplifiedDirectionOverride
-    : simplifiedOverrideLeft
-    | simplifiedOverrideUndirected
-    | simplifiedOverrideRight
-    | simplifiedOverrideLeftOrUndirected
-    | simplifiedOverrideUndirectedOrRight
-    | simplifiedOverrideLeftOrRight
-    | simplifiedOverrideAnyDirection
-    ;
-
-simplifiedOverrideLeft
-    : LEFT_ANGLE_BRACKET simplifiedSecondary
-    ;
-
-simplifiedOverrideUndirected
-    : TILDE simplifiedSecondary
-    ;
-
-simplifiedOverrideRight
-    : simplifiedSecondary RIGHT_ANGLE_BRACKET
-    ;
-
-simplifiedOverrideLeftOrUndirected
-    : LEFT_ARROW_TILDE simplifiedSecondary
-    ;
-
-simplifiedOverrideUndirectedOrRight
-    : TILDE simplifiedSecondary RIGHT_ANGLE_BRACKET
-    ;
-
-simplifiedOverrideLeftOrRight
-    : LEFT_ANGLE_BRACKET simplifiedSecondary RIGHT_ANGLE_BRACKET
-    ;
-
-simplifiedOverrideAnyDirection
-    : MINUS_SIGN simplifiedSecondary
-    ;
-
-simplifiedSecondary
-    : simplifiedPrimary
-    | simplifiedNegation
-    ;
-
-simplifiedNegation
-    : EXCLAMATION_MARK simplifiedPrimary
-    ;
-
-simplifiedPrimary
-    : labelName
-    | LEFT_PAREN simplifiedContents RIGHT_PAREN
-    ;
-
-// 16.13 <where clause>
-
-whereClause
-    : WHERE searchCondition
-    ;
-
-// 16.14 <yield clause>
-
-yieldClause
-    : YIELD yieldItemList
-    ;
-
-yieldItemList
-    : yieldItem (COMMA yieldItem)*
-    ;
-
-yieldItem
-    : (yieldItemName yieldItemAlias?)
-    ;
-
-yieldItemName
-    : fieldName
-    ;
-
-yieldItemAlias
-    : AS bindingVariable
-    ;
-
-// 16.15 <group by clasue>
-
-groupByClause
-    : GROUP BY groupingElementList
-    ;
-
-groupingElementList
-    : groupingElement (COMMA groupingElement)*
-    | emptyGroupingSet
-    ;
-
-groupingElement
-    : bindingVariableReference
-    ;
-
-emptyGroupingSet
-    : LEFT_PAREN RIGHT_PAREN
-    ;
-
-// 16.16 <order by clasue>
-
-orderByClause
-    : ORDER BY sortSpecificationList
-    ;
-
-// 16.17 <sort specification list>
-
-sortSpecificationList
-    : sortSpecification (COMMA sortSpecification)*
-    ;
-
-sortSpecification
-    : sortKey orderingSpecification? nullOrdering?
-    ;
-
-sortKey
-    : aggregatingValueExpression
-    ;
-
-orderingSpecification
-    : ASC
-    | ASCENDING
-    | DESC
-    | DESCENDING
-    ;
-
-nullOrdering
-    : NULLS FIRST
-    | NULLS LAST
-    ;
-
-// 16.18 <limit clause>
-
-limitClause
-    : LIMIT nonNegativeIntegerSpecification
-    ;
-
-// 16.19 <offset clause>
-
-offsetClause
-    : offsetSynonym nonNegativeIntegerSpecification
-    ;
-
-offsetSynonym
-    : OFFSET
-    | SKIP_RESERVED_WORD
-    ;
-
-// 17.1 <schema reference> and <catalog schema parent name>
-
-schemaReference
-    : absoluteCatalogSchemaReference
-    | relativeCatalogSchemaReference
-    | referenceParameterSpecification
-    ;
-
-absoluteCatalogSchemaReference
-    : SOLIDUS
-    | absoluteDirectoryPath schemaName
-    ;
-
-catalogSchemaParentAndName
-    : absoluteDirectoryPath schemaName
-    ;
-
-relativeCatalogSchemaReference
-    : predefinedSchemaReference
-    | relativeDirectoryPath schemaName
-    ;
-
-predefinedSchemaReference
-    : HOME_SCHEMA
-    | CURRENT_SCHEMA
-    | PERIOD
-    ;
-
-absoluteDirectoryPath
-    : SOLIDUS simpleDirectoryPath?
-    ;
-
-relativeDirectoryPath
-    : DOUBLE_PERIOD (SOLIDUS DOUBLE_PERIOD)* SOLIDUS simpleDirectoryPath?
-    ;
-
-simpleDirectoryPath
-    : (directoryName SOLIDUS)+
-    ;
-
-// 17.2 <graph reference> and <catalog graph parent and name>
-
-graphReference
-    : catalogObjectParentReference graphName
-    | delimitedGraphName
-    | homeGraph
-    | referenceParameterSpecification
-    ;
-
-catalogGraphParentAndName
-    : catalogObjectParentReference? graphName
-    ;
-
-homeGraph
-    : HOME_PROPERTY_GRAPH
-    | HOME_GRAPH
-    ;
-
-// 17.3 <graph type reference> and <catalog graph type parent and name>
-
-graphTypeReference
-    : catalogGraphTypeParentAndName
-    | referenceParameterSpecification
-    ;
-
-catalogGraphTypeParentAndName
-    : catalogObjectParentReference? graphTypeName
-    ;
-
-// 17.4 <binding table reference> and <catalog binding table parent name>
-
-bindingTableReference
-    : catalogObjectParentReference bindingTableName
-    | delimitedBindingTableName
-    | referenceParameterSpecification
-    ;
-
-// 17.5 <procedure reference> and <catalog procedure parent and name>
-
-procedureReference
-    : catalogProcedureParentAndName
-    | referenceParameterSpecification
-    ;
-
-catalogProcedureParentAndName
-    : catalogObjectParentReference? procedureName
-    ;
-
-// 17.6 <catalog object parent reference>
-
-catalogObjectParentReference
-    : schemaReference SOLIDUS? (objectName PERIOD)*
-    |  (objectName PERIOD)+
-    ;
-
-// 17.7 <reference parameter specification>
-
-referenceParameterSpecification
-    : SUBSTITUTED_PARAMETER_REFERENCE
-    ;
-
-// 18.1 <nested graph type specification>
-
-nestedGraphTypeSpecification
-    : LEFT_BRACE graphTypeSpecificationBody RIGHT_BRACE
-    ;
-
-graphTypeSpecificationBody
-    : elementTypeList
-    ;
-
-elementTypeList
-    : elementTypeSpecification (COMMA elementTypeSpecification)*
-    ;
-
-elementTypeSpecification
-    : nodeTypeSpecification
-    | edgeTypeSpecification
-    ;
-
-// 18.2 <node type specification>
-
-nodeTypeSpecification
-    : nodeTypePattern
-    | nodeTypePhrase
-    ;
-
-nodeTypePattern
-    : (nodeSynonym TYPE? nodeTypeName)? LEFT_PAREN localNodeTypeAlias? nodeTypeFiller? RIGHT_PAREN
-    ;
-
-nodeTypePhrase
-    : nodeSynonym TYPE? nodeTypePhraseFiller (AS localNodeTypeAlias)?
-    ;
-
-nodeTypePhraseFiller
-    : nodeTypeName nodeTypeFiller?
-    | nodeTypeFiller
-    ;
-
-nodeTypeFiller
-    : nodeTypeKeyLabelSet nodeTypeImpliedContent?
-    | nodeTypeImpliedContent
-    ;
-
-localNodeTypeAlias
-    : regularIdentifier
-    ;
-
-nodeTypeImpliedContent
-    : nodeTypeLabelSet
-    | nodeTypePropertyTypes
-    | nodeTypeLabelSet nodeTypePropertyTypes
-    ;
-
-nodeTypeKeyLabelSet
-    : labelSetPhrase? IMPLIES
-    ;
-
-nodeTypeLabelSet
-    : labelSetPhrase
-    ;
-
-nodeTypePropertyTypes
-    : propertyTypesSpecification
-    ;
-
-// 18.3 <edge type specification>
-
-edgeTypeSpecification
-    : edgeTypePattern
-    | edgeTypePhrase
-    ;
-
-edgeTypePattern
-    : (edgeKind? edgeSynonym TYPE? edgeTypeName)? (edgeTypePatternDirected | edgeTypePatternUndirected)
-    ;
-
-edgeTypePhrase
-    : edgeKind edgeSynonym TYPE? edgeTypePhraseFiller endpointPairPhrase
-    ;
-
-edgeTypePhraseFiller
-    : edgeTypeName edgeTypeFiller?
-    | edgeTypeFiller
-    ;
-
-edgeTypeFiller
-    : edgeTypeKeyLabelSet edgeTypeImpliedContent?
-    | edgeTypeImpliedContent
-    ;
-
-edgeTypeImpliedContent
-    : edgeTypeLabelSet
-    | edgeTypePropertyTypes
-    | edgeTypeLabelSet edgeTypePropertyTypes
-    ;
-
-edgeTypeKeyLabelSet
-    : labelSetPhrase? IMPLIES
-    ;
-
-edgeTypeLabelSet
-    : labelSetPhrase
-    ;
-
-edgeTypePropertyTypes
-    : propertyTypesSpecification
-    ;
-
-edgeTypePatternDirected
-    : edgeTypePatternPointingRight
-    | edgeTypePatternPointingLeft
-    ;
-
-edgeTypePatternPointingRight
-    : sourceNodeTypeReference arcTypePointingRight destinationNodeTypeReference
-    ;
-
-edgeTypePatternPointingLeft
-    : destinationNodeTypeReference arcTypePointingLeft sourceNodeTypeReference
-    ;
-
-edgeTypePatternUndirected
-    : sourceNodeTypeReference arcTypeUndirected destinationNodeTypeReference
-    ;
-
-arcTypePointingRight
-    : MINUS_LEFT_BRACKET edgeTypeFiller BRACKET_RIGHT_ARROW
-    ;
-
-arcTypePointingLeft
-    : LEFT_ARROW_BRACKET edgeTypeFiller RIGHT_BRACKET_MINUS
-    ;
-
-arcTypeUndirected
-    : TILDE_LEFT_BRACKET edgeTypeFiller RIGHT_BRACKET_TILDE
-    ;
-
-sourceNodeTypeReference
-    : LEFT_PAREN sourceNodeTypeAlias RIGHT_PAREN
-    | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
-    ;
-
-destinationNodeTypeReference
-    : LEFT_PAREN destinationNodeTypeAlias RIGHT_PAREN
-    | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
-    ;
-
-edgeKind
-    : DIRECTED
-    | UNDIRECTED
-    ;
-
-endpointPairPhrase
-    : CONNECTING endpointPair
-    ;
-
-endpointPair
-    : endpointPairDirected
-    | endpointPairUndirected
-    ;
-
-endpointPairDirected
-    : endpointPairPointingRight
-    | endpointPairPointingLeft
-    ;
-
-endpointPairPointingRight
-    : LEFT_PAREN sourceNodeTypeAlias connectorPointingRight destinationNodeTypeAlias RIGHT_PAREN
-    ;
-
-endpointPairPointingLeft
-    : LEFT_PAREN destinationNodeTypeAlias LEFT_ARROW sourceNodeTypeAlias RIGHT_PAREN
-    ;
-
-endpointPairUndirected
-    : LEFT_PAREN sourceNodeTypeAlias connectorUndirected destinationNodeTypeAlias RIGHT_PAREN
-    ;
-
-connectorPointingRight
-    : TO
-    | RIGHT_ARROW
-    ;
-
-connectorUndirected
-    : TO
-    | TILDE
-    ;
-
-sourceNodeTypeAlias
-    : regularIdentifier
-    ;
-
-destinationNodeTypeAlias
-    : regularIdentifier
-    ;
-
-// 18.4 <label set phrase> and <label set specification>
-
-labelSetPhrase
-    : LABEL labelName
-    | LABELS labelSetSpecification
-    | isOrColon labelSetSpecification
-    ;
-
-labelSetSpecification
-    : labelName (AMPERSAND labelName)*
-    ;
-
-// 18.5 <property types specification>
-
-propertyTypesSpecification
-    : LEFT_BRACE propertyTypeList? RIGHT_BRACE
-    ;
-
-propertyTypeList
-    : propertyType (COMMA propertyType)*
-    ;
-
-// 18.6 <property type>
-
-propertyType
-    : propertyName typed? propertyValueType
-    ;
-
-// 18.7 <property value type>
-
-propertyValueType
-    : valueType
-    ;
-
-// 18.8 <binding table type>
-
-bindingTableType
-    : BINDING? TABLE fieldTypesSpecification
-    ;
-
-// 18.9 <value type>
-
-valueType
-    : predefinedType                                                                                                                              #predefinedTypeLabel
-    // <constructed value type>
-    | pathValueType                                                                                                                               #pathValueTypeLabel
-    | listValueTypeName LEFT_ANGLE_BRACKET valueType RIGHT_ANGLE_BRACKET (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
-    | valueType listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                    #listValueTypeAlt2
-    | listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                                #listValueTypeAlt3
-    | recordType                                                                                                                                   #recordTypeLabel
-    // <dynamic union type>
-    | ANY VALUE? notNull?                                                                                                                        #openDynamicUnionTypeLabel
-    | ANY? PROPERTY VALUE notNull?                                                                                                             #dynamicPropertyValueTypeLabel
-    // <closed dynamic union type>
-    | ANY VALUE? LEFT_ANGLE_BRACKET valueType (VERTICAL_BAR valueType)* RIGHT_ANGLE_BRACKET                                         #closedDynamicUnionTypeAtl1
-    | valueType VERTICAL_BAR valueType                                                                                                        #closedDynamicUnionTypeAtl2
-    ;
-
-typed
-    : DOUBLE_COLON
-    | TYPED
-    ;
-
-predefinedType
-    : booleanType
-    | characterStringType
-    | byteStringType
-    | numericType
-    | temporalType
-    | referenceValueType
-    | immaterialValueType
-    ;
-
-booleanType
-    : (BOOL | BOOLEAN) notNull?
-    ;
-
-characterStringType
-    : STRING (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
-    | CHAR (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
-    | VARCHAR (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
-    ;
-
-byteStringType
-    : BYTES (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
-    | BINARY (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
-    | VARBINARY (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
-    ;
-
-minLength
-    : unsignedInteger
-    ;
-
-maxLength
-    : unsignedInteger
-    ;
-
-fixedLength
-    : unsignedInteger
-    ;
-
-numericType
-    : exactNumericType
-    | approximateNumericType
-    ;
-
-exactNumericType
-    : binaryExactNumericType
-    | decimalExactNumericType
-    ;
-
-binaryExactNumericType
-    : signedBinaryExactNumericType
-    | unsignedBinaryExactNumericType
-    ;
-
-signedBinaryExactNumericType
-    : INT8 notNull?
-    | INT16 notNull?
-    | INT32 notNull?
-    | INT64 notNull?
-    | INT128 notNull?
-    | INT256 notNull?
-    | SMALLINT notNull?
-    | INT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
-    | BIGINT notNull?
-    | SIGNED? verboseBinaryExactNumericType
-    ;
-
-unsignedBinaryExactNumericType
-    : UINT8 notNull?
-    | UINT16 notNull?
-    | UINT32 notNull?
-    | UINT64 notNull?
-    | UINT128 notNull?
-    | UINT256 notNull?
-    | USMALLINT notNull?
-    | UINT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
-    | UBIGINT notNull?
-    | UNSIGNED verboseBinaryExactNumericType
-    ;
-
-verboseBinaryExactNumericType
-    : INTEGER8 notNull?
-    | INTEGER16 notNull?
-    | INTEGER32 notNull?
-    | INTEGER64 notNull?
-    | INTEGER128 notNull?
-    | INTEGER256 notNull?
-    | SMALL INTEGER notNull?
-    | INTEGER (LEFT_PAREN precision RIGHT_PAREN)? notNull?
-    | BIG INTEGER notNull?
-    ;
-
-decimalExactNumericType
-    : (DECIMAL | DEC) (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN notNull?)?
-    ;
-
-precision
-    : unsignedDecimalInteger
-    ;
-
-scale
-    : unsignedDecimalInteger
-    ;
-
-approximateNumericType
-    : FLOAT16 notNull?
-    | FLOAT32 notNull?
-    | FLOAT64 notNull?
-    | FLOAT128 notNull?
-    | FLOAT256 notNull?
-    | FLOAT (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN)? notNull?
-    | REAL notNull?
-    | DOUBLE PRECISION? notNull?
-    ;
-
-temporalType
-    : temporalInstantType
-    | temporalDurationType
-    ;
-
-temporalInstantType
-    : datetimeType
-    | localdatetimeType
-    | dateType
-    | timeType
-    | localtimeType
-    ;
-
-datetimeType
-    : ZONED DATETIME notNull?
-    | TIMESTAMP WITH TIME ZONE notNull?
-    ;
-
-localdatetimeType
-    : LOCAL DATETIME notNull?
-    | TIMESTAMP (WITHOUT TIME ZONE)? notNull?
-    ;
-
-dateType
-    : DATE notNull?
-    ;
-
-timeType
-    : ZONED TIME notNull?
-    | TIME WITH TIME ZONE notNull?
-    ;
-
-localtimeType
-    : LOCAL TIME notNull?
-    | TIME WITHOUT TIME ZONE notNull?
-    ;
-
-temporalDurationType
-    : DURATION LEFT_PAREN temporalDurationQualifier RIGHT_PAREN notNull?
-    ;
-
-temporalDurationQualifier
-    : YEAR TO MONTH
-    | DAY TO SECOND
-    ;
-
-referenceValueType
-    : graphReferenceValueType
-    | bindingTableReferenceValueType
-    | nodeReferenceValueType
-    | edgeReferenceValueType
-    ;
-
-immaterialValueType
-    : nullType
-    | emptyType
-    ;
-
-nullType
-    : NULL
-    ;
-
-emptyType
-    : NULL notNull
-    | NOTHING
-    ;
-
-graphReferenceValueType
-    : openGraphReferenceValueType
-    | closedGraphReferenceValueType
-    ;
-
-closedGraphReferenceValueType
-    : PROPERTY? GRAPH nestedGraphTypeSpecification notNull?
-    ;
-
-openGraphReferenceValueType
-    : ANY PROPERTY? GRAPH notNull?
-    ;
-
-bindingTableReferenceValueType
-    : bindingTableType notNull?
-    ;
-
-nodeReferenceValueType
-    : openNodeReferenceValueType
-    | closedNodeReferenceValueType
-    ;
-
-closedNodeReferenceValueType
-    : nodeTypeSpecification notNull?
-    ;
-
-openNodeReferenceValueType
-    : ANY? nodeSynonym notNull?
-    ;
-
-edgeReferenceValueType
-    : openEdgeReferenceValueType
-    | closedEdgeReferenceValueType
-    ;
-
-closedEdgeReferenceValueType
-    : edgeTypeSpecification notNull?
-    ;
-
-openEdgeReferenceValueType
-    : ANY? edgeSynonym notNull?
-    ;
-
-pathValueType
-    : PATH notNull?
-    ;
-
-listValueTypeName
-    : GROUP? listValueTypeNameSynonym
-    ;
-
-listValueTypeNameSynonym
-    : LIST
-    | ARRAY
-    ;
-
-recordType
-    : ANY? RECORD notNull?
-    | RECORD? fieldTypesSpecification notNull?
-    ;
-
-fieldTypesSpecification
-    : LEFT_BRACE fieldTypeList? RIGHT_BRACE
-    ;
-
-fieldTypeList
-    : fieldType (COMMA fieldType)*
-    ;
-
-notNull
-    :  NOT NULL
-    ;
-
-// 18.10 <field type>
-
-fieldType
-    : fieldName typed? valueType
-    ;
-
-// 19.1 <search condition>
-
-searchCondition
-    : booleanValueExpression
-    ;
-
-// 19.2 <predicate>
-
-predicate
-    : existsPredicate
-    | nullPredicate
-    | valueTypePredicate
-    | directedPredicate
-    | labeledPredicate
-    | sourceDestinationPredicate
-    | all_differentPredicate
-    | samePredicate
-    | property_existsPredicate
-    ;
-
-// 19.3 <comparison predicate>
-
-// The <comparison predicate> productions moved to valueExpression
-// to avoid left mutually recursive productions.
-
-comparisonPredicatePart2
-    : compOp valueExpression
-    ;
-
-compOp
-    : EQUALS_OPERATOR
-    | NOT_EQUALS_OPERATOR
-    | LEFT_ANGLE_BRACKET
-    | RIGHT_ANGLE_BRACKET
-    | LESS_THAN_OR_EQUALS_OPERATOR
-    | GREATER_THAN_OR_EQUALS_OPERATOR
-    ;
-
-// 19.4 <exists predicate>
-
-existsPredicate
-    : EXISTS (LEFT_BRACE graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern RIGHT_PAREN | LEFT_BRACE matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock RIGHT_PAREN | nestedQuerySpecification)
-    ;
-
-// 19.5 <null predicate>
-
-nullPredicate
-    : valueExpressionPrimary nullPredicatePart2
-    ;
-
-nullPredicatePart2
-    : IS NOT? NULL
-    ;
-
-// 19.6 <value type predicate>
-
-valueTypePredicate
-    : valueExpressionPrimary valueTypePredicatePart2
-    ;
-
-valueTypePredicatePart2
-    : IS NOT? typed valueType
-    ;
-
-// 19.7 <normalized predicate>
-
-normalizedPredicatePart2
-    : IS NOT? normalForm? NORMALIZED
-    ;
-
-// 19.8 <directed predicate>
-
-directedPredicate
-    : elementVariableReference directedPredicatePart2
-    ;
-
-directedPredicatePart2
-    : IS NOT? DIRECTED
-    ;
-
-// 19.9 <labled predicate>
-
-labeledPredicate
-    : elementVariableReference labeledPredicatePart2
-    ;
-
-labeledPredicatePart2
-    : isLabeledOrColon labelExpression
-    ;
-
-isLabeledOrColon
-    : IS NOT? LABELED
-    | COLON
-    ;
-
-// 19.10 <source/destination predicate>
-
-sourceDestinationPredicate
-    : nodeReference sourcePredicatePart2
-    | nodeReference destinationPredicatePart2
-    ;
-
-nodeReference
-    : elementVariableReference
-    ;
-
-sourcePredicatePart2
-    : IS NOT? SOURCE OF edgeReference
-    ;
-
-destinationPredicatePart2
-    : IS NOT? DESTINATION OF edgeReference
-    ;
-
-edgeReference
-    : elementVariableReference
-    ;
-
-// 19.11 <all different predicate>
-
-all_differentPredicate
-    : ALL_DIFFERENT LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
-    ;
-
-// 19.12 <same predicate>
-
-samePredicate
-    : SAME LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
-    ;
-
-// 19.13 <property exists predicate>
-
-property_existsPredicate
-    : PROPERTY_EXISTS LEFT_PAREN elementVariableReference COMMA propertyName RIGHT_PAREN
-    ;
-
-// 20.1 <value expression>
-
-// This version of valueExpression sucks up rules broken out in the standard to a single production. This
-// eliminates ambiguity in multiple rules specifying valueExpressionPrimary.
-
-valueExpression
-    // Numeric, datetime and duration types all support roughly the same expressions. So here
-    // we define a rule that deals with all of them. It is up to the implementation to post
-    // process the sytnax tree and flag invalid type and function combinations.
-    : sign = (PLUS_SIGN | MINUS_SIGN) valueExpression                       #signedExprAlt
-    | valueExpression operator = (ASTERISK | SOLIDUS) valueExpression       #multDivExprAlt
-    | valueExpression operator = (PLUS_SIGN | MINUS_SIGN) valueExpression   #addSubtractExprAlt
-    // Character strings, byte strings, lists and paths all support the same concatenation
-    // operator. So here we define a rule that deals with all of them. Of course the types
-    // cannot be combined. So it is up to implementation to post process the sytax tree
-    // and flag invalid type and function combinations.
-    | valueExpression CONCATENATION_OPERATOR valueExpression                #concatenationExprAlt
-    // Boolean value expression included here.
-    | NOT valueExpression                                                   #notExprAlt
-    | valueExpression IS NOT? truthValue                                    #isNotExprAlt
-    | valueExpression AND valueExpression                                   #conjunctiveExprAlt
-    | valueExpression operator = (OR | XOR) valueExpression                 #disjunctiveExprAlt
-    // The comparisonPredicate productions moved here to eliminate left mutual recursion.
-    | valueExpression comparisonPredicatePart2                              #comparisonExprAlt
-    | predicate                                                             #predicateExprAlt
-    // The normalizedPredicate productions moved here to eliminate left mutual recursion.
-    | valueExpression normalizedPredicatePart2                              #normalizedPredicateExprAlt
-    | PROPERTY? GRAPH graphExpression                                       #propertyGraphExprAlt
-    | BINDING? TABLE bindingTableExpression                                 #bindingTableExprAlt
-    | valueFunction                                                         #valueFunctionExprAlt
-    | valueExpressionPrimary                                                #primaryExprAlt
-    ;
-
-valueFunction
-    : numericValueFunction
-    | datetimeSubtraction
-    | datetimeValueFunction
-    | durationValueFunction
-    | characterOrByteStringFunction
-    | listValueFunction
-    ;
-
-booleanValueExpression
-    : valueExpression
-    ;
-
-characterOrByteStringFunction
-    : subCharacterOrByteString
-    | trimSingleCharacterOrByteString
-    | foldCharacterString
-    | trimMultiCharacterCharacterString
-    | normalizeCharacterString
-    ;
-
-subCharacterOrByteString
-    : (LEFT | RIGHT) LEFT_PAREN valueExpression COMMA stringLength RIGHT_PAREN
-    ;
-
-trimSingleCharacterOrByteString
-    : TRIM LEFT_PAREN trimOperands RIGHT_PAREN
-    ;
-
-foldCharacterString
-    : (UPPER | LOWER) LEFT_PAREN valueExpression RIGHT_PAREN
-    ;
-
-trimMultiCharacterCharacterString
-    : (BTRIM | LTRIM | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? RIGHT_PAREN
-    ;
-
-normalizeCharacterString
-    : NORMALIZE LEFT_PAREN valueExpression (COMMA normalForm)? RIGHT_PAREN
-    ;
-
-nodeReferenceValueExpression
-    : valueExpressionPrimary
-    ;
-
-edgeReferenceValueExpression
-    : valueExpressionPrimary
-    ;
-
-aggregatingValueExpression
-    : valueExpression
-    ;
-
-// 20.2 <value expression primary>
-
-valueExpressionPrimary
-    : parenthesizedValueExpression
-    | aggregateFunction
-    | unsignedValueSpecification
-// List and Record literals are reduntantly/abiguously part of the literal production
-//    | listValueConstructor
-//    | recordConstructor
-    | pathValueConstructor
-    | valueExpressionPrimary PERIOD propertyName      // <propertyReference
-    | valueQueryExpression
-    | caseExpression
-    | castSpecification
-    | element_idFunction
-    | letValueExpression
-    | bindingVariableReference
-    ;
-
-parenthesizedValueExpression
-    : LEFT_PAREN valueExpression RIGHT_PAREN
-    ;
-
-nonParenthesizedValueExpressionPrimary
-    : nonParenthesizedValueExpressionPrimarySpecialCase
-    | bindingVariableReference
-    ;
-
-nonParenthesizedValueExpressionPrimarySpecialCase
-    : aggregateFunction
-    | unsignedValueSpecification
-// List and Record literals are reduntantly/abiguously part of the literal production
-//    | listValueConstructor
-//    | recordConstructor
-    | pathValueConstructor
-    | valueExpressionPrimary PERIOD propertyName      // <property reference>
-    | valueQueryExpression
-    | caseExpression
-    | castSpecification
-    | element_idFunction
-    | letValueExpression
-    ;
-
-// 20.3 <value specification>
-
-unsignedValueSpecification
-    : unsignedLiteral
-    | generalValueSpecification
-    ;
-
-nonNegativeIntegerSpecification
-    : unsignedInteger
-    | dynamicParameterSpecification
-    ;
-
-generalValueSpecification
-    : dynamicParameterSpecification
-    | SESSION_USER
-    ;
-
-// 20.4 <dynamic parameter specification>
-
-dynamicParameterSpecification
-    : GENERAL_PARAMETER_REFERENCE
-    ;
-
-// 20.5 <let value expression>
-
-letValueExpression
-    : LET letVariableDefinitionList IN valueExpression END
-    ;
-
-// 20.6 <value query expression>
-
-valueQueryExpression
-    : VALUE nestedQuerySpecification
-    ;
-
-// 20.7 <case expression>
-
-caseExpression
-    : caseAbbreviation
-    | caseSpecification
-    ;
-
-caseAbbreviation
-    : NULLIF LEFT_PAREN valueExpression COMMA valueExpression RIGHT_PAREN
-    | COALESCE LEFT_PAREN valueExpression (COMMA valueExpression)+ RIGHT_PAREN
-    ;
-
-caseSpecification
-    : simpleCase
-    | searchedCase
-    ;
-
-simpleCase
-    : CASE caseOperand simpleWhenClause+ elseClause? END
-    ;
-
-searchedCase
-    : CASE searchedWhenClause+ elseClause? END
-    ;
-
-simpleWhenClause
-    : WHEN whenOperandList THEN result
-    ;
-
-searchedWhenClause
-    : WHEN searchCondition THEN result
-    ;
-
-elseClause
-    : ELSE result
-    ;
-
-caseOperand
-    : nonParenthesizedValueExpressionPrimary
-    | elementVariableReference
-    ;
-
-whenOperandList
-    : whenOperand (COMMA whenOperand)*
-    ;
-
-whenOperand
-    : nonParenthesizedValueExpressionPrimary
-    | comparisonPredicatePart2
-    | nullPredicatePart2
-    | valueTypePredicatePart2
-    | normalizedPredicatePart2
-    | directedPredicatePart2
-    | labeledPredicatePart2
-    | sourcePredicatePart2
-    | destinationPredicatePart2
-    ;
-
-result
-    : resultExpression
-    | nullLiteral
-    ;
-
-resultExpression
-    : valueExpression
-    ;
-
-// 20.8 <cast specification>
-
-castSpecification
-    : CAST LEFT_PAREN castOperand AS castTarget RIGHT_PAREN
-    ;
-
-castOperand
-    : valueExpression
-    | nullLiteral
-    ;
-
-castTarget
-    : valueType
-    ;
-
-// 20.9 <aggregate function>
-
-aggregateFunction
-    : COUNT LEFT_PAREN ASTERISK RIGHT_PAREN
-    | generalSetFunction
-    | binarySetFunction
-    ;
-
-generalSetFunction
-    : generalSetFunctionType LEFT_PAREN setQuantifier? valueExpression RIGHT_PAREN
-    ;
-
-binarySetFunction
-    : binarySetFunctionType LEFT_PAREN dependentValueExpression COMMA independentValueExpression RIGHT_PAREN
-    ;
-
-generalSetFunctionType
-    : AVG
-    | COUNT
-    | MAX
-    | MIN
-    | SUM
-    | COLLECT_LIST
-    | STDDEV_SAMP
-    | STDDEV_POP
-    ;
-
-setQuantifier
-    : DISTINCT
-    | ALL
-    ;
-
-binarySetFunctionType
-    : PERCENTILE_CONT
-    | PERCENTILE_DISC
-    ;
-
-dependentValueExpression
-    : setQuantifier? numericValueExpression
-    ;
-
-independentValueExpression
-    : numericValueExpression
-    ;
-
-// 20.10 <element_id function>
-
-element_idFunction
-    : ELEMENT_ID LEFT_PAREN elementVariableReference RIGHT_PAREN
-    ;
-
-// 20.11 <property reference>
-
-// 20.12 <binding variable reference>
-
-bindingVariableReference
-    : bindingVariable
-    ;
-
-// The path value expression was combined with list and string value expressions.
-// See listStringOrPathValueExpression.
-
-pathValueExpression
-    : valueExpression
-    ;
-
-// 20.14 <path value constructor>
-
-pathValueConstructor
-    : pathValueConstructorByEnumeration
-    ;
-
-pathValueConstructorByEnumeration
-    : PATH LEFT_BRACKET pathElementList RIGHT_BRACKET
-    ;
-
-pathElementList
-    : pathElementListStart pathElementListStep*
-    ;
-
-pathElementListStart
-    : nodeReferenceValueExpression
-    ;
-
-pathElementListStep
-    : COMMA edgeReferenceValueExpression COMMA nodeReferenceValueExpression
-    ;
-
-// 20.15 <list value expression>
-
-// The list value expression was combined with path and string value expressions.
-// See listStringOrPathValueExpression.
-
-listValueExpression
-    : valueExpression
-    ;
-
-// 20.16 <list value function>
-
-// Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
-// apply to characterString, byteString and list. Breaking them out separately resulted in
-// ambiguity.
-
-listValueFunction
-    : trimListFunction
-    | elementsFunction
-    ;
-
-trimListFunction
-    : TRIM LEFT_PAREN listValueExpression COMMA numericValueExpression RIGHT_PAREN
-    ;
-
-elementsFunction
-    : ELEMENTS LEFT_PAREN pathValueExpression RIGHT_PAREN
-    ;
-
-// 20.17 <list value constructor>
-
-listValueConstructor
-    : listValueConstructorByEnumeration
-    ;
-
-listValueConstructorByEnumeration
-    : listValueTypeName? LEFT_BRACKET listElementList? RIGHT_BRACKET
-    ;
-
-listElementList
-    : listElement (COMMA listElement)*
-    ;
-
-listElement
-    : valueExpression
-    ;
-
-// 20.18 <record constructor>
-
-recordConstructor
-    : RECORD? fieldsSpecification
-    ;
-
-fieldsSpecification
-    : LEFT_BRACE fieldList? RIGHT_BRACE
-    ;
-
-fieldList
-    : field (COMMA field)*
-    ;
-
-// 20.19 <field>
-
-field
-    : fieldName COLON valueExpression
-    ;
-
-// 20.20 <boolean value expression>
-
-// Most of <boolean value expression> is incorporated in valueExpression
-
-truthValue
-    : BOOLEAN_LITERAL
-    ;
-
-// 20.21 <numeric value expression>
-
-numericValueExpression
-    : sign = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
-    | numericValueExpression operator = (ASTERISK | SOLIDUS) numericValueExpression
-    | numericValueExpression operator = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
-    | valueExpressionPrimary
-    | numericValueFunction
-    ;
-
-// 20.22 <numeric value function>
-
-numericValueFunction
-    : lengthExpression
-    | cardinalityExpression
-    | absoluteValueExpression
-    | modulusExpression
-    | trigonometricFunction
-    | generalLogarithmFunction
-    | commonLogarithm
-    | naturalLogarithm
-    | exponentialFunction
-    | powerFunction
-    | squareRoot
-    | floorFunction
-    | ceilingFunction
-    ;
-
-lengthExpression
-    : charLengthExpression
-    | byteLengthExpression
-    | pathLengthExpression
-    ;
-
-cardinalityExpression
-    : CARDINALITY LEFT_PAREN cardinalityExpressionArgument RIGHT_PAREN
-    | SIZE LEFT_PAREN listValueExpression RIGHT_PAREN
-    ;
-
-cardinalityExpressionArgument
-    : valueExpression
-    ;
-
-charLengthExpression
-    : (CHAR_LENGTH | CHARACTER_LENGTH) LEFT_PAREN characterStringValueExpression RIGHT_PAREN
-    ;
-
-byteLengthExpression
-    : (BYTE_LENGTH | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression RIGHT_PAREN
-    ;
-
-pathLengthExpression
-    : PATH_LENGTH LEFT_PAREN pathValueExpression RIGHT_PAREN
-    ;
-
-// absoluteValueExpression applies to both numeric types and duration types. They have the same syntax.
-absoluteValueExpression
-    : ABS LEFT_PAREN valueExpression RIGHT_PAREN
-    ;
-
-modulusExpression
-    : MOD LEFT_PAREN numericValueExpressionDividend COMMA numericValueExpressionDivisor RIGHT_PAREN
-    ;
-
-numericValueExpressionDividend
-    : numericValueExpression
-    ;
-
-numericValueExpressionDivisor
-    : numericValueExpression
-    ;
-
-trigonometricFunction
-    : trigonometricFunctionName LEFT_PAREN numericValueExpression RIGHT_PAREN
-    ;
-
-trigonometricFunctionName
-    : SIN
-    | COS
-    | TAN
-    | COT
-    | SINH
-    | COSH
-    | TANH
-    | ASIN
-    | ACOS
-    | ATAN
-    | DEGREES
-    | RADIANS
-    ;
-
-generalLogarithmFunction
-    : LOG LEFT_PAREN generalLogarithmBase COMMA generalLogarithmArgument RIGHT_PAREN
-    ;
-
-generalLogarithmBase
-    : numericValueExpression
-    ;
-
-generalLogarithmArgument
-    : numericValueExpression
-    ;
-
-commonLogarithm
-    : LOG10 LEFT_PAREN numericValueExpression RIGHT_PAREN
-    ;
-
-naturalLogarithm
-    : LN LEFT_PAREN numericValueExpression RIGHT_PAREN
-    ;
-
-exponentialFunction
-    : EXP LEFT_PAREN numericValueExpression RIGHT_PAREN
-    ;
-
-powerFunction
-    : POWER LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent RIGHT_PAREN
-    ;
-
-numericValueExpressionBase
-    : numericValueExpression
-    ;
-
-numericValueExpressionExponent
-    : numericValueExpression
-    ;
-
-squareRoot
-    : SQRT LEFT_PAREN numericValueExpression RIGHT_PAREN
-    ;
-
-floorFunction
-    : FLOOR LEFT_PAREN numericValueExpression RIGHT_PAREN
-    ;
-
-ceilingFunction
-    : (CEIL | CEILING) LEFT_PAREN numericValueExpression RIGHT_PAREN
-    ;
-
-// 20.23 <string value expression>
-
-// The string value expressions were combined with list and path value expressions.
-
-characterStringValueExpression
-    : valueExpression
-    ;
-
-byteStringValueExpression
-    : valueExpression
-    ;
-
-// 20.24 <string value function>
-
-// Note: String functions were moved to characterByteStringOrListFunction, some alternatives
-// apply to characterString, byteString and list. Breaking them out separately resulted in
-// ambiguity.
-
-trimOperands
-    : (trimSpecification? trimCharacterOrByteString? FROM)? trimCharacterOrByteStringSource
-    ;
-
-trimCharacterOrByteStringSource
-    : valueExpression
-    ;
-
-trimSpecification
-    : LEADING
-    | TRAILING
-    | BOTH
-    ;
-
-trimCharacterOrByteString
-    : valueExpression
-    ;
-
-normalForm
-    : NFC
-    | NFD
-    | NFKC
-    | NFKD
-    ;
-
-stringLength
-    : numericValueExpression
-    ;
-
-// 20.25 <byte string function>
-
-// Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
-// apply to characterString, byteString and list. Breaking them out separately resulted in
-// ambiguity.
-
-// 20.26 <datetime value expression>
-
-// The implementation should enforce that the data type is a datetime value.
-datetimeValueExpression
-     : valueExpression
-     ;
-
-// 20.27 <datetime value function>
-
-datetimeValueFunction
-    : dateFunction
-    | timeFunction
-    | datetimeFunction
-    | localtimeFunction
-    | localdatetimeFunction
-    ;
-
-dateFunction
-    : CURRENT_DATE
-    | DATE LEFT_PAREN dateFunctionParameters? RIGHT_PAREN
-    ;
-
-timeFunction
-    : CURRENT_TIME
-    | ZONED_TIME LEFT_PAREN timeFunctionParameters? RIGHT_PAREN
-    ;
-
-localtimeFunction
-    : LOCAL_TIME (LEFT_PAREN timeFunctionParameters? RIGHT_PAREN)?
-    ;
-
-datetimeFunction
-    : CURRENT_TIMESTAMP
-    | ZONED_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
-    ;
-
-localdatetimeFunction
-    : LOCAL_TIMESTAMP
-    | LOCAL_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
-    ;
-
-dateFunctionParameters
-    : dateString
-    | recordConstructor
-    ;
-
-timeFunctionParameters
-    : timeString
-    | recordConstructor
-    ;
-
-datetimeFunctionParameters
-    : datetimeString
-    | recordConstructor
-    ;
-
-// 20.28 <duration value expression>
-
-// The implemenation should enforce that the data type is a duration value.
-durationValueExpression
-    : valueExpression
-    ;
-
-datetimeSubtraction
-    : DURATION_BETWEEN LEFT_PAREN datetimeSubtractionParameters RIGHT_PAREN temporalDurationQualifier?
-    ;
-
-datetimeSubtractionParameters
-    : datetimeValueExpression1 COMMA datetimeValueExpression2
-    ;
-
-datetimeValueExpression1
-    : datetimeValueExpression
-    ;
-
-datetimeValueExpression2
-    : datetimeValueExpression
-    ;
-
-// 20.29 <duration value function>
-
-durationValueFunction
-    : durationFunction
-    | absoluteValueExpression
-    ;
-
-durationFunction
-    : DURATION LEFT_PAREN durationFunctionParameters RIGHT_PAREN
-    ;
-
-durationFunctionParameters
-    : durationString
-    | recordConstructor
-    ;
-
-// 21.1 Names and Variables
-
-objectName
-    : identifier
-    ;
-
-objectNameOrBindingVariable
-    : regularIdentifier
-    ;
-
-directoryName
-    : identifier
-    ;
-
-schemaName
-    : identifier
-    ;
-
-graphName
-    : regularIdentifier
-    | delimitedGraphName
-    ;
-
-delimitedGraphName
-    // DELIMITED_IDENTIFIER
-    : DOUBLE_QUOTED_CHARACTER_SEQUENCE
-    | ACCENT_QUOTED_CHARACTER_SEQUENCE
-    ;
-
-graphTypeName
-    : identifier
-    ;
-
-nodeTypeName
-    : identifier
-    ;
-
-edgeTypeName
-    : identifier
-    ;
-
-bindingTableName
-    : regularIdentifier
-    | delimitedBindingTableName
-    ;
-
-delimitedBindingTableName
-     // DELIMITED_IDENTIFIER
-     : DOUBLE_QUOTED_CHARACTER_SEQUENCE
-     | ACCENT_QUOTED_CHARACTER_SEQUENCE
-     ;
-
-procedureName
-    : identifier
-    ;
-
-labelName
-    : identifier
-    ;
-
-propertyName
-    : identifier
-    ;
-
-fieldName
-    : identifier
-    ;
-
-elementVariable
-    : bindingVariable
-    ;
-
-pathVariable
-    : bindingVariable
-    ;
-
-subpathVariable
-    : regularIdentifier
-    ;
-
-bindingVariable
-    : regularIdentifier
-    ;
-
-// 21.2 <literal>
-
-unsignedLiteral
-    : unsignedNumericLiteral
-    | generalLiteral
-    ;
-
-generalLiteral
-    : BOOLEAN_LITERAL
-    | characterStringLiteral
-    | BYTE_STRING_LITERAL
-    | temporalLiteral
-    | durationLiteral
-    | nullLiteral
-    | listLiteral
-    | recordLiteral
-    ;
-
-temporalLiteral
-    : dateLiteral
-    | timeLiteral
-    | datetimeLiteral
-//    | sqlDatetimeLiteral
-    ;
-
-dateLiteral
-    : DATE dateString
-    ;
-
-timeLiteral
-    : TIME timeString
-    ;
-
-datetimeLiteral
-    : (DATETIME | TIMESTAMP) datetimeString
-    ;
-
-listLiteral
-    : listValueConstructorByEnumeration
-    ;
-
-recordLiteral
-    : recordConstructor
-    ;
-
-identifier
-    : regularIdentifier
-    // DELIMITED_IDENTIFIER
-    | DOUBLE_QUOTED_CHARACTER_SEQUENCE
-    | ACCENT_QUOTED_CHARACTER_SEQUENCE
-    ;
-
-regularIdentifier
-    : REGULAR_IDENTIFIER
-    | nonReservedWords
-    ;
-
-timeZoneString
-    : characterStringLiteral
-    ;
-
-characterStringLiteral
-    : SINGLE_QUOTED_CHARACTER_SEQUENCE
-    | DOUBLE_QUOTED_CHARACTER_SEQUENCE
-    ;
-
-unsignedNumericLiteral
-    : exactNumericLiteral
-    | approximateNumericLiteral
-    ;
-
-exactNumericLiteral
-    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-    | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-    | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
-    | UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
-    | unsignedInteger
-    ;
-
-approximateNumericLiteral
-    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-    | UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
-    | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-    | UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
-    ;
-
-unsignedInteger
-    : UNSIGNED_DECIMAL_INTEGER
-    | UNSIGNED_HEXADECIMAL_INTEGER
-    | UNSIGNED_OCTAL_INTEGER
-    | UNSIGNED_BINARY_INTEGER
-    ;
-
-unsignedDecimalInteger
-    : UNSIGNED_DECIMAL_INTEGER
-    ;
-
-nullLiteral
-    : NULL
-    ;
-
-dateString
-    : characterStringLiteral
-    ;
-
-timeString
-    : characterStringLiteral
-    ;
-
-datetimeString
-    : characterStringLiteral
-    ;
-
-durationLiteral
-    : DURATION durationString
-//    | sqlIntervalLiteral
-    ;
-
-durationString
-    : characterStringLiteral
-    ;
-
-nodeSynonym
-    : NODE
-    | VERTEX
-    ;
-
-edgesSynonym
-    : EDGES
-    | RELATIONSHIPS
-    ;
-
-edgeSynonym
-    : EDGE
-    | RELATIONSHIP
-    ;
-
-// 21.1 Names and Variables
-
-IMPLIES
-    : RIGHT_DOUBLE_ARROW
-    | 'IMPLIES'
-    ;
-
-fragment PARAMETER_NAME
-    : SEPARATED_IDENTIFIER
-    ;
-
-// 21.2 <literal>
-
-nonReservedWords
-    : ACYCLIC
-    | BINDING
-    | BINDINGS
-    | CONNECTING
-    | DESTINATION
-    | DIFFERENT
-    | DIRECTED
-    | EDGE
-    | EDGES
-    | ELEMENT
-    | ELEMENTS
-    | FIRST
-    | GRAPH
-    | GROUPS
-    | KEEP
-    | LABEL
-    | LABELED
-    | LABELS
-    | LAST
-    | NFC
-    | NFD
-    | NFKC
-    | NFKD
-    | NO
-    | NODE
-    | NORMALIZED
-    | ONLY
-    | ORDINALITY
-    | PROPERTY
-    | READ
-    | RELATIONSHIP
-    | RELATIONSHIPS
-    | REPEATABLE
-    | SHORTEST
-    | SIMPLE
-    | SOURCE
-    | TABLE
-    | TEMP
-    | TO
-    | TRAIL
-    | TRANSACTION
-    | TYPE
-    | UNDIRECTED
-    | VERTEX
-    | WALK
-    | WITHOUT
-    | WRITE
-    | ZONE
-    ;
-
-BOOLEAN_LITERAL
-    : 'TRUE'
-    | 'FALSE'
-    | 'UNKNOWN'
-    ;
-
-SINGLE_QUOTED_CHARACTER_SEQUENCE
-    : NO_ESCAPE? UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
-    ;
-
-DOUBLE_QUOTED_CHARACTER_SEQUENCE
-    : NO_ESCAPE? UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
-    ;
-
-ACCENT_QUOTED_CHARACTER_SEQUENCE
-    :NO_ESCAPE? UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
-    ;
-
-NO_ESCAPE
-    : COMMERCIAL_AT
-    ;
-
-fragment UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
-    : QUOTE SINGLE_QUOTED_CHARACTER_REPRESENTATION* QUOTE
-    ;
-
-fragment UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
-    : DOUBLE_QUOTE DOUBLE_QUOTED_CHARACTER_REPRESENTATION* DOUBLE_QUOTE
-    ;
-
-fragment UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
-    : GRAVE_ACCENT ACCENT_QUOTED_CHARACTER_REPRESENTATION* GRAVE_ACCENT
-    ;
-
-fragment SINGLE_QUOTED_CHARACTER_REPRESENTATION:
-       (ESCAPED_CHARACTER | ~['\\\r\n])+
-       ;
-
-fragment DOUBLE_QUOTED_CHARACTER_REPRESENTATION:
-       (ESCAPED_CHARACTER | ~["\\\r\n])+
-       ;
-
-fragment ACCENT_QUOTED_CHARACTER_REPRESENTATION:
-       (ESCAPED_CHARACTER | ~[`\\\r\n])+
-       ;
-
-fragment ESCAPED_CHARACTER
-    : ESCAPED_REVERSE_SOLIDUS
-       | ESCAPED_QUOTE
-       | ESCAPED_DOUBLE_QUOTE
-       | ESCAPED_GRAVE_ACCENT
-       | ESCAPED_TAB
-       | ESCAPED_BACKSPACE
-       | ESCAPED_NEW_LINE
-       | ESCAPED_CARRIAGE_RETURN
-       | ESCAPED_FORM_FEED
-       | ESCAPED_UNICODE4_DIGIT_VALUE
-       | ESCAPED_UNICODE6_DIGIT_VALUE
-       ;
-
-fragment ESCAPED_REVERSE_SOLIDUS: REVERSE_SOLIDUS REVERSE_SOLIDUS;
-fragment ESCAPED_QUOTE: REVERSE_SOLIDUS QUOTE;
-fragment ESCAPED_DOUBLE_QUOTE: REVERSE_SOLIDUS DOUBLE_QUOTE;
-fragment ESCAPED_GRAVE_ACCENT: REVERSE_SOLIDUS GRAVE_ACCENT;
-fragment ESCAPED_TAB: REVERSE_SOLIDUS 't';
-fragment ESCAPED_BACKSPACE: REVERSE_SOLIDUS 'b';
-fragment ESCAPED_NEW_LINE: REVERSE_SOLIDUS 'n';
-fragment ESCAPED_CARRIAGE_RETURN: REVERSE_SOLIDUS 'r';
-fragment ESCAPED_FORM_FEED: REVERSE_SOLIDUS 'f';
-fragment ESCAPED_UNICODE4_DIGIT_VALUE:
-       REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-fragment ESCAPED_UNICODE6_DIGIT_VALUE:
-       REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-
-// Todo: Finish this. It is tricky how it interacts with <separator>
-BYTE_STRING_LITERAL
-    : 'X' QUOTE SPACE* (HEX_DIGIT SPACE* HEX_DIGIT SPACE*)* QUOTE
-    ;
-
-UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION EXACT_NUMBER_SUFFIX
-    ;
-
-UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
-    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
-    ;
-
-UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION APPROXIMATE_NUMBER_SUFFIX
-    ;
-
-UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION EXACT_NUMBER_SUFFIX
-    ;
-
-UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
-    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
-    ;
-
-UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION APPROXIMATE_NUMBER_SUFFIX
-    ;
-
-UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
-    : UNSIGNED_DECIMAL_INTEGER EXACT_NUMBER_SUFFIX
-    ;
-
-UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
-    : UNSIGNED_DECIMAL_INTEGER APPROXIMATE_NUMBER_SUFFIX
-    ;
-
-UNSIGNED_DECIMAL_INTEGER
-    : DIGIT (UNDERSCORE? DIGIT)*
-    ;
-
-fragment EXACT_NUMBER_SUFFIX
-    : 'M'
-    ;
-
-fragment UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
-    : MANTISSA 'E' EXPONENT
-    ;
-
-fragment MANTISSA
-    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
-    | UNSIGNED_DECIMAL_INTEGER
-    ;
-
-fragment EXPONENT
-    : SIGNED_DECIMAL_INTEGER
-    ;
-
-fragment UNSIGNED_DECIMAL_IN_COMMON_NOTATION
-    : UNSIGNED_DECIMAL_INTEGER (PERIOD UNSIGNED_DECIMAL_INTEGER?)
-    | PERIOD UNSIGNED_DECIMAL_INTEGER
-    ;
-
-fragment SIGNED_DECIMAL_INTEGER
-    : (PLUS_SIGN | MINUS_SIGN)? UNSIGNED_DECIMAL_INTEGER
-    ;
-
-UNSIGNED_HEXADECIMAL_INTEGER
-    : '0x' ('_'? HEX_DIGIT)+
-    ;
-
-UNSIGNED_OCTAL_INTEGER
-    : '0o' ('_'? OCTAL_DIGIT)+
-    ;
-
-UNSIGNED_BINARY_INTEGER
-    : '0b' ('_'? BINARY_DIGIT)+
-    ;
-
-fragment APPROXIMATE_NUMBER_SUFFIX
-    : 'F'
-    | 'D'
-    ;
-
-// 21.3 <token>, <separator>, and <identifier>
-
-// Reserved words
-ABS: 'ABS';
-ACOS: 'ACOS';
-ALL: 'ALL';
-ALL_DIFFERENT: 'ALL_DIFFERENT';
-AND: 'AND';
-ANY: 'ANY';
-ARRAY: 'ARRAY';
-AS: 'AS';
-ASC: 'ASC';
-ASCENDING: 'ASCENDING';
-ASIN: 'ASIN';
-AT: 'AT';
-ATAN: 'ATAN';
-AVG: 'AVG';
-BIG: 'BIG';
-BIGINT: 'BIGINT';
-BINARY: 'BINARY';
-BOOL: 'BOOL';
-BOOLEAN: 'BOOLEAN';
-BOTH: 'BOTH';
-BTRIM: 'BTRIM';
-BY: 'BY';
-BYTE_LENGTH: 'BYTE_LENGTH';
-BYTES: 'BYTES';
-CALL: 'CALL';
-CARDINALITY: 'CARDINALITY';
-CASE: 'CASE';
-CAST: 'CAST';
-CEIL: 'CEIL';
-CEILING: 'CEILING';
-CHAR: 'CHAR';
-CHAR_LENGTH: 'CHAR_LENGTH';
-CHARACTER_LENGTH: 'CHARACTER_LENGTH';
-CHARACTERISTICS: 'CHARACTERISTICS';
-CLOSE: 'CLOSE';
-COALESCE: 'COALESCE';
-COLLECT_LIST: 'COLLECT_LIST';
-COMMIT: 'COMMIT';
-COPY: 'COPY';
-COS: 'COS';
-COSH: 'COSH';
-COT: 'COT';
-COUNT: 'COUNT';
-CREATE: 'CREATE';
-CURRENT_DATE: 'CURRENT_DATE';
-CURRENT_GRAPH: 'CURRENT_GRAPH';
-CURRENT_PROPERTY_GRAPH: 'CURRENT_PROPERTY_GRAPH';
-CURRENT_SCHEMA: 'CURRENT_SCHEMA';
-CURRENT_TIME: 'CURRENT_TIME';
-CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
-DATE: 'DATE';
-DATETIME: 'DATETIME';
-DAY: 'DAY';
-DEC: 'DEC';
-DECIMAL: 'DECIMAL';
-DEGREES: 'DEGREES';
-DELETE: 'DELETE';
-DESC: 'DESC';
-DESCENDING: 'DESCENDING';
-DETACH: 'DETACH';
-DISTINCT: 'DISTINCT';
-DOUBLE: 'DOUBLE';
-DROP: 'DROP';
-DURATION: 'DURATION';
-DURATION_BETWEEN: 'DURATION_BETWEEN';
-ELEMENT_ID: 'ELEMENT_ID';
-ELSE: 'ELSE';
-END: 'END';
-EXCEPT: 'EXCEPT';
-EXISTS: 'EXISTS';
-EXP: 'EXP';
-FILTER: 'FILTER';
-FINISH: 'FINISH';
-FLOAT: 'FLOAT';
-FLOAT16: 'FLOAT16';
-FLOAT32: 'FLOAT32';
-FLOAT64: 'FLOAT64';
-FLOAT128: 'FLOAT128';
-FLOAT256: 'FLOAT256';
-FLOOR: 'FLOOR';
-FOR: 'FOR';
-FROM: 'FROM';
-GROUP: 'GROUP';
-HAVING: 'HAVING';
-HOME_GRAPH: 'HOME_GRAPH';
-HOME_PROPERTY_GRAPH: 'HOME_PROPERTY_GRAPH';
-HOME_SCHEMA: 'HOME_SCHEMA';
-HOUR: 'HOUR';
-IF: 'IF';
-IN: 'IN';
-INSERT: 'INSERT';
-INT: 'INT';
-INTEGER: 'INTEGER';
-INT8: 'INT8';
-INTEGER8: 'INTEGER8';
-INT16: 'INT16';
-INTEGER16: 'INTEGER16';
-INT32: 'INT32';
-INTEGER32: 'INTEGER32';
-INT64: 'INT64';
-INTEGER64: 'INTEGER64';
-INT128: 'INT128';
-INTEGER128: 'INTEGER128';
-INT256: 'INT256';
-INTEGER256: 'INTEGER256';
-INTERSECT: 'INTERSECT';
-INTERVAL: 'INTERVAL';
-IS: 'IS';
-LEADING: 'LEADING';
-LEFT: 'LEFT';
-LET: 'LET';
-LIKE: 'LIKE';
-LIMIT: 'LIMIT';
-LIST: 'LIST';
-LN: 'LN';
-LOCAL: 'LOCAL';
-LOCAL_DATETIME: 'LOCAL_DATETIME';
-LOCAL_TIME: 'LOCAL_TIME';
-LOCAL_TIMESTAMP: 'LOCAL_TIMESTAMP';
-LOG: 'LOG';
-LOG10: 'LOG10';
-LOWER: 'LOWER';
-LTRIM: 'LTRIM';
-MATCH: 'MATCH';
-MAX: 'MAX';
-MIN: 'MIN';
-MINUTE: 'MINUTE';
-MOD: 'MOD';
-MONTH: 'MONTH';
-NEXT: 'NEXT';
-NODETACH: 'NODETACH';
-NORMALIZE: 'NORMALIZE';
-NOT: 'NOT';
-NOTHING: 'NOTHING';
-NULL: 'NULL';
-NULLS: 'NULLS';
-NULLIF: 'NULLIF';
-OCTET_LENGTH: 'OCTET_LENGTH';
-OF: 'OF';
-OFFSET: 'OFFSET';
-OPTIONAL: 'OPTIONAL';
-OR: 'OR';
-ORDER: 'ORDER';
-OTHERWISE: 'OTHERWISE';
-PARAMETER: 'PARAMETER';
-PARAMETERS: 'PARAMETERS';
-PATH: 'PATH';
-PATH_LENGTH: 'PATH_LENGTH';
-PATHS: 'PATHS';
-PERCENTILE_CONT: 'PERCENTILE_CONT';
-PERCENTILE_DISC: 'PERCENTILE_DISC';
-POWER: 'POWER';
-PRECISION: 'PRECISION';
-PROPERTY_EXISTS: 'PROPERTY_EXISTS';
-RADIANS: 'RADIANS';
-REAL: 'REAL';
-RECORD: 'RECORD';
-REMOVE: 'REMOVE';
-REPLACE: 'REPLACE';
-RESET: 'RESET';
-RETURN: 'RETURN';
-RIGHT: 'RIGHT';
-ROLLBACK: 'ROLLBACK';
-RTRIM: 'RTRIM';
-SAME: 'SAME';
-SCHEMA: 'SCHEMA';
-SECOND: 'SECOND';
-SELECT: 'SELECT';
-SESSION: 'SESSION';
-SESSION_USER: 'SESSION_USER';
-SET: 'SET';
-SIGNED: 'SIGNED';
-SIN: 'SIN';
-SINH: 'SINH';
-SIZE: 'SIZE';
-SKIP_RESERVED_WORD: 'SKIP';
-SMALL: 'SMALL';
-SMALLINT: 'SMALLINT';
-SQRT: 'SQRT';
-START: 'START';
-STDDEV_POP: 'STDDEV_POP';
-STDDEV_SAMP: 'STDDEV_SAMP';
-STRING: 'STRING';
-SUM: 'SUM';
-TAN: 'TAN';
-TANH: 'TANH';
-THEN: 'THEN';
-TIME: 'TIME';
-TIMESTAMP: 'TIMESTAMP';
-TRAILING: 'TRAILING';
-TRIM: 'TRIM';
-TYPED: 'TYPED';
-UBIGINT: 'UBIGINT';
-UINT: 'UINT';
-UINT8: 'UINT8';
-UINT16: 'UINT16';
-UINT32: 'UINT32';
-UINT64: 'UINT64';
-UINT128: 'UINT128';
-UINT256: 'UINT256';
-UNION: 'UNION';
-UNSIGNED: 'UNSIGNED';
-UPPER: 'UPPER';
-USE: 'USE';
-USMALLINT: 'USMALLINT';
-VALUE: 'VALUE';
-VARBINARY: 'VARBINARY';
-VARCHAR: 'VARCHAR';
-VARIABLE: 'VARIABLE';
-WHEN: 'WHEN';
-WHERE: 'WHERE';
-WITH: 'WITH';
-XOR: 'XOR';
-YEAR: 'YEAR';
-YIELD: 'YIELD';
-ZONED: 'ZONED';
-ZONED_DATETIME: 'ZONED_DATETIME';
-ZONED_TIME: 'ZONED_TIME';
-
-// Prereserved words
-ABSTRACT: 'ABSTRACT';
-AGGREGATE: 'AGGREGATE';
-AGGREGATES: 'AGGREGATES';
-ALTER: 'ALTER';
-CATALOG: 'CATALOG';
-CLEAR: 'CLEAR';
-CLONE: 'CLONE';
-CONSTRAINT: 'CONSTRAINT';
-CURRENT_ROLE: 'CURRENT_ROLE';
-CURRENT_USER: 'CURRENT_USER';
-DATA: 'DATA';
-DIRECTORY: 'DIRECTORY';
-DRYRUN: 'DRYRUN';
-EXACT: 'EXACT';
-EXISTING: 'EXISTING';
-FUNCTION: 'FUNCTION';
-GQLSTATUS: 'GQLSTATUS';
-GRANT: 'GRANT';
-INSTANT: 'INSTANT';
-INFINITY: 'INFINITY';
-NUMBER: 'NUMBER';
-NUMERIC: 'NUMERIC';
-ON: 'ON';
-OPEN: 'OPEN';
-PARTITION: 'PARTITION';
-PROCEDURE: 'PROCEDURE';
-PRODUCT: 'PRODUCT';
-PROJECT: 'PROJECT';
-QUERY: 'QUERY';
-RECORDS: 'RECORDS';
-REFERENCE: 'REFERENCE';
-RENAME: 'RENAME';
-REVOKE: 'REVOKE';
-SUBSTRING: 'SUBSTRING';
-SYSTEM_USER: 'SYSTEM_USER';
-TEMPORAL: 'TEMPORAL';
-UNIQUE: 'UNIQUE';
-UNIT: 'UNIT';
-VALUES: 'VALUES';
-
-// Nonreserved words
-ACYCLIC: 'ACYCLIC';
-BINDING: 'BINDING';
-BINDINGS: 'BINDINGS';
-CONNECTING: 'CONNECTING';
-DESTINATION: 'DESTINATION';
-DIFFERENT: 'DIFFERENT';
-DIRECTED: 'DIRECTED';
-EDGE: 'EDGE';
-EDGES: 'EDGES';
-ELEMENT: 'ELEMENT';
-ELEMENTS: 'ELEMENTS';
-FIRST: 'FIRST';
-GRAPH: 'GRAPH';
-GROUPS: 'GROUPS';
-KEEP: 'KEEP';
-LABEL: 'LABEL';
-LABELED: 'LABELED';
-LABELS: 'LABELS';
-LAST: 'LAST';
-NFC: 'NFC';
-NFD: 'NFD';
-NFKC: 'NFKC';
-NFKD: 'NFKD';
-NO: 'NO';
-NODE: 'NODE';
-NORMALIZED: 'NORMALIZED';
-ONLY: 'ONLY';
-ORDINALITY: 'ORDINALITY';
-PROPERTY: 'PROPERTY';
-READ: 'READ';
-RELATIONSHIP: 'RELATIONSHIP';
-RELATIONSHIPS: 'RELATIONSHIPS';
-REPEATABLE: 'REPEATABLE';
-SHORTEST: 'SHORTEST';
-SIMPLE: 'SIMPLE';
-SOURCE: 'SOURCE';
-TABLE: 'TABLE';
-TEMP: 'TEMP';
-TO: 'TO';
-TRAIL: 'TRAIL';
-TRANSACTION: 'TRANSACTION';
-TYPE: 'TYPE';
-UNDIRECTED: 'UNDIRECTED';
-VERTEX: 'VERTEX';
-WALK: 'WALK';
-WITHOUT: 'WITHOUT';
-WRITE: 'WRITE';
-ZONE: 'ZONE';
-
-fragment SEPARATED_IDENTIFIER
-    : DELIMITED_IDENTIFIER
-    | EXTENDED_IDENTIFIER
-    ;
-
-REGULAR_IDENTIFIER
-    : IDENTIFIER_START IDENTIFIER_EXTEND*
-    ;
-
-fragment EXTENDED_IDENTIFIER
-    : IDENTIFIER_EXTEND+
-    ;
-
-fragment DELIMITED_IDENTIFIER
-    : DOUBLE_QUOTED_CHARACTER_SEQUENCE
-    | ACCENT_QUOTED_CHARACTER_SEQUENCE
-    ;
-
-SUBSTITUTED_PARAMETER_REFERENCE
-    : DOUBLE_DOLLAR_SIGN PARAMETER_NAME
-    ;
-
-GENERAL_PARAMETER_REFERENCE
-    : DOLLAR_SIGN PARAMETER_NAME
-    ;
-
-fragment IDENTIFIER_START
-    : ID_Start
-    | Pc
-    ;
-
-fragment IDENTIFIER_EXTEND
-    : ID_Continue
-    ;
-
-fragment ID_Start
-    : [\p{ID_Start}]
-    ;
-
-fragment ID_Continue
-    : [\p{ID_Continue}]
-    ;
-
-MULTISET_ALTERNATION_OPERATOR: '|+|';
-
-BRACKET_RIGHT_ARROW: ']->';
-BRACKET_TILDE_RIGHT_ARROW: ']~>';
-CONCATENATION_OPERATOR: '||';
-DOUBLE_COLON: '::';
-DOUBLE_DOLLAR_SIGN: '$$';
-DOUBLE_PERIOD: '..';
-GREATER_THAN_OR_EQUALS_OPERATOR: '>=';
-LEFT_ARROW: '<-';
-LEFT_ARROW_TILDE: '<~';
-LEFT_ARROW_BRACKET: '<-[';
-LEFT_ARROW_TILDE_BRACKET: '<~[';
-LEFT_MINUS_RIGHT: '<->';
-LEFT_MINUS_SLASH: '<-/';
-LEFT_TILDE_SLASH: '<~/';
-LESS_THAN_OR_EQUALS_OPERATOR: '<=';
-MINUS_LEFT_BRACKET: '-[';
-MINUS_SLASH: '-/';
-NOT_EQUALS_OPERATOR: '<>';
-RIGHT_ARROW: '->';
-RIGHT_BRACKET_MINUS: ']-';
-RIGHT_BRACKET_TILDE: ']~';
-RIGHT_DOUBLE_ARROW: '=>';
-SLASH_MINUS: '/-';
-SLASH_MINUS_RIGHT: '/->';
-SLASH_TILDE: '/~';
-SLASH_TILDE_RIGHT: '/~>';
-TILDE_LEFT_BRACKET: '~[';
-TILDE_RIGHT_ARROW: '~>';
-TILDE_SLASH: '~/';
-
-// 21.4 GQL terminal characters
-
-AMPERSAND: '&';
-ASTERISK: '*';
-COLON: ':';
-COMMA: ',';
-COMMERCIAL_AT: '@';
-DOLLAR_SIGN: '$';
-DOUBLE_QUOTE: '"';
-EQUALS_OPERATOR: '=';
-EXCLAMATION_MARK: '!';
-RIGHT_ANGLE_BRACKET: '>';
-GRAVE_ACCENT: '`';
-LEFT_BRACE: '{';
-LEFT_BRACKET: '[';
-LEFT_PAREN: '(';
-LEFT_ANGLE_BRACKET: '<';
-MINUS_SIGN: '-';
-PERCENT: '%';
-PERIOD: '.';
-PLUS_SIGN: '+';
-QUESTION_MARK: '?';
-QUOTE: '\'';
-REVERSE_SOLIDUS: '\\';
-RIGHT_BRACE: '}';
-RIGHT_BRACKET: ']';
-RIGHT_PAREN: ')';
-SOLIDUS: '/';
-TILDE: '~';
-UNDERSCORE: '_';
-VERTICAL_BAR: '|';
-
-fragment HEX_DIGIT
-    : [0-9a-f]
-    ;
-
-fragment DIGIT
-    : [0-9]
-    ;
-
-fragment OCTAL_DIGIT
-    : [0-7]
-    ;
-
-fragment BINARY_DIGIT
-    : [0-1]
-    ;
-
-SP
-  : (WHITESPACE)+
-  -> channel(HIDDEN)
-  ;
-
-WHITESPACE
-    : SPACE
-    | TAB
-    | LF
-    | VT
-    | FF
-    | CR
-    | FS
-    | GS
-    | RS
-    | US
-    | '\u1680'
-    | '\u180e'
-    | '\u2000'
-    | '\u2001'
-    | '\u2002'
-    | '\u2003'
-    | '\u2004'
-    | '\u2005'
-    | '\u2006'
-    | '\u2008'
-    | '\u2009'
-    | '\u200a'
-    | '\u2028'
-    | '\u2029'
-    | '\u205f'
-    | '\u3000'
-    | '\u00a0'
-    | '\u2007'
-    | '\u202f'
-    ;
-
-BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
-
-SIMPLE_COMMENT_SOLIDUS: '//' ~[\r\n]* -> channel(HIDDEN);
-
-SIMPLE_COMMENT_MINUS: '--' ~[\r\n]* -> channel(HIDDEN);
-
-fragment GS : [\u001D];
-
-fragment FS : [\u001C];
-
-fragment CR : [\r];
-
-fragment Sc : [\p{Sc}];
-
-fragment SPACE : [ ];
-
-fragment Pc : [\p{Pc}];
-
-fragment TAB : [\t];
-
-fragment LF : [\n];
-
-fragment VT : [\u000B];
-
-fragment US : [\u001F];
-
-fragment FF: [\f];
-
-fragment RS: [\u001E];
diff --git a/developer/ANTLR/GQL_20240412_rf1_literals.g4 b/developer/ANTLR/GQL_20240412_rf1_literals.g4
deleted file mode 100644 (file)
index e9ac41e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// Define tokens for each category
-
-// Data Types
-DATA_TYPE: BOOL | BOOLEAN | BYTE_STRING_LITERAL | CHAR | DATETIME | DECIMAL | FLOAT | 
-            INTEGER | INT | REAL | SMALLINT | STRING | TIME | TIMESTAMP | UBIGINT | 
-            UNSIGNED_BINARY_INTEGER | UNSIGNED_DECIMAL_INTEGER | UNSIGNED_HEXADECIMAL_INTEGER | 
-            UNSIGNED_OCTAL_INTEGER | VARBINARY | VARCHAR | INT8 | INT16 | INT32 | INT64 | 
-            INT128 | INT256 | BIGINT | UINT8 | UINT16 | UINT32 | UINT64 | UINT128 | UINT256 |
-            BYTE_LENGTH | BYTES | CARDINALITY | DATE | DAY | DEC | DOUBLE | DURATION | 
-            DURATION_BETWEEN | ELEMENT | ELEMENT_ID | FLOAT | INSTANT | INTERVAL | MAX | MIN | 
-            MINUTE | MODULUS | MONTH | NUMERIC | SIZE | TEMP | TEMPORAL | TIME | UINT | 
-            VALUE | VALUES | YEAR | ZONED | ZONED_DATETIME | ZONED_TIME | USMALLINT ;
-
-// Functions
-FUNCTION: ABS | ACOS | ASIN | ATAN | AVG | CEIL | CEILING | COS | COSH | EXP | FLOOR | 
-          LOG | LOG10 | MOD | POWER | RADIANS | SIN | SINH | SQRT | TAN | TANH | TRIM | 
-          LTRIM | RTRIM | BTRIM | CONCATENATION_OPERATOR | CHARACTER_LENGTH | OCTET_LENGTH | 
-          POSITION | SUBSTRING | UPPER | LOWER | AGGREGATE | AGGREGATES | ALL_DIFFERENT | 
-          CAST | COT | COUNT | STDDEV_POP | STDDEV_SAMP | SUM ;
-
-// Punctuation and Operators
-PUNCTUATION_OPERATOR: AMPERSAND | ASTERISK | COLON | COMMA | CONCATENATION_OPERATOR | 
-                      DOLLAR_SIGN | DOUBLE_COLON | DOUBLE_PERIOD | DOUBLE_QUOTE | 
-                      DOUBLE_DOLLAR_SIGN | EQUALS_OPERATOR | EXCLAMATION_MARK | 
-                      GREATER_THAN_OR_EQUALS_OPERATOR | LEFT_ANGLE_BRACKET | LEFT_ARROW | 
-                      LEFT_BRACE | LEFT_BRACKET | LEFT_MINUS_RIGHT | LEFT_MINUS_SLASH | 
-                      LEFT_PAREN | LEFT_TILDE_SLASH | LESS_THAN_OR_EQUALS_OPERATOR | 
-                      MINUS_LEFT_BRACKET | MINUS_SIGN | PERIOD | PLUS_SIGN | RIGHT_ANGLE_BRACKET | 
-                      RIGHT_ARROW | RIGHT_BRACE | RIGHT_BRACKET | RIGHT_BRACKET_MINUS | 
-                      RIGHT_BRACKET_TILDE | RIGHT_DOUBLE_ARROW | RIGHT_PAREN | SOLIDUS | 
-                      TILDE | TILDE_LEFT_BRACKET | TILDE_RIGHT_ARROW | TILDE_SLASH | VERTICAL_BAR |
-                      BRACKETED_COMMENT | BRACKET_RIGHT_ARROW | BRACKET_TILDE_RIGHT_ARROW | 
-                      COMMERCIAL_AT | DOUBLE_QUOTED_CHARACTER_SEQUENCE | SINGLE_QUOTED_CHARACTER_SEQUENCE | 
-                      SLASH_MINUS | SLASH_MINUS_RIGHT | SLASH_TILDE | SLASH_TILDE_RIGHT | 
-                      REVERSE_SOLIDUS | UNDERSCORE ;
-
-// Keywords
-KEYWORD: ALL | AND | ANY | ARRAY | AS | ASC | DESC | DISTINCT | EXISTS | FALSE | FROM | 
-         GROUP | HAVING | IN | IS | LIKE | MATCH | NOT | NULL | ON | OR | ORDER | 
-         RETURN | SELECT | TRUE | UNION | USING | WHERE | WITH | ABSTRACT | ALTER | 
-         ASCENDING | AT | BIG | BINARY | BINDING | BINDINGS | BOTH | CALL | CATALOG | 
-         CLEAR | CLONE | CLOSE | COMMIT | CONSTRAINT | CREATE | CURRENT_PROPERTY_GRAPH | 
-         CURRENT_SCHEMA | DELETE | DESCENDING | DETACH | DIFFERENT | DIRECTED | DIRECTORY | 
-         DROP | DRYRUN | ELEMENTS | EXCEPT | EXISTING | FILTER | FINISH | FIRST | FUNCTION | 
-         GENERAL_PARAMETER_REFERENCE | GRANT | GROUPS | HOME_GRAPH | HOME_PROPERTY_GRAPH | 
-         HOME_SCHEMA | INSERT | INTERSECT | KEEP | LABELED | LAST | LEADING | LEFT | 
-         LEFT_ARROW_BRACKET | LEFT_ARROW_TILDE | LIST | NOTHING | NULLIF | OF | ONLY | 
-         OPEN | OPTIONAL | ORDINALITY | OTHERWISE | PARENT | PARENTHESIZED | PATH | 
-         PATHS | PRECISION | PRIMARY | PRIORITY | PROCEDURE | PRODUCT | PROPERTIES | 
-         PROPERTY | PROPERTY_EXISTS | QUANTIFIER | REFERENCE | REFERENCES | REFLECT | 
-         REGULAR | REMOVE | RENAME | REPEATABLE | REPLACE | RESET | REVOKE | RIGHT | 
-         ROLLBACK | SAME | SCHEMA | SESSION | SET | SHORTEST | SIGNED | SIMPLE | 
-         SIMPLE_COMMENT_MINUS | SIMPLE_COMMENT_SOLIDUS | SOURCE | SP | START | 
-         SUBSTITUTED_PARAMETER_REFERENCE | TABLE | TO | TRAIL | TRAILING | TRANSACTION | 
-         TYPED | UNDIRECTED | UNIQUE | UNIT | UNSIGNED | USE | VERTEX | WALK | WHITESPACE | 
-         WITHOUT | WRITE | XOR | YIELD | ZONE ;
-
-// Literals
-LITERAL: NULL | TRUE | FALSE | NUMBER | BOOLEAN_LITERAL ;
-
-// Control Flow
-CONTROL_FLOW: CASE | WHEN | THEN | ELSE | END | IF | FOR | WHILE | DO | LOOP | 
-              BREAK | CONTINUE | RETURN | IMPLIES ;
-
-// Miscellaneous
-MISC: ACCENT_QUOTED_CHARACTER_SEQUENCE | ACYCLIC | GRAVE_ACCENT ;
diff --git a/developer/ANTLR/GQL_20240412_substituted.g4 b/developer/ANTLR/GQL_20240412_substituted.g4
deleted file mode 100644 (file)
index 25de3e2..0000000
+++ /dev/null
@@ -1,5783 +0,0 @@
-// Original: grammar GQL_20240412;
-CONTROL_FLOWgrammarCONTROL_FLOW CONTROL_FLOWGQL_20240412CONTROL_FLOW;
-
-// Original: options { caseInsensitive = true; }
-CONTROL_FLOWoptionsCONTROL_FLOW { CONTROL_FLOWcaseInsensitiveCONTROL_FLOW = CONTROL_FLOWtrueCONTROL_FLOW; }
-
-// 6 <GQL-program>
-
-// Original: gqlProgram
-CONTROL_FLOWgqlProgramCONTROL_FLOW
-// Original: : programActivity sessionCloseCommand? EOF
-: CONTROL_FLOWprogramActivityCONTROL_FLOW CONTROL_FLOWsessionCloseCommandCONTROL_FLOW? CONTROL_FLOWEOFCONTROL_FLOW
-// Original: | sessionCloseCommand EOF
-| CONTROL_FLOWsessionCloseCommandCONTROL_FLOW CONTROL_FLOWEOFCONTROL_FLOW
-;
-
-// Original: programActivity
-CONTROL_FLOWprogramActivityCONTROL_FLOW
-// Original: : sessionActivity
-: CONTROL_FLOWsessionActivityCONTROL_FLOW
-// Original: | transactionActivity
-| CONTROL_FLOWtransactionActivityCONTROL_FLOW
-;
-
-// Original: sessionActivity
-CONTROL_FLOWsessionActivityCONTROL_FLOW
-: sessionResetCommand+
-| sessionSetCommand+ sessionResetCommand*
-;
-
-// Original: transactionActivity
-CONTROL_FLOWtransactionActivityCONTROL_FLOW
-: startTransactionCommand (procedureSpecification endTransactionCommand?)?
-| procedureSpecification endTransactionCommand?
-// Original: | endTransactionCommand
-| CONTROL_FLOWendTransactionCommandCONTROL_FLOW
-;
-
-// Original: endTransactionCommand
-CONTROL_FLOWendTransactionCommandCONTROL_FLOW
-// Original: : rollbackCommand
-: CONTROL_FLOWrollbackCommandCONTROL_FLOW
-// Original: | commitCommand
-| CONTROL_FLOWcommitCommandCONTROL_FLOW
-;
-
-// 7.1 <session set command>
-
-// Original: sessionSetCommand
-CONTROL_FLOWsessionSetCommandCONTROL_FLOW
-// Original: : SESSION SET (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
-// Original: : SESSION KEYWORD (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
-: KEYWORD KEYWORD (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
-;
-
-// Original: sessionSetSchemaClause
-CONTROL_FLOWsessionSetSchemaClauseCONTROL_FLOW
-// Original: : SCHEMA schemaReference
-: CONTROL_FLOWSCHEMACONTROL_FLOW CONTROL_FLOWschemaReferenceCONTROL_FLOW
-;
-
-// Original: sessionSetGraphClause
-CONTROL_FLOWsessionSetGraphClauseCONTROL_FLOW
-// Original: : PROPERTY? GRAPH graphExpression
-: CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
-;
-
-// Original: sessionSetTimeZoneClause
-CONTROL_FLOWsessionSetTimeZoneClauseCONTROL_FLOW
-// Original: : TIME ZONE setTimeZoneValue
-: CONTROL_FLOWTIMECONTROL_FLOW CONTROL_FLOWZONECONTROL_FLOW CONTROL_FLOWsetTimeZoneValueCONTROL_FLOW
-;
-
-// Original: setTimeZoneValue
-CONTROL_FLOWsetTimeZoneValueCONTROL_FLOW
-// Original: : timeZoneString
-: CONTROL_FLOWtimeZoneStringCONTROL_FLOW
-;
-
-// Original: sessionSetParameterClause
-CONTROL_FLOWsessionSetParameterClauseCONTROL_FLOW
-// Original: : sessionSetGraphParameterClause
-: CONTROL_FLOWsessionSetGraphParameterClauseCONTROL_FLOW
-// Original: | sessionSetBindingTableParameterClause
-| CONTROL_FLOWsessionSetBindingTableParameterClauseCONTROL_FLOW
-// Original: | sessionSetValueParameterClause
-| CONTROL_FLOWsessionSetValueParameterClauseCONTROL_FLOW
-;
-
-// Original: sessionSetGraphParameterClause
-CONTROL_FLOWsessionSetGraphParameterClauseCONTROL_FLOW
-// Original: : PROPERTY? GRAPH sessionSetParameterName optTypedGraphInitializer
-: CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW CONTROL_FLOWoptTypedGraphInitializerCONTROL_FLOW
-;
-
-// Original: sessionSetBindingTableParameterClause
-CONTROL_FLOWsessionSetBindingTableParameterClauseCONTROL_FLOW
-// Original: : BINDING? TABLE sessionSetParameterName optTypedBindingTableInitializer
-// Original: : KEYWORD? TABLE sessionSetParameterName optTypedBindingTableInitializer
-: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW CONTROL_FLOWoptTypedBindingTableInitializerCONTROL_FLOW
-;
-
-// Original: sessionSetValueParameterClause
-CONTROL_FLOWsessionSetValueParameterClauseCONTROL_FLOW
-// Original: : VALUE sessionSetParameterName optTypedValueInitializer
-: CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW CONTROL_FLOWoptTypedValueInitializerCONTROL_FLOW
-;
-
-// Original: sessionSetParameterName
-CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW
-// Original: : (IF NOT EXISTS)? sessionParameterSpecification
-: (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWsessionParameterSpecificationCONTROL_FLOW
-;
-
-// 7.2 <session reset command>
-
-// Original: sessionResetCommand
-CONTROL_FLOWsessionResetCommandCONTROL_FLOW
-// Original: : SESSION RESET sessionResetArguments?
-// Original: : KEYWORD RESET sessionResetArguments?
-: KEYWORD KEYWORD sessionResetArguments?
-;
-
-// Original: sessionResetArguments
-CONTROL_FLOWsessionResetArgumentsCONTROL_FLOW
-// Original: : ALL? (PARAMETERS | CHARACTERISTICS)
-: KEYWORD? (PARAMETERS | CHARACTERISTICS)
-// Original: | SCHEMA
-| CONTROL_FLOWSCHEMACONTROL_FLOW
-// Original: | PROPERTY? GRAPH
-| CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW
-// Original: | TIME ZONE
-| CONTROL_FLOWTIMECONTROL_FLOW CONTROL_FLOWZONECONTROL_FLOW
-// Original: | PARAMETER? sessionParameterSpecification
-| CONTROL_FLOWPARAMETERCONTROL_FLOW? CONTROL_FLOWsessionParameterSpecificationCONTROL_FLOW
-;
-
-// 7.3 <session close command>
-
-// Original: sessionCloseCommand
-CONTROL_FLOWsessionCloseCommandCONTROL_FLOW
-// Original: : SESSION CLOSE
-// Original: : SESSION KEYWORD
-: CONTROL_FLOWSESSIONCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW
-;
-
-// 7.4 <session parameter specification>
-
-// Original: sessionParameterSpecification
-CONTROL_FLOWsessionParameterSpecificationCONTROL_FLOW
-// Original: : GENERAL_PARAMETER_REFERENCE
-: CONTROL_FLOWGENERAL_PARAMETER_REFERENCECONTROL_FLOW
-;
-
-// 8.1 <start transaction command>
-
-// Original: startTransactionCommand
-CONTROL_FLOWstartTransactionCommandCONTROL_FLOW
-// Original: : START TRANSACTION transactionCharacteristics?
-// Original: : KEYWORD TRANSACTION transactionCharacteristics?
-: KEYWORD KEYWORD transactionCharacteristics?
-;
-
-// 8.2 <transaction characteristics>
-
-// Original: transactionCharacteristics
-CONTROL_FLOWtransactionCharacteristicsCONTROL_FLOW
-// Original: : transactionMode (COMMA transactionMode)*
-: transactionMode (PUNCTUATION_OPERATOR transactionMode)*
-;
-
-// Original: transactionMode
-CONTROL_FLOWtransactionModeCONTROL_FLOW
-// Original: : transactionAccessMode
-: CONTROL_FLOWtransactionAccessModeCONTROL_FLOW
-;
-
-// Original: transactionAccessMode
-CONTROL_FLOWtransactionAccessModeCONTROL_FLOW
-// Original: : READ ONLY
-: CONTROL_FLOWREADCONTROL_FLOW CONTROL_FLOWONLYCONTROL_FLOW
-// Original: | READ WRITE
-| CONTROL_FLOWREADCONTROL_FLOW CONTROL_FLOWWRITECONTROL_FLOW
-;
-
-// 8.3 <rollback command>
-
-// Original: rollbackCommand
-CONTROL_FLOWrollbackCommandCONTROL_FLOW
-// Original: : ROLLBACK
-: CONTROL_FLOWROLLBACKCONTROL_FLOW
-;
-
-// 8.4 <commit command>
-
-// Original: commitCommand
-CONTROL_FLOWcommitCommandCONTROL_FLOW
-// Original: : COMMIT
-: CONTROL_FLOWCOMMITCONTROL_FLOW
-;
-
-// 9.1 <nested procedure specification>
-
-// Original: nestedProcedureSpecification
-CONTROL_FLOWnestedProcedureSpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE procedureSpecification RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWprocedureSpecificationCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: // <catalog-modifying procedure specification>, <data-modifying procedure specification> and <query specification> are
-// <CONTROL_FLOWcatalogCONTROL_FLOW-CONTROL_FLOWmodifyingCONTROL_FLOW CONTROL_FLOWprocedureCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW>, <CONTROL_FLOWdataCONTROL_FLOW-CONTROL_FLOWmodifyingCONTROL_FLOW CONTROL_FLOWprocedureCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW> CONTROL_FLOWandCONTROL_FLOW <CONTROL_FLOWqueryCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW> CONTROL_FLOWareCONTROL_FLOW
-// Original: // identical productions. The specification distinguishes them in the BNF, but in the implementation, the distinction
-// CONTROL_FLOWidenticalCONTROL_FLOW CONTROL_FLOWproductionsCONTROL_FLOW. CONTROL_FLOWTheCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW CONTROL_FLOWdistinguishesCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWBNFCONTROL_FLOW, CONTROL_FLOWbutCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWimplementationCONTROL_FLOW, CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWdistinctionCONTROL_FLOW
-// has to be made sematically, in code, based on the kind of statements contained in the <procedure specification>.
-// Original: procedureSpecification
-CONTROL_FLOWprocedureSpecificationCONTROL_FLOW
-// Original: : procedureBody
-: CONTROL_FLOWprocedureBodyCONTROL_FLOW
-// Original: //    : catalogModifyingProcedureSpecification
-//    : CONTROL_FLOWcatalogModifyingProcedureSpecificationCONTROL_FLOW
-// Original: //    | dataModifyingProcedureSpecification
-//    | CONTROL_FLOWdataModifyingProcedureSpecificationCONTROL_FLOW
-// Original: //    | querySpecification
-//    | CONTROL_FLOWquerySpecificationCONTROL_FLOW
-;
-
-// Original: //catalogModifyingProcedureSpecification
-//CONTROL_FLOWcatalogModifyingProcedureSpecificationCONTROL_FLOW
-// Original: //    : procedureBody
-//    : CONTROL_FLOWprocedureBodyCONTROL_FLOW
-//    ;
-
-// Original: nestedDataModifyingProcedureSpecification
-CONTROL_FLOWnestedDataModifyingProcedureSpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE procedureBody RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWprocedureBodyCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: //dataModifyingProcedureSpecification
-//CONTROL_FLOWdataModifyingProcedureSpecificationCONTROL_FLOW
-// Original: //    : procedureBody
-//    : CONTROL_FLOWprocedureBodyCONTROL_FLOW
-//    ;
-
-// Original: nestedQuerySpecification
-CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE procedureBody RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWprocedureBodyCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: //querySpecification
-//CONTROL_FLOWquerySpecificationCONTROL_FLOW
-// Original: //    : procedureBody
-//    : CONTROL_FLOWprocedureBodyCONTROL_FLOW
-//    ;
-
-// 9.2 <procedure body>
-
-// Original: procedureBody
-CONTROL_FLOWprocedureBodyCONTROL_FLOW
-// Original: : atSchemaClause? bindingVariableDefinitionBlock? statementBlock
-: CONTROL_FLOWatSchemaClauseCONTROL_FLOW? CONTROL_FLOWbindingVariableDefinitionBlockCONTROL_FLOW? CONTROL_FLOWstatementBlockCONTROL_FLOW
-;
-
-// Original: bindingVariableDefinitionBlock
-CONTROL_FLOWbindingVariableDefinitionBlockCONTROL_FLOW
-: bindingVariableDefinition+
-;
-
-// Original: bindingVariableDefinition
-CONTROL_FLOWbindingVariableDefinitionCONTROL_FLOW
-// Original: : graphVariableDefinition
-: CONTROL_FLOWgraphVariableDefinitionCONTROL_FLOW
-// Original: | bindingTableVariableDefinition
-| CONTROL_FLOWbindingTableVariableDefinitionCONTROL_FLOW
-// Original: | valueVariableDefinition
-| CONTROL_FLOWvalueVariableDefinitionCONTROL_FLOW
-;
-
-// Original: statementBlock
-CONTROL_FLOWstatementBlockCONTROL_FLOW
-: statement nextStatement*
-;
-
-// Original: statement
-CONTROL_FLOWstatementCONTROL_FLOW
-// Original: : linearCatalogModifyingStatement
-: CONTROL_FLOWlinearCatalogModifyingStatementCONTROL_FLOW
-// Original: | linearDataModifyingStatement
-| CONTROL_FLOWlinearDataModifyingStatementCONTROL_FLOW
-// Original: | compositeQueryStatement
-| CONTROL_FLOWcompositeQueryStatementCONTROL_FLOW
-;
-
-// Original: nextStatement
-CONTROL_FLOWnextStatementCONTROL_FLOW
-// Original: : NEXT yieldClause? statement
-: CONTROL_FLOWNEXTCONTROL_FLOW CONTROL_FLOWyieldClauseCONTROL_FLOW? CONTROL_FLOWstatementCONTROL_FLOW
-;
-
-// 10.1 <graph variable definition>
-
-// Original: graphVariableDefinition
-CONTROL_FLOWgraphVariableDefinitionCONTROL_FLOW
-// Original: : PROPERTY? GRAPH bindingVariable optTypedGraphInitializer
-: CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWoptTypedGraphInitializerCONTROL_FLOW
-;
-
-// Original: optTypedGraphInitializer
-CONTROL_FLOWoptTypedGraphInitializerCONTROL_FLOW
-// Original: : (typed? graphReferenceValueType)? graphInitializer
-: (CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWgraphReferenceValueTypeCONTROL_FLOW)? CONTROL_FLOWgraphInitializerCONTROL_FLOW
-;
-
-// Original: graphInitializer
-CONTROL_FLOWgraphInitializerCONTROL_FLOW
-// Original: : EQUALS_OPERATOR graphExpression
-: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
-;
-
-// 10.2 <binding table variable definition>
-
-// Original: bindingTableVariableDefinition
-CONTROL_FLOWbindingTableVariableDefinitionCONTROL_FLOW
-// Original: : BINDING? TABLE bindingVariable optTypedBindingTableInitializer
-// Original: : KEYWORD? TABLE bindingVariable optTypedBindingTableInitializer
-: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWoptTypedBindingTableInitializerCONTROL_FLOW
-;
-
-// Original: optTypedBindingTableInitializer
-CONTROL_FLOWoptTypedBindingTableInitializerCONTROL_FLOW
-// Original: : (typed? bindingTableReferenceValueType)? bindingTableInitializer
-: (CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWbindingTableReferenceValueTypeCONTROL_FLOW)? CONTROL_FLOWbindingTableInitializerCONTROL_FLOW
-;
-
-// Original: bindingTableInitializer
-CONTROL_FLOWbindingTableInitializerCONTROL_FLOW
-// Original: : EQUALS_OPERATOR bindingTableExpression
-: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWbindingTableExpressionCONTROL_FLOW
-;
-
-// 10.3 <value variable definition>
-
-// Original: valueVariableDefinition
-CONTROL_FLOWvalueVariableDefinitionCONTROL_FLOW
-// Original: : VALUE bindingVariable optTypedValueInitializer
-: CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWoptTypedValueInitializerCONTROL_FLOW
-;
-
-// Original: optTypedValueInitializer
-CONTROL_FLOWoptTypedValueInitializerCONTROL_FLOW
-// Original: : (typed? valueType)? valueInitializer
-: (CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWvalueTypeCONTROL_FLOW)? CONTROL_FLOWvalueInitializerCONTROL_FLOW
-;
-
-// Original: valueInitializer
-CONTROL_FLOWvalueInitializerCONTROL_FLOW
-// Original: : EQUALS_OPERATOR valueExpression
-: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 11.1 <graph expression>
-
-// Original: graphExpression
-CONTROL_FLOWgraphExpressionCONTROL_FLOW
-// Original: : objectExpressionPrimary
-: CONTROL_FLOWobjectExpressionPrimaryCONTROL_FLOW
-// Original: | graphReference
-| CONTROL_FLOWgraphReferenceCONTROL_FLOW
-// Original: | objectNameOrBindingVariable
-| CONTROL_FLOWobjectNameOrBindingVariableCONTROL_FLOW
-// Original: | currentGraph
-| CONTROL_FLOWcurrentGraphCONTROL_FLOW
-;
-
-// Original: currentGraph
-CONTROL_FLOWcurrentGraphCONTROL_FLOW
-// Original: : CURRENT_PROPERTY_GRAPH
-// Original: : KEYWORD
-: CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | CURRENT_GRAPH
-| CONTROL_FLOWCURRENT_GRAPHCONTROL_FLOW
-;
-
-// 11.2 <binding table expression>
-
-// Original: bindingTableExpression
-CONTROL_FLOWbindingTableExpressionCONTROL_FLOW
-// Original: : nestedBindingTableQuerySpecification
-: CONTROL_FLOWnestedBindingTableQuerySpecificationCONTROL_FLOW
-// Original: | objectExpressionPrimary
-| CONTROL_FLOWobjectExpressionPrimaryCONTROL_FLOW
-// Original: | bindingTableReference
-| CONTROL_FLOWbindingTableReferenceCONTROL_FLOW
-// Original: | objectNameOrBindingVariable
-| CONTROL_FLOWobjectNameOrBindingVariableCONTROL_FLOW
-;
-
-// Original: nestedBindingTableQuerySpecification
-CONTROL_FLOWnestedBindingTableQuerySpecificationCONTROL_FLOW
-// Original: : nestedQuerySpecification
-: CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
-;
-
-// 11.3 <object expression primary>
-
-// Original: objectExpressionPrimary
-CONTROL_FLOWobjectExpressionPrimaryCONTROL_FLOW
-// Original: : VARIABLE valueExpressionPrimary
-: CONTROL_FLOWVARIABLECONTROL_FLOW CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
-// Original: | parenthesizedValueExpression
-| CONTROL_FLOWparenthesizedValueExpressionCONTROL_FLOW
-// Original: | nonParenthesizedValueExpressionPrimarySpecialCase
-| CONTROL_FLOWnonParenthesizedValueExpressionPrimarySpecialCaseCONTROL_FLOW
-;
-
-// 12.1 <linear catalog-modifying statement>
-
-// Original: linearCatalogModifyingStatement
-CONTROL_FLOWlinearCatalogModifyingStatementCONTROL_FLOW
-: simpleCatalogModifyingStatement+
-;
-
-// Original: simpleCatalogModifyingStatement
-CONTROL_FLOWsimpleCatalogModifyingStatementCONTROL_FLOW
-// Original: : primitiveCatalogModifyingStatement
-: CONTROL_FLOWprimitiveCatalogModifyingStatementCONTROL_FLOW
-// Original: | callCatalogModifyingProcedureStatement
-| CONTROL_FLOWcallCatalogModifyingProcedureStatementCONTROL_FLOW
-;
-
-// Original: primitiveCatalogModifyingStatement
-CONTROL_FLOWprimitiveCatalogModifyingStatementCONTROL_FLOW
-// Original: : createSchemaStatement
-: CONTROL_FLOWcreateSchemaStatementCONTROL_FLOW
-// Original: | dropSchemaStatement
-| CONTROL_FLOWdropSchemaStatementCONTROL_FLOW
-// Original: | createGraphStatement
-| CONTROL_FLOWcreateGraphStatementCONTROL_FLOW
-// Original: | dropGraphStatement
-| CONTROL_FLOWdropGraphStatementCONTROL_FLOW
-// Original: | createGraphTypeStatement
-| CONTROL_FLOWcreateGraphTypeStatementCONTROL_FLOW
-// Original: | dropGraphTypeStatement
-| CONTROL_FLOWdropGraphTypeStatementCONTROL_FLOW
-;
-
-// 12.2 <insert schema statement>
-
-// Original: createSchemaStatement
-CONTROL_FLOWcreateSchemaStatementCONTROL_FLOW
-// Original: : CREATE SCHEMA (IF NOT EXISTS)? catalogSchemaParentAndName
-// Original: : KEYWORD SCHEMA (IF NOT EXISTS)? catalogSchemaParentAndName
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWSCHEMACONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogSchemaParentAndNameCONTROL_FLOW
-;
-
-// 12.3 <drop schema statement>
-
-// Original: dropSchemaStatement
-CONTROL_FLOWdropSchemaStatementCONTROL_FLOW
-// Original: : DROP SCHEMA (IF EXISTS)? catalogSchemaParentAndName
-: CONTROL_FLOWDROPCONTROL_FLOW CONTROL_FLOWSCHEMACONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogSchemaParentAndNameCONTROL_FLOW
-;
-
-// 12.4 <insert graph statement>
-
-// Original: createGraphStatement
-CONTROL_FLOWcreateGraphStatementCONTROL_FLOW
-// Original: : CREATE (PROPERTY? GRAPH (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-// Original: : KEYWORD (PROPERTY? GRAPH (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-// Original: : KEYWORD (PROPERTY? GRAPH (IF NOT EXISTS)? | OR KEYWORD PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-// Original: : KEYWORD (KEYWORD? GRAPH (IF NOT EXISTS)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-// Original: : KEYWORD (KEYWORD? GRAPH (IF KEYWORD EXISTS)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-// Original: : KEYWORD (KEYWORD? GRAPH (IF KEYWORD KEYWORD)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-// Original: : KEYWORD (KEYWORD? GRAPH (CONTROL_FLOW KEYWORD KEYWORD)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-: KEYWORD (KEYWORD? GRAPH (CONTROL_FLOW KEYWORD KEYWORD)? | KEYWORD KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
-;
-
-// Original: openGraphType
-CONTROL_FLOWopenGraphTypeCONTROL_FLOW
-// Original: : typed? ANY (PROPERTY? GRAPH)?
-// Original: : typed? ANY (KEYWORD? GRAPH)?
-: typed? KEYWORD (KEYWORD? GRAPH)?
-;
-
-// Original: ofGraphType
-CONTROL_FLOWofGraphTypeCONTROL_FLOW
-// Original: : graphTypeLikeGraph
-: CONTROL_FLOWgraphTypeLikeGraphCONTROL_FLOW
-// Original: | typed? graphTypeReference
-| CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWgraphTypeReferenceCONTROL_FLOW
-// Original: | typed? (PROPERTY? GRAPH)? nestedGraphTypeSpecification
-| CONTROL_FLOWtypedCONTROL_FLOW? (CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW)? CONTROL_FLOWnestedGraphTypeSpecificationCONTROL_FLOW
-;
-
-// Original: graphTypeLikeGraph
-CONTROL_FLOWgraphTypeLikeGraphCONTROL_FLOW
-// Original: : LIKE graphExpression
-: CONTROL_FLOWLIKECONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
-;
-
-// Original: graphSource
-CONTROL_FLOWgraphSourceCONTROL_FLOW
-// Original: : AS COPY OF graphExpression
-// Original: : KEYWORD COPY OF graphExpression
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWCOPYCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
-;
-
-// 12.5 <drop graph statement>
-
-// Original: dropGraphStatement
-CONTROL_FLOWdropGraphStatementCONTROL_FLOW
-// Original: : DROP PROPERTY? GRAPH (IF EXISTS)? catalogGraphParentAndName
-: CONTROL_FLOWDROPCONTROL_FLOW CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogGraphParentAndNameCONTROL_FLOW
-;
-
-// 12.6 <graph type statement>
-
-// Original: createGraphTypeStatement
-CONTROL_FLOWcreateGraphTypeStatementCONTROL_FLOW
-// Original: : CREATE (PROPERTY? GRAPH TYPE (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH TYPE) catalogGraphTypeParentAndName graphTypeSource
-// Original: : KEYWORD (PROPERTY? GRAPH TYPE (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH TYPE) catalogGraphTypeParentAndName graphTypeSource
-: CONTROL_FLOWKEYWORDCONTROL_FLOW (CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? | CONTROL_FLOWORCONTROL_FLOW CONTROL_FLOWREPLACECONTROL_FLOW CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW) CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW CONTROL_FLOWgraphTypeSourceCONTROL_FLOW
-;
-
-// Original: graphTypeSource
-CONTROL_FLOWgraphTypeSourceCONTROL_FLOW
-// Original: : AS? copyOfGraphType
-// Original: : KEYWORD? copyOfGraphType
-: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWcopyOfGraphTypeCONTROL_FLOW
-// Original: | graphTypeLikeGraph
-| CONTROL_FLOWgraphTypeLikeGraphCONTROL_FLOW
-// Original: | AS? nestedGraphTypeSpecification
-// Original: | KEYWORD? nestedGraphTypeSpecification
-| CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWnestedGraphTypeSpecificationCONTROL_FLOW
-;
-
-// Original: copyOfGraphType
-CONTROL_FLOWcopyOfGraphTypeCONTROL_FLOW
-// Original: : COPY OF graphTypeReference
-: CONTROL_FLOWCOPYCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWgraphTypeReferenceCONTROL_FLOW
-;
-
-// 12.7 <drop graph statement>
-
-// Original: dropGraphTypeStatement
-CONTROL_FLOWdropGraphTypeStatementCONTROL_FLOW
-// Original: : DROP PROPERTY? GRAPH TYPE (IF EXISTS)? catalogGraphTypeParentAndName
-: CONTROL_FLOWDROPCONTROL_FLOW CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW
-;
-
-// 12.8 <call catalog-modifying statement>
-
-// Original: callCatalogModifyingProcedureStatement
-CONTROL_FLOWcallCatalogModifyingProcedureStatementCONTROL_FLOW
-// Original: : callProcedureStatement
-: CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
-;
-
-// 13.1 <linear data-modifying statement>
-
-// Original: linearDataModifyingStatement
-CONTROL_FLOWlinearDataModifyingStatementCONTROL_FLOW
-// Original: : focusedLinearDataModifyingStatement
-: CONTROL_FLOWfocusedLinearDataModifyingStatementCONTROL_FLOW
-// Original: | ambientLinearDataModifyingStatement
-| CONTROL_FLOWambientLinearDataModifyingStatementCONTROL_FLOW
-;
-
-// Original: focusedLinearDataModifyingStatement
-CONTROL_FLOWfocusedLinearDataModifyingStatementCONTROL_FLOW
-// Original: : focusedLinearDataModifyingStatementBody
-: CONTROL_FLOWfocusedLinearDataModifyingStatementBodyCONTROL_FLOW
-// Original: | focusedNestedDataModifyingProcedureSpecification
-| CONTROL_FLOWfocusedNestedDataModifyingProcedureSpecificationCONTROL_FLOW
-;
-
-// Original: focusedLinearDataModifyingStatementBody
-CONTROL_FLOWfocusedLinearDataModifyingStatementBodyCONTROL_FLOW
-: useGraphClause simpleLinearDataAccessingStatement primitiveResultStatement?
-;
-
-// Original: focusedNestedDataModifyingProcedureSpecification
-CONTROL_FLOWfocusedNestedDataModifyingProcedureSpecificationCONTROL_FLOW
-// Original: : useGraphClause nestedDataModifyingProcedureSpecification
-: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWnestedDataModifyingProcedureSpecificationCONTROL_FLOW
-;
-
-// Original: ambientLinearDataModifyingStatement
-CONTROL_FLOWambientLinearDataModifyingStatementCONTROL_FLOW
-// Original: : ambientLinearDataModifyingStatementBody
-: CONTROL_FLOWambientLinearDataModifyingStatementBodyCONTROL_FLOW
-// Original: | nestedDataModifyingProcedureSpecification
-| CONTROL_FLOWnestedDataModifyingProcedureSpecificationCONTROL_FLOW
-;
-
-// Original: ambientLinearDataModifyingStatementBody
-CONTROL_FLOWambientLinearDataModifyingStatementBodyCONTROL_FLOW
-: simpleLinearDataAccessingStatement primitiveResultStatement?
-;
-
-// Original: simpleLinearDataAccessingStatement
-CONTROL_FLOWsimpleLinearDataAccessingStatementCONTROL_FLOW
-: simpleQueryStatement* simpleDataModifyingStatement+
-;
-
-// Original: // Subsumed by previous rule to enforce 13.1 SR 5
-// CONTROL_FLOWSubsumedCONTROL_FLOW CONTROL_FLOWbyCONTROL_FLOW CONTROL_FLOWpreviousCONTROL_FLOW CONTROL_FLOWruleCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWenforceCONTROL_FLOW CONTROL_FLOW13CONTROL_FLOW.CONTROL_FLOW1CONTROL_FLOW CONTROL_FLOWSRCONTROL_FLOW CONTROL_FLOW5CONTROL_FLOW
-// Original: //simpleDataAccessingStatement
-//CONTROL_FLOWsimpleDataAccessingStatementCONTROL_FLOW
-// Original: //    : simpleQueryStatement
-//    : CONTROL_FLOWsimpleQueryStatementCONTROL_FLOW
-// Original: //    | simpleDataModifyingStatement
-//    | CONTROL_FLOWsimpleDataModifyingStatementCONTROL_FLOW
-//    ;
-
-// Original: simpleDataModifyingStatement
-CONTROL_FLOWsimpleDataModifyingStatementCONTROL_FLOW
-// Original: : primitiveDataModifyingStatement
-: CONTROL_FLOWprimitiveDataModifyingStatementCONTROL_FLOW
-// Original: | callDataModifyingProcedureStatement
-| CONTROL_FLOWcallDataModifyingProcedureStatementCONTROL_FLOW
-;
-
-// Original: primitiveDataModifyingStatement
-CONTROL_FLOWprimitiveDataModifyingStatementCONTROL_FLOW
-// Original: : insertStatement
-: CONTROL_FLOWinsertStatementCONTROL_FLOW
-// Original: | setStatement
-| CONTROL_FLOWsetStatementCONTROL_FLOW
-// Original: | removeStatement
-| CONTROL_FLOWremoveStatementCONTROL_FLOW
-// Original: | deleteStatement
-| CONTROL_FLOWdeleteStatementCONTROL_FLOW
-;
-
-// 13.2 <insertStatement>
-
-// Original: insertStatement
-CONTROL_FLOWinsertStatementCONTROL_FLOW
-// Original: : INSERT insertGraphPattern
-: CONTROL_FLOWINSERTCONTROL_FLOW CONTROL_FLOWinsertGraphPatternCONTROL_FLOW
-;
-
-// 13.3 <set statement>
-
-// Original: setStatement
-CONTROL_FLOWsetStatementCONTROL_FLOW
-// Original: : SET setItemList
-// Original: : KEYWORD setItemList
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsetItemListCONTROL_FLOW
-;
-
-// Original: setItemList
-CONTROL_FLOWsetItemListCONTROL_FLOW
-// Original: : setItem (COMMA setItem)*
-: setItem (PUNCTUATION_OPERATOR setItem)*
-;
-
-// Original: setItem
-CONTROL_FLOWsetItemCONTROL_FLOW
-// Original: : setPropertyItem
-: CONTROL_FLOWsetPropertyItemCONTROL_FLOW
-// Original: | setAllPropertiesItem
-| CONTROL_FLOWsetAllPropertiesItemCONTROL_FLOW
-// Original: | setLabelItem
-| CONTROL_FLOWsetLabelItemCONTROL_FLOW
-;
-
-// Original: setPropertyItem
-CONTROL_FLOWsetPropertyItemCONTROL_FLOW
-// Original: : bindingVariableReference PERIOD propertyName EQUALS_OPERATOR valueExpression
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: setAllPropertiesItem
-CONTROL_FLOWsetAllPropertiesItemCONTROL_FLOW
-// Original: : bindingVariableReference EQUALS_OPERATOR LEFT_BRACE propertyKeyValuePairList? RIGHT_BRACE
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWpropertyKeyValuePairListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: setLabelItem
-CONTROL_FLOWsetLabelItemCONTROL_FLOW
-// Original: : bindingVariableReference isOrColon labelName
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelNameCONTROL_FLOW
-;
-
-// 13.4 <remove statement>
-
-// Original: removeStatement
-CONTROL_FLOWremoveStatementCONTROL_FLOW
-// Original: : REMOVE removeItemList
-: CONTROL_FLOWREMOVECONTROL_FLOW CONTROL_FLOWremoveItemListCONTROL_FLOW
-;
-
-// Original: removeItemList
-CONTROL_FLOWremoveItemListCONTROL_FLOW
-// Original: : removeItem (COMMA removeItem)*
-: removeItem (PUNCTUATION_OPERATOR removeItem)*
-;
-
-// Original: removeItem
-CONTROL_FLOWremoveItemCONTROL_FLOW
-// Original: : removePropertyItem
-: CONTROL_FLOWremovePropertyItemCONTROL_FLOW
-// Original: | removeLabelItem
-| CONTROL_FLOWremoveLabelItemCONTROL_FLOW
-;
-
-// Original: removePropertyItem
-CONTROL_FLOWremovePropertyItemCONTROL_FLOW
-// Original: : bindingVariableReference PERIOD propertyName
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW
-;
-
-// Original: removeLabelItem
-CONTROL_FLOWremoveLabelItemCONTROL_FLOW
-// Original: : bindingVariableReference isOrColon labelName
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelNameCONTROL_FLOW
-;
-
-// 13.5 <delete statement>
-
-// Original: deleteStatement
-CONTROL_FLOWdeleteStatementCONTROL_FLOW
-// Original: : (DETACH | NODETACH)? DELETE deleteItemList
-// Original: : (DETACH | NODETACH)? KEYWORD deleteItemList
-// Original: : (KEYWORD | NODETACH)? KEYWORD deleteItemList
-: (CONTROL_FLOWKEYWORDCONTROL_FLOW | CONTROL_FLOWNODETACHCONTROL_FLOW)? CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWdeleteItemListCONTROL_FLOW
-;
-
-// Original: deleteItemList
-CONTROL_FLOWdeleteItemListCONTROL_FLOW
-// Original: : deleteItem (COMMA deleteItem)*
-: deleteItem (PUNCTUATION_OPERATOR deleteItem)*
-;
-
-// Original: deleteItem
-CONTROL_FLOWdeleteItemCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 13.6 <call data-modifying procedure statement>
-
-// Original: callDataModifyingProcedureStatement
-CONTROL_FLOWcallDataModifyingProcedureStatementCONTROL_FLOW
-// Original: : callProcedureStatement
-: CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
-;
-
-// 14.1 <composite query statement>
-
-// Original: compositeQueryStatement
-CONTROL_FLOWcompositeQueryStatementCONTROL_FLOW
-// Original: : compositeQueryExpression
-: CONTROL_FLOWcompositeQueryExpressionCONTROL_FLOW
-;
-
-// 14.2 <composite query expression>
-
-// Original: compositeQueryExpression
-CONTROL_FLOWcompositeQueryExpressionCONTROL_FLOW
-// Original: : compositeQueryExpression queryConjunction compositeQueryPrimary
-: CONTROL_FLOWcompositeQueryExpressionCONTROL_FLOW CONTROL_FLOWqueryConjunctionCONTROL_FLOW CONTROL_FLOWcompositeQueryPrimaryCONTROL_FLOW
-// Original: | compositeQueryPrimary
-| CONTROL_FLOWcompositeQueryPrimaryCONTROL_FLOW
-;
-
-// Original: queryConjunction
-CONTROL_FLOWqueryConjunctionCONTROL_FLOW
-// Original: : setOperator
-: CONTROL_FLOWsetOperatorCONTROL_FLOW
-// Original: | OTHERWISE
-| CONTROL_FLOWOTHERWISECONTROL_FLOW
-;
-
-// Original: setOperator
-CONTROL_FLOWsetOperatorCONTROL_FLOW
-// Original: : UNION setQuantifier?
-: KEYWORD setQuantifier?
-// Original: | EXCEPT setQuantifier?
-| KEYWORD setQuantifier?
-// Original: | INTERSECT setQuantifier?
-| KEYWORD setQuantifier?
-;
-
-// Original: compositeQueryPrimary
-CONTROL_FLOWcompositeQueryPrimaryCONTROL_FLOW
-// Original: : linearQueryStatement
-: CONTROL_FLOWlinearQueryStatementCONTROL_FLOW
-;
-
-// 14.3 <linear query statement> and <simple query statement>
-
-// Original: linearQueryStatement
-CONTROL_FLOWlinearQueryStatementCONTROL_FLOW
-// Original: : focusedLinearQueryStatement
-: CONTROL_FLOWfocusedLinearQueryStatementCONTROL_FLOW
-// Original: | ambientLinearQueryStatement
-| CONTROL_FLOWambientLinearQueryStatementCONTROL_FLOW
-;
-
-// Original: focusedLinearQueryStatement
-CONTROL_FLOWfocusedLinearQueryStatementCONTROL_FLOW
-// Original: : focusedLinearQueryStatementPart* focusedLinearQueryAndPrimitiveResultStatementPart
-: CONTROL_FLOWfocusedLinearQueryStatementPartCONTROL_FLOW* CONTROL_FLOWfocusedLinearQueryAndPrimitiveResultStatementPartCONTROL_FLOW
-// Original: | focusedPrimitiveResultStatement
-| CONTROL_FLOWfocusedPrimitiveResultStatementCONTROL_FLOW
-// Original: | focusedNestedQuerySpecification
-| CONTROL_FLOWfocusedNestedQuerySpecificationCONTROL_FLOW
-// Original: | selectStatement
-| CONTROL_FLOWselectStatementCONTROL_FLOW
-;
-
-// Original: focusedLinearQueryStatementPart
-CONTROL_FLOWfocusedLinearQueryStatementPartCONTROL_FLOW
-// Original: : useGraphClause simpleLinearQueryStatement
-: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW
-;
-
-// Original: focusedLinearQueryAndPrimitiveResultStatementPart
-CONTROL_FLOWfocusedLinearQueryAndPrimitiveResultStatementPartCONTROL_FLOW
-// Original: : useGraphClause simpleLinearQueryStatement primitiveResultStatement
-: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
-;
-
-// Original: focusedPrimitiveResultStatement
-CONTROL_FLOWfocusedPrimitiveResultStatementCONTROL_FLOW
-// Original: : useGraphClause primitiveResultStatement
-: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
-;
-
-// Original: focusedNestedQuerySpecification
-CONTROL_FLOWfocusedNestedQuerySpecificationCONTROL_FLOW
-// Original: : useGraphClause nestedQuerySpecification
-: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
-;
-
-// Original: ambientLinearQueryStatement
-CONTROL_FLOWambientLinearQueryStatementCONTROL_FLOW
-// Original: : simpleLinearQueryStatement? primitiveResultStatement
-: CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW? CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
-// Original: | nestedQuerySpecification
-| CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
-;
-
-// Original: simpleLinearQueryStatement
-CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW
-: simpleQueryStatement+
-;
-
-// Original: simpleQueryStatement
-CONTROL_FLOWsimpleQueryStatementCONTROL_FLOW
-// Original: : primitiveQueryStatement
-: CONTROL_FLOWprimitiveQueryStatementCONTROL_FLOW
-// Original: | callQueryStatement
-| CONTROL_FLOWcallQueryStatementCONTROL_FLOW
-;
-
-// Original: primitiveQueryStatement
-CONTROL_FLOWprimitiveQueryStatementCONTROL_FLOW
-// Original: : matchStatement
-: CONTROL_FLOWmatchStatementCONTROL_FLOW
-// Original: | letStatement
-| CONTROL_FLOWletStatementCONTROL_FLOW
-// Original: | forStatement
-| CONTROL_FLOWforStatementCONTROL_FLOW
-// Original: | filterStatement
-| CONTROL_FLOWfilterStatementCONTROL_FLOW
-// Original: | orderByAndPageStatement
-| CONTROL_FLOWorderByAndPageStatementCONTROL_FLOW
-;
-
-// 14.4 <match statement>
-
-// Original: matchStatement
-CONTROL_FLOWmatchStatementCONTROL_FLOW
-// Original: : simpleMatchStatement
-: CONTROL_FLOWsimpleMatchStatementCONTROL_FLOW
-// Original: | optionalMatchStatement
-| CONTROL_FLOWoptionalMatchStatementCONTROL_FLOW
-;
-
-// Original: simpleMatchStatement
-CONTROL_FLOWsimpleMatchStatementCONTROL_FLOW
-// Original: : MATCH graphPatternBindingTable
-: CONTROL_FLOWMATCHCONTROL_FLOW CONTROL_FLOWgraphPatternBindingTableCONTROL_FLOW
-;
-
-// Original: optionalMatchStatement
-CONTROL_FLOWoptionalMatchStatementCONTROL_FLOW
-// Original: : OPTIONAL optionalOperand
-: CONTROL_FLOWOPTIONALCONTROL_FLOW CONTROL_FLOWoptionalOperandCONTROL_FLOW
-;
-
-// Original: optionalOperand
-CONTROL_FLOWoptionalOperandCONTROL_FLOW
-// Original: : simpleMatchStatement
-: CONTROL_FLOWsimpleMatchStatementCONTROL_FLOW
-// Original: | LEFT_BRACE matchStatementBlock RIGHT_BRACE
-| CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWmatchStatementBlockCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-// Original: | LEFT_PAREN matchStatementBlock RIGHT_PAREN
-// Original: | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR
-| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWmatchStatementBlockCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: matchStatementBlock
-CONTROL_FLOWmatchStatementBlockCONTROL_FLOW
-: matchStatement+
-;
-
-// 14.5 <call query statement>
-
-// Original: callQueryStatement
-CONTROL_FLOWcallQueryStatementCONTROL_FLOW
-// Original: : callProcedureStatement
-: CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
-;
-
-// 14.6 <filter statement>
-
-// Original: filterStatement
-CONTROL_FLOWfilterStatementCONTROL_FLOW
-// Original: : FILTER (whereClause | searchCondition)
-: KEYWORD (whereClause | searchCondition)
-;
-
-// 14.7 <let statement>
-
-// Original: letStatement
-CONTROL_FLOWletStatementCONTROL_FLOW
-// Original: : LET letVariableDefinitionList
-: CONTROL_FLOWLETCONTROL_FLOW CONTROL_FLOWletVariableDefinitionListCONTROL_FLOW
-;
-
-// Original: letVariableDefinitionList
-CONTROL_FLOWletVariableDefinitionListCONTROL_FLOW
-// Original: : letVariableDefinition (COMMA letVariableDefinition)*
-: letVariableDefinition (PUNCTUATION_OPERATOR letVariableDefinition)*
-;
-
-// Original: letVariableDefinition
-CONTROL_FLOWletVariableDefinitionCONTROL_FLOW
-// Original: : valueVariableDefinition
-: CONTROL_FLOWvalueVariableDefinitionCONTROL_FLOW
-// Original: | bindingVariable EQUALS_OPERATOR valueExpression
-| CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 14.8 <for statement>
-
-// Original: forStatement
-CONTROL_FLOWforStatementCONTROL_FLOW
-// Original: : FOR forItem forOrdinalityOrOffset?
-: CONTROL_FLOW forItem forOrdinalityOrOffset?
-;
-
-// Original: forItem
-CONTROL_FLOWforItemCONTROL_FLOW
-// Original: : forItemAlias forItemSource
-: CONTROL_FLOWforItemAliasCONTROL_FLOW CONTROL_FLOWforItemSourceCONTROL_FLOW
-;
-
-// Original: forItemAlias
-CONTROL_FLOWforItemAliasCONTROL_FLOW
-// Original: : bindingVariable IN
-: CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWINCONTROL_FLOW
-;
-
-// Original: forItemSource
-CONTROL_FLOWforItemSourceCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: forOrdinalityOrOffset
-CONTROL_FLOWforOrdinalityOrOffsetCONTROL_FLOW
-// Original: : WITH (ORDINALITY | OFFSET) bindingVariable
-// Original: : WITH (KEYWORD | OFFSET) bindingVariable
-: CONTROL_FLOWWITHCONTROL_FLOW (CONTROL_FLOWKEYWORDCONTROL_FLOW | CONTROL_FLOWOFFSETCONTROL_FLOW) CONTROL_FLOWbindingVariableCONTROL_FLOW
-;
-
-// 14.9 <order by and page statement>
-
-// Original: orderByAndPageStatement
-CONTROL_FLOWorderByAndPageStatementCONTROL_FLOW
-: orderByClause offsetClause? limitClause?
-| offsetClause limitClause?
-// Original: | limitClause
-| CONTROL_FLOWlimitClauseCONTROL_FLOW
-;
-
-// 14.10 <primitive result statement>
-
-// Original: primitiveResultStatement
-CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
-: returnStatement orderByAndPageStatement?
-// Original: | FINISH
-| CONTROL_FLOWFINISHCONTROL_FLOW
-;
-
-// 14.11 <return statement>
-
-// Original: returnStatement
-CONTROL_FLOWreturnStatementCONTROL_FLOW
-// Original: : RETURN returnStatementBody
-: CONTROL_FLOWRETURNCONTROL_FLOW CONTROL_FLOWreturnStatementBodyCONTROL_FLOW
-;
-
-// Original: returnStatementBody
-CONTROL_FLOWreturnStatementBodyCONTROL_FLOW
-// Original: : setQuantifier? (ASTERISK | returnItemList) groupByClause?
-: setQuantifier? (PUNCTUATION_OPERATOR | returnItemList) groupByClause?
-// Original: | NO BINDINGS
-// Original: | NO KEYWORD
-| CONTROL_FLOWNOCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW
-;
-
-// Original: returnItemList
-CONTROL_FLOWreturnItemListCONTROL_FLOW
-// Original: : returnItem (COMMA returnItem)*
-: returnItem (PUNCTUATION_OPERATOR returnItem)*
-;
-
-// Original: returnItem
-CONTROL_FLOWreturnItemCONTROL_FLOW
-: aggregatingValueExpression returnItemAlias?
-;
-
-// Original: returnItemAlias
-CONTROL_FLOWreturnItemAliasCONTROL_FLOW
-// Original: : AS identifier
-// Original: : KEYWORD identifier
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// 14.12 <select statement>
-
-// Original: selectStatement
-CONTROL_FLOWselectStatementCONTROL_FLOW
-// Original: : SELECT setQuantifier? (ASTERISK | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
-// Original: : SELECT setQuantifier? (PUNCTUATION_OPERATOR | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
-: KEYWORD setQuantifier? (PUNCTUATION_OPERATOR | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
-;
-
-// Original: selectItemList
-CONTROL_FLOWselectItemListCONTROL_FLOW
-// Original: : selectItem (COMMA selectItem)*
-: selectItem (PUNCTUATION_OPERATOR selectItem)*
-;
-
-// Original: selectItem
-CONTROL_FLOWselectItemCONTROL_FLOW
-: aggregatingValueExpression selectItemAlias?
-;
-
-// Original: selectItemAlias
-CONTROL_FLOWselectItemAliasCONTROL_FLOW
-// Original: : AS identifier
-// Original: : KEYWORD identifier
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: havingClause
-CONTROL_FLOWhavingClauseCONTROL_FLOW
-// Original: : HAVING searchCondition
-: CONTROL_FLOWHAVINGCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
-;
-
-// Original: selectStatementBody
-CONTROL_FLOWselectStatementBodyCONTROL_FLOW
-// Original: : FROM (selectGraphMatchList | selectQuerySpecification)
-: KEYWORD (selectGraphMatchList | selectQuerySpecification)
-;
-
-// Original: selectGraphMatchList
-CONTROL_FLOWselectGraphMatchListCONTROL_FLOW
-// Original: : selectGraphMatch (COMMA selectGraphMatch)*
-: selectGraphMatch (PUNCTUATION_OPERATOR selectGraphMatch)*
-;
-
-// Original: selectGraphMatch
-CONTROL_FLOWselectGraphMatchCONTROL_FLOW
-// Original: : graphExpression matchStatement
-: CONTROL_FLOWgraphExpressionCONTROL_FLOW CONTROL_FLOWmatchStatementCONTROL_FLOW
-;
-
-// Original: selectQuerySpecification
-CONTROL_FLOWselectQuerySpecificationCONTROL_FLOW
-// Original: : nestedQuerySpecification
-: CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
-// Original: | graphExpression nestedQuerySpecification
-| CONTROL_FLOWgraphExpressionCONTROL_FLOW CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
-;
-
-// 15.1 <call procedure statement> and <procedure call>
-
-// Original: callProcedureStatement
-CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
-// Original: : OPTIONAL? CALL procedureCall
-// Original: : OPTIONAL? KEYWORD procedureCall
-: CONTROL_FLOWOPTIONALCONTROL_FLOW? CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWprocedureCallCONTROL_FLOW
-;
-
-// Original: procedureCall
-CONTROL_FLOWprocedureCallCONTROL_FLOW
-// Original: : inlineProcedureCall
-: CONTROL_FLOWinlineProcedureCallCONTROL_FLOW
-// Original: | namedProcedureCall
-| CONTROL_FLOWnamedProcedureCallCONTROL_FLOW
-;
-
-// 15.2 <inline procedure call>
-
-// Original: inlineProcedureCall
-CONTROL_FLOWinlineProcedureCallCONTROL_FLOW
-// Original: : variableScopeClause? nestedProcedureSpecification
-: CONTROL_FLOWvariableScopeClauseCONTROL_FLOW? CONTROL_FLOWnestedProcedureSpecificationCONTROL_FLOW
-;
-
-// Original: variableScopeClause
-CONTROL_FLOWvariableScopeClauseCONTROL_FLOW
-// Original: : LEFT_PAREN bindingVariableReferenceList? RIGHT_PAREN
-// Original: : LEFT_PAREN bindingVariableReferenceList? PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWbindingVariableReferenceListCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: bindingVariableReferenceList
-CONTROL_FLOWbindingVariableReferenceListCONTROL_FLOW
-// Original: : bindingVariableReference (COMMA bindingVariableReference)*
-: bindingVariableReference (PUNCTUATION_OPERATOR bindingVariableReference)*
-;
-
-// 15.3 <named procedure call>
-
-// Original: namedProcedureCall
-CONTROL_FLOWnamedProcedureCallCONTROL_FLOW
-// Original: : procedureReference LEFT_PAREN procedureArgumentList? RIGHT_PAREN yieldClause?
-// Original: : procedureReference LEFT_PAREN procedureArgumentList? PUNCTUATION_OPERATOR yieldClause?
-: procedureReference PUNCTUATION_OPERATOR procedureArgumentList? PUNCTUATION_OPERATOR yieldClause?
-;
-
-// Original: procedureArgumentList
-CONTROL_FLOWprocedureArgumentListCONTROL_FLOW
-// Original: : procedureArgument (COMMA procedureArgument)*
-: procedureArgument (PUNCTUATION_OPERATOR procedureArgument)*
-;
-
-// Original: procedureArgument
-CONTROL_FLOWprocedureArgumentCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 16.1 <at schema clasue>
-
-// Original: atSchemaClause
-CONTROL_FLOWatSchemaClauseCONTROL_FLOW
-// Original: : AT schemaReference
-// Original: : KEYWORD schemaReference
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWschemaReferenceCONTROL_FLOW
-;
-
-// 16.2 <use graph clause>
-
-// Original: useGraphClause
-CONTROL_FLOWuseGraphClauseCONTROL_FLOW
-// Original: : USE graphExpression
-: CONTROL_FLOWUSECONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
-;
-
-// 16.3 <graph pattern binding table>
-
-// Original: graphPatternBindingTable
-CONTROL_FLOWgraphPatternBindingTableCONTROL_FLOW
-: graphPattern graphPatternYieldClause?
-;
-
-// Original: graphPatternYieldClause
-CONTROL_FLOWgraphPatternYieldClauseCONTROL_FLOW
-// Original: : YIELD graphPatternYieldItemList
-// Original: : KEYWORD graphPatternYieldItemList
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWgraphPatternYieldItemListCONTROL_FLOW
-;
-
-// Original: graphPatternYieldItemList
-CONTROL_FLOWgraphPatternYieldItemListCONTROL_FLOW
-// Original: : graphPatternYieldItem (COMMA graphPatternYieldItem)*
-: graphPatternYieldItem (PUNCTUATION_OPERATOR graphPatternYieldItem)*
-// Original: | NO BINDINGS
-// Original: | NO KEYWORD
-| CONTROL_FLOWNOCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW
-;
-
-// Original: // <elemement variable reference> and <path variable reference> are identical productions, both consisting
-// <CONTROL_FLOWelemementCONTROL_FLOW CONTROL_FLOWvariableCONTROL_FLOW CONTROL_FLOWreferenceCONTROL_FLOW> CONTROL_FLOWandCONTROL_FLOW <CONTROL_FLOWpathCONTROL_FLOW CONTROL_FLOWvariableCONTROL_FLOW CONTROL_FLOWreferenceCONTROL_FLOW> CONTROL_FLOWareCONTROL_FLOW CONTROL_FLOWidenticalCONTROL_FLOW CONTROL_FLOWproductionsCONTROL_FLOW, CONTROL_FLOWbothCONTROL_FLOW CONTROL_FLOWconsistingCONTROL_FLOW
-// Original: // of a single non-terminal <binding variable reference>. Thus <graph pattern yield item> is ambiguous
-// CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWsingleCONTROL_FLOW CONTROL_FLOWnonCONTROL_FLOW-CONTROL_FLOWterminalCONTROL_FLOW <CONTROL_FLOWbindingCONTROL_FLOW CONTROL_FLOWvariableCONTROL_FLOW CONTROL_FLOWreferenceCONTROL_FLOW>. CONTROL_FLOWThusCONTROL_FLOW <CONTROL_FLOWgraphCONTROL_FLOW CONTROL_FLOWpatternCONTROL_FLOW CONTROL_FLOWyieldCONTROL_FLOW CONTROL_FLOWitemCONTROL_FLOW> CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWambiguousCONTROL_FLOW
-// Original: // from a parsing standpoint. So here we simply use bindingVariableReference. Post parsing code must
-// CONTROL_FLOWfromCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWparsingCONTROL_FLOW CONTROL_FLOWstandpointCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWhereCONTROL_FLOW CONTROL_FLOWweCONTROL_FLOW CONTROL_FLOWsimplyCONTROL_FLOW CONTROL_FLOWuseCONTROL_FLOW CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW. CONTROL_FLOWPostCONTROL_FLOW CONTROL_FLOWparsingCONTROL_FLOW CONTROL_FLOWcodeCONTROL_FLOW CONTROL_FLOWmustCONTROL_FLOW
-// apply the semantics assocaited with each type of <binding variable reference>.
-// Original: graphPatternYieldItem
-CONTROL_FLOWgraphPatternYieldItemCONTROL_FLOW
-// Original: : bindingVariableReference
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
-// Original: //    : elementVariableReference
-//    : CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
-// Original: //    | pathVariableReference
-//    | CONTROL_FLOWpathVariableReferenceCONTROL_FLOW
-;
-
-// 16.4 <graph pattern>
-
-// Original: graphPattern
-CONTROL_FLOWgraphPatternCONTROL_FLOW
-: matchMode? pathPatternList keepClause? graphPatternWhereClause?
-;
-
-// Original: matchMode
-CONTROL_FLOWmatchModeCONTROL_FLOW
-// Original: : repeatableElementsMatchMode
-: CONTROL_FLOWrepeatableElementsMatchModeCONTROL_FLOW
-// Original: | differentEdgesMatchMode
-| CONTROL_FLOWdifferentEdgesMatchModeCONTROL_FLOW
-;
-
-// Original: repeatableElementsMatchMode
-CONTROL_FLOWrepeatableElementsMatchModeCONTROL_FLOW
-// Original: : REPEATABLE elementBindingsOrElements
-: CONTROL_FLOWREPEATABLECONTROL_FLOW CONTROL_FLOWelementBindingsOrElementsCONTROL_FLOW
-;
-
-// Original: differentEdgesMatchMode
-CONTROL_FLOWdifferentEdgesMatchModeCONTROL_FLOW
-// Original: : DIFFERENT edgeBindingsOrEdges
-: CONTROL_FLOWDIFFERENTCONTROL_FLOW CONTROL_FLOWedgeBindingsOrEdgesCONTROL_FLOW
-;
-
-// Original: elementBindingsOrElements
-CONTROL_FLOWelementBindingsOrElementsCONTROL_FLOW
-// Original: : ELEMENT BINDINGS?
-// Original: : ELEMENT KEYWORD?
-: DATA_TYPE KEYWORD?
-// Original: | ELEMENTS
-| CONTROL_FLOWELEMENTSCONTROL_FLOW
-;
-
-// Original: edgeBindingsOrEdges
-CONTROL_FLOWedgeBindingsOrEdgesCONTROL_FLOW
-// Original: : edgeSynonym BINDINGS?
-: edgeSynonym KEYWORD?
-// Original: | edgesSynonym
-| CONTROL_FLOWedgesSynonymCONTROL_FLOW
-;
-
-// Original: pathPatternList
-CONTROL_FLOWpathPatternListCONTROL_FLOW
-// Original: : pathPattern (COMMA pathPattern)*
-: pathPattern (PUNCTUATION_OPERATOR pathPattern)*
-;
-
-// Original: pathPattern
-CONTROL_FLOWpathPatternCONTROL_FLOW
-// Original: : pathVariableDeclaration? pathPatternPrefix? pathPatternExpression
-: CONTROL_FLOWpathVariableDeclarationCONTROL_FLOW? CONTROL_FLOWpathPatternPrefixCONTROL_FLOW? CONTROL_FLOWpathPatternExpressionCONTROL_FLOW
-;
-
-// Original: pathVariableDeclaration
-CONTROL_FLOWpathVariableDeclarationCONTROL_FLOW
-// Original: : pathVariable EQUALS_OPERATOR
-: CONTROL_FLOWpathVariableCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW
-;
-
-// Original: keepClause
-CONTROL_FLOWkeepClauseCONTROL_FLOW
-// Original: : KEEP pathPatternPrefix
-: CONTROL_FLOWKEEPCONTROL_FLOW CONTROL_FLOWpathPatternPrefixCONTROL_FLOW
-;
-
-// Original: graphPatternWhereClause
-CONTROL_FLOWgraphPatternWhereClauseCONTROL_FLOW
-// Original: : WHERE searchCondition
-// Original: : KEYWORD searchCondition
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
-;
-
-// 16.5 <insert graph pattern>
-
-// Original: insertGraphPattern
-CONTROL_FLOWinsertGraphPatternCONTROL_FLOW
-// Original: : insertPathPatternList
-: CONTROL_FLOWinsertPathPatternListCONTROL_FLOW
-;
-
-// Original: insertPathPatternList
-CONTROL_FLOWinsertPathPatternListCONTROL_FLOW
-// Original: : insertPathPattern (COMMA insertPathPattern)*
-: insertPathPattern (PUNCTUATION_OPERATOR insertPathPattern)*
-;
-
-// Original: insertPathPattern
-CONTROL_FLOWinsertPathPatternCONTROL_FLOW
-: insertNodePattern (insertEdgePattern insertNodePattern)*
-;
-
-// Original: insertNodePattern
-CONTROL_FLOWinsertNodePatternCONTROL_FLOW
-// Original: : LEFT_PAREN insertElementPatternFiller? RIGHT_PAREN
-// Original: : LEFT_PAREN insertElementPatternFiller? PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: insertEdgePattern
-CONTROL_FLOWinsertEdgePatternCONTROL_FLOW
-// Original: : insertEdgePointingLeft
-: CONTROL_FLOWinsertEdgePointingLeftCONTROL_FLOW
-// Original: | insertEdgePointingRight
-| CONTROL_FLOWinsertEdgePointingRightCONTROL_FLOW
-// Original: | insertEdgeUndirected
-| CONTROL_FLOWinsertEdgeUndirectedCONTROL_FLOW
-;
-
-// Original: insertEdgePointingLeft
-CONTROL_FLOWinsertEdgePointingLeftCONTROL_FLOW
-// Original: : LEFT_ARROW_BRACKET insertElementPatternFiller? RIGHT_BRACKET_MINUS
-: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
-;
-
-// Original: insertEdgePointingRight
-CONTROL_FLOWinsertEdgePointingRightCONTROL_FLOW
-// Original: : MINUS_LEFT_BRACKET insertElementPatternFiller? BRACKET_RIGHT_ARROW
-// Original: : MINUS_LEFT_BRACKET insertElementPatternFiller? PUNCTUATION_OPERATOR
-: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: insertEdgeUndirected
-CONTROL_FLOWinsertEdgeUndirectedCONTROL_FLOW
-// Original: : TILDE_LEFT_BRACKET insertElementPatternFiller? RIGHT_BRACKET_TILDE
-// Original: : TILDE_LEFT_BRACKET insertElementPatternFiller? PUNCTUATION_OPERATOR
-// Original: : PUNCTUATION_OPERATOR insertElementPatternFiller? PUNCTUATION_OPERATOR
-: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: insertElementPatternFiller
-CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW
-: elementVariableDeclaration labelAndPropertySetSpecification?
-// Original: | elementVariableDeclaration? labelAndPropertySetSpecification
-| CONTROL_FLOWelementVariableDeclarationCONTROL_FLOW? CONTROL_FLOWlabelAndPropertySetSpecificationCONTROL_FLOW
-;
-
-// Original: labelAndPropertySetSpecification
-CONTROL_FLOWlabelAndPropertySetSpecificationCONTROL_FLOW
-: isOrColon labelSetSpecification elementPropertySpecification?
-// Original: | (isOrColon labelSetSpecification)? elementPropertySpecification
-| (CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW)? CONTROL_FLOWelementPropertySpecificationCONTROL_FLOW
-;
-
-// 16.6 <path pattern prefix>
-
-// Original: pathPatternPrefix
-CONTROL_FLOWpathPatternPrefixCONTROL_FLOW
-// Original: : pathModePrefix
-: CONTROL_FLOWpathModePrefixCONTROL_FLOW
-// Original: | pathSearchPrefix
-| CONTROL_FLOWpathSearchPrefixCONTROL_FLOW
-;
-
-// Original: pathModePrefix
-CONTROL_FLOWpathModePrefixCONTROL_FLOW
-: pathMode pathOrPaths?
-;
-
-// Original: pathMode
-CONTROL_FLOWpathModeCONTROL_FLOW
-// Original: : WALK
-: CONTROL_FLOWWALKCONTROL_FLOW
-// Original: | TRAIL
-| CONTROL_FLOWTRAILCONTROL_FLOW
-// Original: | SIMPLE
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | ACYCLIC
-| CONTROL_FLOWACYCLICCONTROL_FLOW
-;
-
-// Original: pathSearchPrefix
-CONTROL_FLOWpathSearchPrefixCONTROL_FLOW
-// Original: : allPathSearch
-: CONTROL_FLOWallPathSearchCONTROL_FLOW
-// Original: | anyPathSearch
-| CONTROL_FLOWanyPathSearchCONTROL_FLOW
-// Original: | shortestPathSearch
-| CONTROL_FLOWshortestPathSearchCONTROL_FLOW
-;
-
-// Original: allPathSearch
-CONTROL_FLOWallPathSearchCONTROL_FLOW
-// Original: : ALL pathMode? pathOrPaths?
-: KEYWORD pathMode? pathOrPaths?
-;
-
-// Original: pathOrPaths
-CONTROL_FLOWpathOrPathsCONTROL_FLOW
-// Original: : PATH
-// Original: : KEYWORD
-: CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | PATHS
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-;
-
-// Original: anyPathSearch
-CONTROL_FLOWanyPathSearchCONTROL_FLOW
-// Original: : ANY numberOfPaths? pathMode? pathOrPaths?
-: KEYWORD numberOfPaths? pathMode? pathOrPaths?
-;
-
-// Original: numberOfPaths
-CONTROL_FLOWnumberOfPathsCONTROL_FLOW
-// Original: : nonNegativeIntegerSpecification
-: CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
-;
-
-// Original: shortestPathSearch
-CONTROL_FLOWshortestPathSearchCONTROL_FLOW
-// Original: : allShortestPathSearch
-: CONTROL_FLOWallShortestPathSearchCONTROL_FLOW
-// Original: | anyShortestPathSearch
-| CONTROL_FLOWanyShortestPathSearchCONTROL_FLOW
-// Original: | countedShortestPathSearch
-| CONTROL_FLOWcountedShortestPathSearchCONTROL_FLOW
-// Original: | countedShortestGroupSearch
-| CONTROL_FLOWcountedShortestGroupSearchCONTROL_FLOW
-;
-
-// Original: allShortestPathSearch
-CONTROL_FLOWallShortestPathSearchCONTROL_FLOW
-// Original: : ALL SHORTEST pathMode? pathOrPaths?
-// Original: : KEYWORD SHORTEST pathMode? pathOrPaths?
-: KEYWORD KEYWORD pathMode? pathOrPaths?
-;
-
-// Original: anyShortestPathSearch
-CONTROL_FLOWanyShortestPathSearchCONTROL_FLOW
-// Original: : ANY SHORTEST pathMode? pathOrPaths?
-// Original: : ANY KEYWORD pathMode? pathOrPaths?
-: KEYWORD KEYWORD pathMode? pathOrPaths?
-;
-
-// Original: countedShortestPathSearch
-CONTROL_FLOWcountedShortestPathSearchCONTROL_FLOW
-// Original: : SHORTEST numberOfPaths pathMode? pathOrPaths?
-: KEYWORD numberOfPaths pathMode? pathOrPaths?
-;
-
-// Original: countedShortestGroupSearch
-CONTROL_FLOWcountedShortestGroupSearchCONTROL_FLOW
-// Original: : SHORTEST numberOfGroups? pathMode? pathOrPaths? (GROUP | GROUPS)
-// Original: : SHORTEST numberOfGroups? pathMode? pathOrPaths? (GROUP | KEYWORD)
-// Original: : SHORTEST numberOfGroups? pathMode? pathOrPaths? (KEYWORD | KEYWORD)
-: KEYWORD numberOfGroups? pathMode? pathOrPaths? (KEYWORD | KEYWORD)
-;
-
-// Original: numberOfGroups
-CONTROL_FLOWnumberOfGroupsCONTROL_FLOW
-// Original: : nonNegativeIntegerSpecification
-: CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
-;
-
-// 16.7 <path pattern expression>
-
-// Original: pathPatternExpression
-CONTROL_FLOWpathPatternExpressionCONTROL_FLOW
-// Original: : pathTerm                                              #ppePathTerm
-: CONTROL_FLOWpathTermCONTROL_FLOW                                              #CONTROL_FLOWppePathTermCONTROL_FLOW
-// Original: | pathTerm (MULTISET_ALTERNATION_OPERATOR pathTerm)+    #ppeMultisetAlternation
-| CONTROL_FLOWpathTermCONTROL_FLOW (CONTROL_FLOWMULTISET_ALTERNATION_OPERATORCONTROL_FLOW CONTROL_FLOWpathTermCONTROL_FLOW)+    #CONTROL_FLOWppeMultisetAlternationCONTROL_FLOW
-// Original: | pathTerm (VERTICAL_BAR pathTerm)+                     #ppePatternUnion
-| CONTROL_FLOWpathTermCONTROL_FLOW (CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWpathTermCONTROL_FLOW)+                     #CONTROL_FLOWppePatternUnionCONTROL_FLOW
-;
-
-// Original: pathTerm
-CONTROL_FLOWpathTermCONTROL_FLOW
-: pathFactor+
-;
-
-// Original: pathFactor
-CONTROL_FLOWpathFactorCONTROL_FLOW
-// Original: : pathPrimary                           #pfPathPrimary
-: CONTROL_FLOWpathPrimaryCONTROL_FLOW                           #CONTROL_FLOWpfPathPrimaryCONTROL_FLOW
-// Original: | pathPrimary graphPatternQuantifier    #pfQuantifiedPathPrimary
-| CONTROL_FLOWpathPrimaryCONTROL_FLOW CONTROL_FLOWgraphPatternQuantifierCONTROL_FLOW    #CONTROL_FLOWpfQuantifiedPathPrimaryCONTROL_FLOW
-// Original: | pathPrimary QUESTION_MARK             #pfQuestionedPathPrimary
-| CONTROL_FLOWpathPrimaryCONTROL_FLOW CONTROL_FLOWQUESTION_MARKCONTROL_FLOW             #CONTROL_FLOWpfQuestionedPathPrimaryCONTROL_FLOW
-;
-
-// Original: pathPrimary
-CONTROL_FLOWpathPrimaryCONTROL_FLOW
-// Original: : elementPattern                        #ppElementPattern
-: CONTROL_FLOWelementPatternCONTROL_FLOW                        #CONTROL_FLOWppElementPatternCONTROL_FLOW
-// Original: | parenthesizedPathPatternExpression    #ppParenthesizedPathPatternExpression
-| CONTROL_FLOWparenthesizedPathPatternExpressionCONTROL_FLOW    #CONTROL_FLOWppParenthesizedPathPatternExpressionCONTROL_FLOW
-// Original: | simplifiedPathPatternExpression       #ppSimplifiedPathPatternExpression
-| CONTROL_FLOWsimplifiedPathPatternExpressionCONTROL_FLOW       #CONTROL_FLOWppSimplifiedPathPatternExpressionCONTROL_FLOW
-;
-
-// Original: elementPattern
-CONTROL_FLOWelementPatternCONTROL_FLOW
-// Original: : nodePattern
-: CONTROL_FLOWnodePatternCONTROL_FLOW
-// Original: | edgePattern
-| CONTROL_FLOWedgePatternCONTROL_FLOW
-;
-
-// Original: nodePattern
-CONTROL_FLOWnodePatternCONTROL_FLOW
-// Original: : LEFT_PAREN elementPatternFiller RIGHT_PAREN
-// Original: : LEFT_PAREN elementPatternFiller PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: elementPatternFiller
-CONTROL_FLOWelementPatternFillerCONTROL_FLOW
-: elementVariableDeclaration? isLabelExpression? elementPatternPredicate?
-;
-
-// Original: elementVariableDeclaration
-CONTROL_FLOWelementVariableDeclarationCONTROL_FLOW
-// Original: : TEMP? elementVariable
-: CONTROL_FLOWTEMPCONTROL_FLOW? CONTROL_FLOWelementVariableCONTROL_FLOW
-;
-
-// Original: isLabelExpression
-CONTROL_FLOWisLabelExpressionCONTROL_FLOW
-// Original: : isOrColon labelExpression
-: CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW
-;
-
-// Original: isOrColon
-CONTROL_FLOWisOrColonCONTROL_FLOW
-// Original: : IS
-: CONTROL_FLOWISCONTROL_FLOW
-// Original: | COLON
-| CONTROL_FLOWCOLONCONTROL_FLOW
-;
-
-// Original: elementPatternPredicate
-CONTROL_FLOWelementPatternPredicateCONTROL_FLOW
-// Original: : elementPatternWhereClause
-: CONTROL_FLOWelementPatternWhereClauseCONTROL_FLOW
-// Original: | elementPropertySpecification
-| CONTROL_FLOWelementPropertySpecificationCONTROL_FLOW
-;
-
-// Original: elementPatternWhereClause
-CONTROL_FLOWelementPatternWhereClauseCONTROL_FLOW
-// Original: : WHERE searchCondition
-// Original: : KEYWORD searchCondition
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
-;
-
-// Original: elementPropertySpecification
-CONTROL_FLOWelementPropertySpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE propertyKeyValuePairList RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWpropertyKeyValuePairListCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: propertyKeyValuePairList
-CONTROL_FLOWpropertyKeyValuePairListCONTROL_FLOW
-// Original: : propertyKeyValuePair (COMMA propertyKeyValuePair)*
-: propertyKeyValuePair (PUNCTUATION_OPERATOR propertyKeyValuePair)*
-;
-
-// Original: propertyKeyValuePair
-CONTROL_FLOWpropertyKeyValuePairCONTROL_FLOW
-// Original: : propertyName COLON valueExpression
-: CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWCOLONCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: edgePattern
-CONTROL_FLOWedgePatternCONTROL_FLOW
-// Original: : fullEdgePattern
-: CONTROL_FLOWfullEdgePatternCONTROL_FLOW
-// Original: | abbreviatedEdgePattern
-| CONTROL_FLOWabbreviatedEdgePatternCONTROL_FLOW
-;
-
-// Original: fullEdgePattern
-CONTROL_FLOWfullEdgePatternCONTROL_FLOW
-// Original: : fullEdgePointingLeft
-: CONTROL_FLOWfullEdgePointingLeftCONTROL_FLOW
-// Original: | fullEdgeUndirected
-| CONTROL_FLOWfullEdgeUndirectedCONTROL_FLOW
-// Original: | fullEdgePointingRight
-| CONTROL_FLOWfullEdgePointingRightCONTROL_FLOW
-// Original: | fullEdgeLeftOrUndirected
-| CONTROL_FLOWfullEdgeLeftOrUndirectedCONTROL_FLOW
-// Original: | fullEdgeUndirectedOrRight
-| CONTROL_FLOWfullEdgeUndirectedOrRightCONTROL_FLOW
-// Original: | fullEdgeLeftOrRight
-| CONTROL_FLOWfullEdgeLeftOrRightCONTROL_FLOW
-// Original: | fullEdgeAnyDirection
-| CONTROL_FLOWfullEdgeAnyDirectionCONTROL_FLOW
-;
-
-// Original: fullEdgePointingLeft
-CONTROL_FLOWfullEdgePointingLeftCONTROL_FLOW
-// Original: : LEFT_ARROW_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
-: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
-;
-
-// Original: fullEdgeUndirected
-CONTROL_FLOWfullEdgeUndirectedCONTROL_FLOW
-// Original: : TILDE_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
-// Original: : TILDE_LEFT_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
-// Original: : PUNCTUATION_OPERATOR elementPatternFiller PUNCTUATION_OPERATOR
-: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: fullEdgePointingRight
-CONTROL_FLOWfullEdgePointingRightCONTROL_FLOW
-// Original: : MINUS_LEFT_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
-// Original: : MINUS_LEFT_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
-: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: fullEdgeLeftOrUndirected
-CONTROL_FLOWfullEdgeLeftOrUndirectedCONTROL_FLOW
-// Original: : LEFT_ARROW_TILDE_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
-// Original: : LEFT_ARROW_TILDE_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_ARROW_TILDE_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: fullEdgeUndirectedOrRight
-CONTROL_FLOWfullEdgeUndirectedOrRightCONTROL_FLOW
-// Original: : TILDE_LEFT_BRACKET elementPatternFiller BRACKET_TILDE_RIGHT_ARROW
-// Original: : PUNCTUATION_OPERATOR elementPatternFiller BRACKET_TILDE_RIGHT_ARROW
-: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWBRACKET_TILDE_RIGHT_ARROWCONTROL_FLOW
-;
-
-// Original: fullEdgeLeftOrRight
-CONTROL_FLOWfullEdgeLeftOrRightCONTROL_FLOW
-// Original: : LEFT_ARROW_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
-// Original: : LEFT_ARROW_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: fullEdgeAnyDirection
-CONTROL_FLOWfullEdgeAnyDirectionCONTROL_FLOW
-// Original: : MINUS_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
-: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
-;
-
-// Original: abbreviatedEdgePattern
-CONTROL_FLOWabbreviatedEdgePatternCONTROL_FLOW
-// Original: : LEFT_ARROW
-: CONTROL_FLOWLEFT_ARROWCONTROL_FLOW
-// Original: | TILDE
-| CONTROL_FLOWTILDECONTROL_FLOW
-// Original: | RIGHT_ARROW
-// Original: | PUNCTUATION_OPERATOR
-| CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-// Original: | LEFT_ARROW_TILDE
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | TILDE_RIGHT_ARROW
-| CONTROL_FLOWTILDE_RIGHT_ARROWCONTROL_FLOW
-// Original: | LEFT_MINUS_RIGHT
-| CONTROL_FLOWLEFT_MINUS_RIGHTCONTROL_FLOW
-// Original: | MINUS_SIGN
-| CONTROL_FLOWMINUS_SIGNCONTROL_FLOW
-;
-
-// Original: parenthesizedPathPatternExpression
-CONTROL_FLOWparenthesizedPathPatternExpressionCONTROL_FLOW
-// Original: : LEFT_PAREN subpathVariableDeclaration? pathModePrefix? pathPatternExpression parenthesizedPathPatternWhereClause? RIGHT_PAREN
-// Original: : LEFT_PAREN subpathVariableDeclaration? pathModePrefix? pathPatternExpression parenthesizedPathPatternWhereClause? PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsubpathVariableDeclarationCONTROL_FLOW? CONTROL_FLOWpathModePrefixCONTROL_FLOW? CONTROL_FLOWpathPatternExpressionCONTROL_FLOW CONTROL_FLOWparenthesizedPathPatternWhereClauseCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: subpathVariableDeclaration
-CONTROL_FLOWsubpathVariableDeclarationCONTROL_FLOW
-// Original: : subpathVariable EQUALS_OPERATOR
-: CONTROL_FLOWsubpathVariableCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW
-;
-
-// Original: parenthesizedPathPatternWhereClause
-CONTROL_FLOWparenthesizedPathPatternWhereClauseCONTROL_FLOW
-// Original: : WHERE searchCondition
-// Original: : KEYWORD searchCondition
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
-;
-
-// 16.8 <label expression>
-
-// Original: labelExpression
-CONTROL_FLOWlabelExpressionCONTROL_FLOW
-// Original: : EXCLAMATION_MARK labelExpression                  #labelExpressionNegation
-: CONTROL_FLOWEXCLAMATION_MARKCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW                  #CONTROL_FLOWlabelExpressionNegationCONTROL_FLOW
-// Original: | labelExpression AMPERSAND labelExpression         #labelExpressionConjunction
-| CONTROL_FLOWlabelExpressionCONTROL_FLOW CONTROL_FLOWAMPERSANDCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW         #CONTROL_FLOWlabelExpressionConjunctionCONTROL_FLOW
-// Original: | labelExpression VERTICAL_BAR labelExpression      #labelExpressionDisjunction
-| CONTROL_FLOWlabelExpressionCONTROL_FLOW CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW      #CONTROL_FLOWlabelExpressionDisjunctionCONTROL_FLOW
-// Original: | labelName                                         #labelExpressionName
-| CONTROL_FLOWlabelNameCONTROL_FLOW                                         #CONTROL_FLOWlabelExpressionNameCONTROL_FLOW
-// Original: | PERCENT                                           #labelExpressionWildcard
-| CONTROL_FLOWPERCENTCONTROL_FLOW                                           #CONTROL_FLOWlabelExpressionWildcardCONTROL_FLOW
-// Original: | LEFT_PAREN labelExpression RIGHT_PAREN            #labelExpressionParenthesized
-// Original: | LEFT_PAREN labelExpression PUNCTUATION_OPERATOR            #labelExpressionParenthesized
-| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW            #CONTROL_FLOWlabelExpressionParenthesizedCONTROL_FLOW
-;
-
-// 16.9 <path variable reference>
-
-// Original: pathVariableReference
-CONTROL_FLOWpathVariableReferenceCONTROL_FLOW
-// Original: : bindingVariableReference
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
-;
-
-// 16.10 <element variable reference>
-
-// Original: elementVariableReference
-CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
-// Original: : bindingVariableReference
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
-;
-
-// 16.11 <graph pattern quantifier>
-
-// Original: graphPatternQuantifier
-CONTROL_FLOWgraphPatternQuantifierCONTROL_FLOW
-// Original: : ASTERISK
-: CONTROL_FLOWASTERISKCONTROL_FLOW
-// Original: | PLUS_SIGN
-| CONTROL_FLOWPLUS_SIGNCONTROL_FLOW
-// Original: | fixedQuantifier
-| CONTROL_FLOWfixedQuantifierCONTROL_FLOW
-// Original: | generalQuantifier
-| CONTROL_FLOWgeneralQuantifierCONTROL_FLOW
-;
-
-// Original: fixedQuantifier
-CONTROL_FLOWfixedQuantifierCONTROL_FLOW
-// Original: : LEFT_BRACE unsignedInteger RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWunsignedIntegerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: generalQuantifier
-CONTROL_FLOWgeneralQuantifierCONTROL_FLOW
-// Original: : LEFT_BRACE lowerBound? COMMA upperBound? RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWlowerBoundCONTROL_FLOW? CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWupperBoundCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: lowerBound
-CONTROL_FLOWlowerBoundCONTROL_FLOW
-// Original: : unsignedInteger
-: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-;
-
-// Original: upperBound
-CONTROL_FLOWupperBoundCONTROL_FLOW
-// Original: : unsignedInteger
-: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-;
-
-// 16.12 <simplified path pattern expression>
-
-// Original: simplifiedPathPatternExpression
-CONTROL_FLOWsimplifiedPathPatternExpressionCONTROL_FLOW
-// Original: : simplifiedDefaultingLeft
-: CONTROL_FLOWsimplifiedDefaultingLeftCONTROL_FLOW
-// Original: | simplifiedDefaultingUndirected
-| CONTROL_FLOWsimplifiedDefaultingUndirectedCONTROL_FLOW
-// Original: | simplifiedDefaultingRight
-| CONTROL_FLOWsimplifiedDefaultingRightCONTROL_FLOW
-// Original: | simplifiedDefaultingLeftOrUndirected
-| CONTROL_FLOWsimplifiedDefaultingLeftOrUndirectedCONTROL_FLOW
-// Original: | simplifiedDefaultingUndirectedOrRight
-| CONTROL_FLOWsimplifiedDefaultingUndirectedOrRightCONTROL_FLOW
-// Original: | simplifiedDefaultingLeftOrRight
-| CONTROL_FLOWsimplifiedDefaultingLeftOrRightCONTROL_FLOW
-// Original: | simplifiedDefaultingAnyDirection
-| CONTROL_FLOWsimplifiedDefaultingAnyDirectionCONTROL_FLOW
-;
-
-// Original: simplifiedDefaultingLeft
-CONTROL_FLOWsimplifiedDefaultingLeftCONTROL_FLOW
-// Original: : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS
-: CONTROL_FLOWLEFT_MINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUSCONTROL_FLOW
-;
-
-// Original: simplifiedDefaultingUndirected
-CONTROL_FLOWsimplifiedDefaultingUndirectedCONTROL_FLOW
-// Original: : TILDE_SLASH simplifiedContents SLASH_TILDE
-: CONTROL_FLOWTILDE_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_TILDECONTROL_FLOW
-;
-
-// Original: simplifiedDefaultingRight
-CONTROL_FLOWsimplifiedDefaultingRightCONTROL_FLOW
-// Original: : MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
-: CONTROL_FLOWMINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUS_RIGHTCONTROL_FLOW
-;
-
-// Original: simplifiedDefaultingLeftOrUndirected
-CONTROL_FLOWsimplifiedDefaultingLeftOrUndirectedCONTROL_FLOW
-// Original: : LEFT_TILDE_SLASH simplifiedContents SLASH_TILDE
-: CONTROL_FLOWLEFT_TILDE_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_TILDECONTROL_FLOW
-;
-
-// Original: simplifiedDefaultingUndirectedOrRight
-CONTROL_FLOWsimplifiedDefaultingUndirectedOrRightCONTROL_FLOW
-// Original: : TILDE_SLASH simplifiedContents SLASH_TILDE_RIGHT
-: CONTROL_FLOWTILDE_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_TILDE_RIGHTCONTROL_FLOW
-;
-
-// Original: simplifiedDefaultingLeftOrRight
-CONTROL_FLOWsimplifiedDefaultingLeftOrRightCONTROL_FLOW
-// Original: : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
-: CONTROL_FLOWLEFT_MINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUS_RIGHTCONTROL_FLOW
-;
-
-// Original: simplifiedDefaultingAnyDirection
-CONTROL_FLOWsimplifiedDefaultingAnyDirectionCONTROL_FLOW
-// Original: : MINUS_SLASH simplifiedContents SLASH_MINUS
-: CONTROL_FLOWMINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUSCONTROL_FLOW
-;
-
-// Original: simplifiedContents
-CONTROL_FLOWsimplifiedContentsCONTROL_FLOW
-// Original: : simplifiedTerm
-: CONTROL_FLOWsimplifiedTermCONTROL_FLOW
-// Original: | simplifiedPathUnion
-| CONTROL_FLOWsimplifiedPathUnionCONTROL_FLOW
-// Original: | simplifiedMultisetAlternation
-| CONTROL_FLOWsimplifiedMultisetAlternationCONTROL_FLOW
-;
-
-// Original: simplifiedPathUnion
-CONTROL_FLOWsimplifiedPathUnionCONTROL_FLOW
-// Original: : simplifiedTerm VERTICAL_BAR simplifiedTerm (VERTICAL_BAR simplifiedTerm)*
-: simplifiedTerm PUNCTUATION_OPERATOR simplifiedTerm (PUNCTUATION_OPERATOR simplifiedTerm)*
-;
-
-// Original: simplifiedMultisetAlternation
-CONTROL_FLOWsimplifiedMultisetAlternationCONTROL_FLOW
-: simplifiedTerm MULTISET_ALTERNATION_OPERATOR simplifiedTerm (MULTISET_ALTERNATION_OPERATOR simplifiedTerm)*
-;
-
-// Original: simplifiedTerm
-CONTROL_FLOWsimplifiedTermCONTROL_FLOW
-// Original: : simplifiedFactorLow                        #simplifiedFactorLowLabel
-: CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW                        #CONTROL_FLOWsimplifiedFactorLowLabelCONTROL_FLOW
-// Original: | simplifiedTerm simplifiedFactorLow      #simplifiedConcatenationLabel
-| CONTROL_FLOWsimplifiedTermCONTROL_FLOW CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW      #CONTROL_FLOWsimplifiedConcatenationLabelCONTROL_FLOW
-;
-
-// Original: simplifiedFactorLow
-CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW
-// Original: : simplifiedFactorHigh                                     #simplifiedFactorHighLabel
-: CONTROL_FLOWsimplifiedFactorHighCONTROL_FLOW                                     #CONTROL_FLOWsimplifiedFactorHighLabelCONTROL_FLOW
-// Original: | simplifiedFactorLow AMPERSAND simplifiedFactorHigh #simplifiedConjunctionLabel
-| CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW CONTROL_FLOWAMPERSANDCONTROL_FLOW CONTROL_FLOWsimplifiedFactorHighCONTROL_FLOW #CONTROL_FLOWsimplifiedConjunctionLabelCONTROL_FLOW
-;
-
-// Original: simplifiedFactorHigh
-CONTROL_FLOWsimplifiedFactorHighCONTROL_FLOW
-// Original: : simplifiedTertiary
-: CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW
-// Original: | simplifiedQuantified
-| CONTROL_FLOWsimplifiedQuantifiedCONTROL_FLOW
-// Original: | simplifiedQuestioned
-| CONTROL_FLOWsimplifiedQuestionedCONTROL_FLOW
-;
-
-// Original: simplifiedQuantified
-CONTROL_FLOWsimplifiedQuantifiedCONTROL_FLOW
-// Original: : simplifiedTertiary graphPatternQuantifier
-: CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW CONTROL_FLOWgraphPatternQuantifierCONTROL_FLOW
-;
-
-// Original: simplifiedQuestioned
-CONTROL_FLOWsimplifiedQuestionedCONTROL_FLOW
-// Original: : simplifiedTertiary QUESTION_MARK
-: CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW CONTROL_FLOWQUESTION_MARKCONTROL_FLOW
-;
-
-// Original: simplifiedTertiary
-CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW
-// Original: : simplifiedDirectionOverride
-: CONTROL_FLOWsimplifiedDirectionOverrideCONTROL_FLOW
-// Original: | simplifiedSecondary
-| CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
-;
-
-// Original: simplifiedDirectionOverride
-CONTROL_FLOWsimplifiedDirectionOverrideCONTROL_FLOW
-// Original: : simplifiedOverrideLeft
-: CONTROL_FLOWsimplifiedOverrideLeftCONTROL_FLOW
-// Original: | simplifiedOverrideUndirected
-| CONTROL_FLOWsimplifiedOverrideUndirectedCONTROL_FLOW
-// Original: | simplifiedOverrideRight
-| CONTROL_FLOWsimplifiedOverrideRightCONTROL_FLOW
-// Original: | simplifiedOverrideLeftOrUndirected
-| CONTROL_FLOWsimplifiedOverrideLeftOrUndirectedCONTROL_FLOW
-// Original: | simplifiedOverrideUndirectedOrRight
-| CONTROL_FLOWsimplifiedOverrideUndirectedOrRightCONTROL_FLOW
-// Original: | simplifiedOverrideLeftOrRight
-| CONTROL_FLOWsimplifiedOverrideLeftOrRightCONTROL_FLOW
-// Original: | simplifiedOverrideAnyDirection
-| CONTROL_FLOWsimplifiedOverrideAnyDirectionCONTROL_FLOW
-;
-
-// Original: simplifiedOverrideLeft
-CONTROL_FLOWsimplifiedOverrideLeftCONTROL_FLOW
-// Original: : LEFT_ANGLE_BRACKET simplifiedSecondary
-// Original: : PUNCTUATION_OPERATOR simplifiedSecondary
-: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
-;
-
-// Original: simplifiedOverrideUndirected
-CONTROL_FLOWsimplifiedOverrideUndirectedCONTROL_FLOW
-// Original: : TILDE simplifiedSecondary
-: CONTROL_FLOWTILDECONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
-;
-
-// Original: simplifiedOverrideRight
-CONTROL_FLOWsimplifiedOverrideRightCONTROL_FLOW
-// Original: : simplifiedSecondary RIGHT_ANGLE_BRACKET
-: CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
-;
-
-// Original: simplifiedOverrideLeftOrUndirected
-CONTROL_FLOWsimplifiedOverrideLeftOrUndirectedCONTROL_FLOW
-// Original: : LEFT_ARROW_TILDE simplifiedSecondary
-// Original: : KEYWORD simplifiedSecondary
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
-;
-
-// Original: simplifiedOverrideUndirectedOrRight
-CONTROL_FLOWsimplifiedOverrideUndirectedOrRightCONTROL_FLOW
-// Original: : TILDE simplifiedSecondary RIGHT_ANGLE_BRACKET
-: CONTROL_FLOWTILDECONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
-;
-
-// Original: simplifiedOverrideLeftOrRight
-CONTROL_FLOWsimplifiedOverrideLeftOrRightCONTROL_FLOW
-// Original: : LEFT_ANGLE_BRACKET simplifiedSecondary RIGHT_ANGLE_BRACKET
-// Original: : PUNCTUATION_OPERATOR simplifiedSecondary RIGHT_ANGLE_BRACKET
-: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
-;
-
-// Original: simplifiedOverrideAnyDirection
-CONTROL_FLOWsimplifiedOverrideAnyDirectionCONTROL_FLOW
-// Original: : MINUS_SIGN simplifiedSecondary
-: CONTROL_FLOWMINUS_SIGNCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
-;
-
-// Original: simplifiedSecondary
-CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
-// Original: : simplifiedPrimary
-: CONTROL_FLOWsimplifiedPrimaryCONTROL_FLOW
-// Original: | simplifiedNegation
-| CONTROL_FLOWsimplifiedNegationCONTROL_FLOW
-;
-
-// Original: simplifiedNegation
-CONTROL_FLOWsimplifiedNegationCONTROL_FLOW
-// Original: : EXCLAMATION_MARK simplifiedPrimary
-: CONTROL_FLOWEXCLAMATION_MARKCONTROL_FLOW CONTROL_FLOWsimplifiedPrimaryCONTROL_FLOW
-;
-
-// Original: simplifiedPrimary
-CONTROL_FLOWsimplifiedPrimaryCONTROL_FLOW
-// Original: : labelName
-: CONTROL_FLOWlabelNameCONTROL_FLOW
-// Original: | LEFT_PAREN simplifiedContents RIGHT_PAREN
-// Original: | LEFT_PAREN simplifiedContents PUNCTUATION_OPERATOR
-| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 16.13 <where clause>
-
-// Original: whereClause
-CONTROL_FLOWwhereClauseCONTROL_FLOW
-// Original: : WHERE searchCondition
-// Original: : KEYWORD searchCondition
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
-;
-
-// 16.14 <yield clause>
-
-// Original: yieldClause
-CONTROL_FLOWyieldClauseCONTROL_FLOW
-// Original: : YIELD yieldItemList
-// Original: : KEYWORD yieldItemList
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWyieldItemListCONTROL_FLOW
-;
-
-// Original: yieldItemList
-CONTROL_FLOWyieldItemListCONTROL_FLOW
-// Original: : yieldItem (COMMA yieldItem)*
-: yieldItem (PUNCTUATION_OPERATOR yieldItem)*
-;
-
-// Original: yieldItem
-CONTROL_FLOWyieldItemCONTROL_FLOW
-: (yieldItemName yieldItemAlias?)
-;
-
-// Original: yieldItemName
-CONTROL_FLOWyieldItemNameCONTROL_FLOW
-// Original: : fieldName
-: CONTROL_FLOWfieldNameCONTROL_FLOW
-;
-
-// Original: yieldItemAlias
-CONTROL_FLOWyieldItemAliasCONTROL_FLOW
-// Original: : AS bindingVariable
-// Original: : KEYWORD bindingVariable
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW
-;
-
-// 16.15 <group by clasue>
-
-// Original: groupByClause
-CONTROL_FLOWgroupByClauseCONTROL_FLOW
-// Original: : GROUP BY groupingElementList
-// Original: : KEYWORD BY groupingElementList
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWBYCONTROL_FLOW CONTROL_FLOWgroupingElementListCONTROL_FLOW
-;
-
-// Original: groupingElementList
-CONTROL_FLOWgroupingElementListCONTROL_FLOW
-// Original: : groupingElement (COMMA groupingElement)*
-: groupingElement (PUNCTUATION_OPERATOR groupingElement)*
-// Original: | emptyGroupingSet
-| CONTROL_FLOWemptyGroupingSetCONTROL_FLOW
-;
-
-// Original: groupingElement
-CONTROL_FLOWgroupingElementCONTROL_FLOW
-// Original: : bindingVariableReference
-: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
-;
-
-// Original: emptyGroupingSet
-CONTROL_FLOWemptyGroupingSetCONTROL_FLOW
-// Original: : LEFT_PAREN RIGHT_PAREN
-// Original: : LEFT_PAREN PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 16.16 <order by clasue>
-
-// Original: orderByClause
-CONTROL_FLOWorderByClauseCONTROL_FLOW
-// Original: : ORDER BY sortSpecificationList
-: CONTROL_FLOWORDERCONTROL_FLOW CONTROL_FLOWBYCONTROL_FLOW CONTROL_FLOWsortSpecificationListCONTROL_FLOW
-;
-
-// 16.17 <sort specification list>
-
-// Original: sortSpecificationList
-CONTROL_FLOWsortSpecificationListCONTROL_FLOW
-// Original: : sortSpecification (COMMA sortSpecification)*
-: sortSpecification (PUNCTUATION_OPERATOR sortSpecification)*
-;
-
-// Original: sortSpecification
-CONTROL_FLOWsortSpecificationCONTROL_FLOW
-: sortKey orderingSpecification? nullOrdering?
-;
-
-// Original: sortKey
-CONTROL_FLOWsortKeyCONTROL_FLOW
-// Original: : aggregatingValueExpression
-: CONTROL_FLOWaggregatingValueExpressionCONTROL_FLOW
-;
-
-// Original: orderingSpecification
-CONTROL_FLOWorderingSpecificationCONTROL_FLOW
-// Original: : ASC
-// Original: : KEYWORD
-: CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | ASCENDING
-| CONTROL_FLOWASCENDINGCONTROL_FLOW
-// Original: | DESC
-| CONTROL_FLOWDESCCONTROL_FLOW
-// Original: | DESCENDING
-| CONTROL_FLOWDESCENDINGCONTROL_FLOW
-;
-
-// Original: nullOrdering
-CONTROL_FLOWnullOrderingCONTROL_FLOW
-// Original: : NULLS FIRST
-: CONTROL_FLOWNULLSCONTROL_FLOW CONTROL_FLOWFIRSTCONTROL_FLOW
-// Original: | NULLS LAST
-| CONTROL_FLOWNULLSCONTROL_FLOW CONTROL_FLOWLASTCONTROL_FLOW
-;
-
-// 16.18 <limit clause>
-
-// Original: limitClause
-CONTROL_FLOWlimitClauseCONTROL_FLOW
-// Original: : LIMIT nonNegativeIntegerSpecification
-: CONTROL_FLOWLIMITCONTROL_FLOW CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
-;
-
-// 16.19 <offset clause>
-
-// Original: offsetClause
-CONTROL_FLOWoffsetClauseCONTROL_FLOW
-// Original: : offsetSynonym nonNegativeIntegerSpecification
-: CONTROL_FLOWoffsetSynonymCONTROL_FLOW CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
-;
-
-// Original: offsetSynonym
-CONTROL_FLOWoffsetSynonymCONTROL_FLOW
-// Original: : OFFSET
-: CONTROL_FLOWOFFSETCONTROL_FLOW
-// Original: | SKIP_RESERVED_WORD
-| CONTROL_FLOWSKIP_RESERVED_WORDCONTROL_FLOW
-;
-
-// 17.1 <schema reference> and <catalog schema parent name>
-
-// Original: schemaReference
-CONTROL_FLOWschemaReferenceCONTROL_FLOW
-// Original: : absoluteCatalogSchemaReference
-: CONTROL_FLOWabsoluteCatalogSchemaReferenceCONTROL_FLOW
-// Original: | relativeCatalogSchemaReference
-| CONTROL_FLOWrelativeCatalogSchemaReferenceCONTROL_FLOW
-// Original: | referenceParameterSpecification
-| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
-;
-
-// Original: absoluteCatalogSchemaReference
-CONTROL_FLOWabsoluteCatalogSchemaReferenceCONTROL_FLOW
-// Original: : SOLIDUS
-: CONTROL_FLOWSOLIDUSCONTROL_FLOW
-// Original: | absoluteDirectoryPath schemaName
-| CONTROL_FLOWabsoluteDirectoryPathCONTROL_FLOW CONTROL_FLOWschemaNameCONTROL_FLOW
-;
-
-// Original: catalogSchemaParentAndName
-CONTROL_FLOWcatalogSchemaParentAndNameCONTROL_FLOW
-// Original: : absoluteDirectoryPath schemaName
-: CONTROL_FLOWabsoluteDirectoryPathCONTROL_FLOW CONTROL_FLOWschemaNameCONTROL_FLOW
-;
-
-// Original: relativeCatalogSchemaReference
-CONTROL_FLOWrelativeCatalogSchemaReferenceCONTROL_FLOW
-// Original: : predefinedSchemaReference
-: CONTROL_FLOWpredefinedSchemaReferenceCONTROL_FLOW
-// Original: | relativeDirectoryPath schemaName
-| CONTROL_FLOWrelativeDirectoryPathCONTROL_FLOW CONTROL_FLOWschemaNameCONTROL_FLOW
-;
-
-// Original: predefinedSchemaReference
-CONTROL_FLOWpredefinedSchemaReferenceCONTROL_FLOW
-// Original: : HOME_SCHEMA
-: CONTROL_FLOWHOME_SCHEMACONTROL_FLOW
-// Original: | CURRENT_SCHEMA
-| CONTROL_FLOWCURRENT_SCHEMACONTROL_FLOW
-// Original: | PERIOD
-| CONTROL_FLOWPERIODCONTROL_FLOW
-;
-
-// Original: absoluteDirectoryPath
-CONTROL_FLOWabsoluteDirectoryPathCONTROL_FLOW
-// Original: : SOLIDUS simpleDirectoryPath?
-: PUNCTUATION_OPERATOR simpleDirectoryPath?
-;
-
-// Original: relativeDirectoryPath
-CONTROL_FLOWrelativeDirectoryPathCONTROL_FLOW
-// Original: : DOUBLE_PERIOD (SOLIDUS DOUBLE_PERIOD)* SOLIDUS simpleDirectoryPath?
-// Original: : PUNCTUATION_OPERATOR (SOLIDUS PUNCTUATION_OPERATOR)* SOLIDUS simpleDirectoryPath?
-: PUNCTUATION_OPERATOR (PUNCTUATION_OPERATOR PUNCTUATION_OPERATOR)* PUNCTUATION_OPERATOR simpleDirectoryPath?
-;
-
-// Original: simpleDirectoryPath
-CONTROL_FLOWsimpleDirectoryPathCONTROL_FLOW
-// Original: : (directoryName SOLIDUS)+
-: (directoryName PUNCTUATION_OPERATOR)+
-;
-
-// 17.2 <graph reference> and <catalog graph parent and name>
-
-// Original: graphReference
-CONTROL_FLOWgraphReferenceCONTROL_FLOW
-// Original: : catalogObjectParentReference graphName
-: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW CONTROL_FLOWgraphNameCONTROL_FLOW
-// Original: | delimitedGraphName
-| CONTROL_FLOWdelimitedGraphNameCONTROL_FLOW
-// Original: | homeGraph
-| CONTROL_FLOWhomeGraphCONTROL_FLOW
-// Original: | referenceParameterSpecification
-| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
-;
-
-// Original: catalogGraphParentAndName
-CONTROL_FLOWcatalogGraphParentAndNameCONTROL_FLOW
-// Original: : catalogObjectParentReference? graphName
-: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW? CONTROL_FLOWgraphNameCONTROL_FLOW
-;
-
-// Original: homeGraph
-CONTROL_FLOWhomeGraphCONTROL_FLOW
-// Original: : HOME_PROPERTY_GRAPH
-: CONTROL_FLOWHOME_PROPERTY_GRAPHCONTROL_FLOW
-// Original: | HOME_GRAPH
-| CONTROL_FLOWHOME_GRAPHCONTROL_FLOW
-;
-
-// 17.3 <graph type reference> and <catalog graph type parent and name>
-
-// Original: graphTypeReference
-CONTROL_FLOWgraphTypeReferenceCONTROL_FLOW
-// Original: : catalogGraphTypeParentAndName
-: CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW
-// Original: | referenceParameterSpecification
-| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
-;
-
-// Original: catalogGraphTypeParentAndName
-CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW
-// Original: : catalogObjectParentReference? graphTypeName
-: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW? CONTROL_FLOWgraphTypeNameCONTROL_FLOW
-;
-
-// 17.4 <binding table reference> and <catalog binding table parent name>
-
-// Original: bindingTableReference
-CONTROL_FLOWbindingTableReferenceCONTROL_FLOW
-// Original: : catalogObjectParentReference bindingTableName
-: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW CONTROL_FLOWbindingTableNameCONTROL_FLOW
-// Original: | delimitedBindingTableName
-| CONTROL_FLOWdelimitedBindingTableNameCONTROL_FLOW
-// Original: | referenceParameterSpecification
-| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
-;
-
-// 17.5 <procedure reference> and <catalog procedure parent and name>
-
-// Original: procedureReference
-CONTROL_FLOWprocedureReferenceCONTROL_FLOW
-// Original: : catalogProcedureParentAndName
-: CONTROL_FLOWcatalogProcedureParentAndNameCONTROL_FLOW
-// Original: | referenceParameterSpecification
-| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
-;
-
-// Original: catalogProcedureParentAndName
-CONTROL_FLOWcatalogProcedureParentAndNameCONTROL_FLOW
-// Original: : catalogObjectParentReference? procedureName
-: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW? CONTROL_FLOWprocedureNameCONTROL_FLOW
-;
-
-// 17.6 <catalog object parent reference>
-
-// Original: catalogObjectParentReference
-CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW
-// Original: : schemaReference SOLIDUS? (objectName PERIOD)*
-// Original: : schemaReference PUNCTUATION_OPERATOR? (objectName PERIOD)*
-: schemaReference PUNCTUATION_OPERATOR? (objectName PUNCTUATION_OPERATOR)*
-// Original: |  (objectName PERIOD)+
-|  (objectName PUNCTUATION_OPERATOR)+
-;
-
-// 17.7 <reference parameter specification>
-
-// Original: referenceParameterSpecification
-CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
-// Original: : SUBSTITUTED_PARAMETER_REFERENCE
-: CONTROL_FLOWSUBSTITUTED_PARAMETER_REFERENCECONTROL_FLOW
-;
-
-// 18.1 <nested graph type specification>
-
-// Original: nestedGraphTypeSpecification
-CONTROL_FLOWnestedGraphTypeSpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE graphTypeSpecificationBody RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWgraphTypeSpecificationBodyCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: graphTypeSpecificationBody
-CONTROL_FLOWgraphTypeSpecificationBodyCONTROL_FLOW
-// Original: : elementTypeList
-: CONTROL_FLOWelementTypeListCONTROL_FLOW
-;
-
-// Original: elementTypeList
-CONTROL_FLOWelementTypeListCONTROL_FLOW
-// Original: : elementTypeSpecification (COMMA elementTypeSpecification)*
-: elementTypeSpecification (PUNCTUATION_OPERATOR elementTypeSpecification)*
-;
-
-// Original: elementTypeSpecification
-CONTROL_FLOWelementTypeSpecificationCONTROL_FLOW
-// Original: : nodeTypeSpecification
-: CONTROL_FLOWnodeTypeSpecificationCONTROL_FLOW
-// Original: | edgeTypeSpecification
-| CONTROL_FLOWedgeTypeSpecificationCONTROL_FLOW
-;
-
-// 18.2 <node type specification>
-
-// Original: nodeTypeSpecification
-CONTROL_FLOWnodeTypeSpecificationCONTROL_FLOW
-// Original: : nodeTypePattern
-: CONTROL_FLOWnodeTypePatternCONTROL_FLOW
-// Original: | nodeTypePhrase
-| CONTROL_FLOWnodeTypePhraseCONTROL_FLOW
-;
-
-// Original: nodeTypePattern
-CONTROL_FLOWnodeTypePatternCONTROL_FLOW
-// Original: : (nodeSynonym TYPE? nodeTypeName)? LEFT_PAREN localNodeTypeAlias? nodeTypeFiller? RIGHT_PAREN
-// Original: : (nodeSynonym TYPE? nodeTypeName)? LEFT_PAREN localNodeTypeAlias? nodeTypeFiller? PUNCTUATION_OPERATOR
-: (CONTROL_FLOWnodeSynonymCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW? CONTROL_FLOWnodeTypeNameCONTROL_FLOW)? CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlocalNodeTypeAliasCONTROL_FLOW? CONTROL_FLOWnodeTypeFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: nodeTypePhrase
-CONTROL_FLOWnodeTypePhraseCONTROL_FLOW
-// Original: : nodeSynonym TYPE? nodeTypePhraseFiller (AS localNodeTypeAlias)?
-: nodeSynonym TYPE? nodeTypePhraseFiller (KEYWORD localNodeTypeAlias)?
-;
-
-// Original: nodeTypePhraseFiller
-CONTROL_FLOWnodeTypePhraseFillerCONTROL_FLOW
-: nodeTypeName nodeTypeFiller?
-// Original: | nodeTypeFiller
-| CONTROL_FLOWnodeTypeFillerCONTROL_FLOW
-;
-
-// Original: nodeTypeFiller
-CONTROL_FLOWnodeTypeFillerCONTROL_FLOW
-: nodeTypeKeyLabelSet nodeTypeImpliedContent?
-// Original: | nodeTypeImpliedContent
-| CONTROL_FLOWnodeTypeImpliedContentCONTROL_FLOW
-;
-
-// Original: localNodeTypeAlias
-CONTROL_FLOWlocalNodeTypeAliasCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-;
-
-// Original: nodeTypeImpliedContent
-CONTROL_FLOWnodeTypeImpliedContentCONTROL_FLOW
-// Original: : nodeTypeLabelSet
-: CONTROL_FLOWnodeTypeLabelSetCONTROL_FLOW
-// Original: | nodeTypePropertyTypes
-| CONTROL_FLOWnodeTypePropertyTypesCONTROL_FLOW
-// Original: | nodeTypeLabelSet nodeTypePropertyTypes
-| CONTROL_FLOWnodeTypeLabelSetCONTROL_FLOW CONTROL_FLOWnodeTypePropertyTypesCONTROL_FLOW
-;
-
-// Original: nodeTypeKeyLabelSet
-CONTROL_FLOWnodeTypeKeyLabelSetCONTROL_FLOW
-// Original: : labelSetPhrase? IMPLIES
-: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW? CONTROL_FLOWIMPLIESCONTROL_FLOW
-;
-
-// Original: nodeTypeLabelSet
-CONTROL_FLOWnodeTypeLabelSetCONTROL_FLOW
-// Original: : labelSetPhrase
-: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW
-;
-
-// Original: nodeTypePropertyTypes
-CONTROL_FLOWnodeTypePropertyTypesCONTROL_FLOW
-// Original: : propertyTypesSpecification
-: CONTROL_FLOWpropertyTypesSpecificationCONTROL_FLOW
-;
-
-// 18.3 <edge type specification>
-
-// Original: edgeTypeSpecification
-CONTROL_FLOWedgeTypeSpecificationCONTROL_FLOW
-// Original: : edgeTypePattern
-: CONTROL_FLOWedgeTypePatternCONTROL_FLOW
-// Original: | edgeTypePhrase
-| CONTROL_FLOWedgeTypePhraseCONTROL_FLOW
-;
-
-// Original: edgeTypePattern
-CONTROL_FLOWedgeTypePatternCONTROL_FLOW
-: (edgeKind? edgeSynonym TYPE? edgeTypeName)? (edgeTypePatternDirected | edgeTypePatternUndirected)
-;
-
-// Original: edgeTypePhrase
-CONTROL_FLOWedgeTypePhraseCONTROL_FLOW
-// Original: : edgeKind edgeSynonym TYPE? edgeTypePhraseFiller endpointPairPhrase
-: CONTROL_FLOWedgeKindCONTROL_FLOW CONTROL_FLOWedgeSynonymCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW? CONTROL_FLOWedgeTypePhraseFillerCONTROL_FLOW CONTROL_FLOWendpointPairPhraseCONTROL_FLOW
-;
-
-// Original: edgeTypePhraseFiller
-CONTROL_FLOWedgeTypePhraseFillerCONTROL_FLOW
-: edgeTypeName edgeTypeFiller?
-// Original: | edgeTypeFiller
-| CONTROL_FLOWedgeTypeFillerCONTROL_FLOW
-;
-
-// Original: edgeTypeFiller
-CONTROL_FLOWedgeTypeFillerCONTROL_FLOW
-: edgeTypeKeyLabelSet edgeTypeImpliedContent?
-// Original: | edgeTypeImpliedContent
-| CONTROL_FLOWedgeTypeImpliedContentCONTROL_FLOW
-;
-
-// Original: edgeTypeImpliedContent
-CONTROL_FLOWedgeTypeImpliedContentCONTROL_FLOW
-// Original: : edgeTypeLabelSet
-: CONTROL_FLOWedgeTypeLabelSetCONTROL_FLOW
-// Original: | edgeTypePropertyTypes
-| CONTROL_FLOWedgeTypePropertyTypesCONTROL_FLOW
-// Original: | edgeTypeLabelSet edgeTypePropertyTypes
-| CONTROL_FLOWedgeTypeLabelSetCONTROL_FLOW CONTROL_FLOWedgeTypePropertyTypesCONTROL_FLOW
-;
-
-// Original: edgeTypeKeyLabelSet
-CONTROL_FLOWedgeTypeKeyLabelSetCONTROL_FLOW
-// Original: : labelSetPhrase? IMPLIES
-: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW? CONTROL_FLOWIMPLIESCONTROL_FLOW
-;
-
-// Original: edgeTypeLabelSet
-CONTROL_FLOWedgeTypeLabelSetCONTROL_FLOW
-// Original: : labelSetPhrase
-: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW
-;
-
-// Original: edgeTypePropertyTypes
-CONTROL_FLOWedgeTypePropertyTypesCONTROL_FLOW
-// Original: : propertyTypesSpecification
-: CONTROL_FLOWpropertyTypesSpecificationCONTROL_FLOW
-;
-
-// Original: edgeTypePatternDirected
-CONTROL_FLOWedgeTypePatternDirectedCONTROL_FLOW
-// Original: : edgeTypePatternPointingRight
-: CONTROL_FLOWedgeTypePatternPointingRightCONTROL_FLOW
-// Original: | edgeTypePatternPointingLeft
-| CONTROL_FLOWedgeTypePatternPointingLeftCONTROL_FLOW
-;
-
-// Original: edgeTypePatternPointingRight
-CONTROL_FLOWedgeTypePatternPointingRightCONTROL_FLOW
-// Original: : sourceNodeTypeReference arcTypePointingRight destinationNodeTypeReference
-: CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW CONTROL_FLOWarcTypePointingRightCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW
-;
-
-// Original: edgeTypePatternPointingLeft
-CONTROL_FLOWedgeTypePatternPointingLeftCONTROL_FLOW
-// Original: : destinationNodeTypeReference arcTypePointingLeft sourceNodeTypeReference
-: CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW CONTROL_FLOWarcTypePointingLeftCONTROL_FLOW CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW
-;
-
-// Original: edgeTypePatternUndirected
-CONTROL_FLOWedgeTypePatternUndirectedCONTROL_FLOW
-// Original: : sourceNodeTypeReference arcTypeUndirected destinationNodeTypeReference
-: CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW CONTROL_FLOWarcTypeUndirectedCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW
-;
-
-// Original: arcTypePointingRight
-CONTROL_FLOWarcTypePointingRightCONTROL_FLOW
-// Original: : MINUS_LEFT_BRACKET edgeTypeFiller BRACKET_RIGHT_ARROW
-// Original: : MINUS_LEFT_BRACKET edgeTypeFiller PUNCTUATION_OPERATOR
-: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWedgeTypeFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: arcTypePointingLeft
-CONTROL_FLOWarcTypePointingLeftCONTROL_FLOW
-// Original: : LEFT_ARROW_BRACKET edgeTypeFiller RIGHT_BRACKET_MINUS
-: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWedgeTypeFillerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
-;
-
-// Original: arcTypeUndirected
-CONTROL_FLOWarcTypeUndirectedCONTROL_FLOW
-// Original: : TILDE_LEFT_BRACKET edgeTypeFiller RIGHT_BRACKET_TILDE
-// Original: : TILDE_LEFT_BRACKET edgeTypeFiller PUNCTUATION_OPERATOR
-// Original: : PUNCTUATION_OPERATOR edgeTypeFiller PUNCTUATION_OPERATOR
-: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWedgeTypeFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: sourceNodeTypeReference
-CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW
-// Original: : LEFT_PAREN sourceNodeTypeAlias RIGHT_PAREN
-// Original: : LEFT_PAREN sourceNodeTypeAlias PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-// Original: | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
-// Original: | LEFT_PAREN nodeTypeFiller? PUNCTUATION_OPERATOR
-| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnodeTypeFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: destinationNodeTypeReference
-CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW
-// Original: : LEFT_PAREN destinationNodeTypeAlias RIGHT_PAREN
-// Original: : LEFT_PAREN destinationNodeTypeAlias PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-// Original: | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
-// Original: | LEFT_PAREN nodeTypeFiller? PUNCTUATION_OPERATOR
-| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnodeTypeFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: edgeKind
-CONTROL_FLOWedgeKindCONTROL_FLOW
-// Original: : DIRECTED
-: CONTROL_FLOWDIRECTEDCONTROL_FLOW
-// Original: | UNDIRECTED
-| CONTROL_FLOWUNDIRECTEDCONTROL_FLOW
-;
-
-// Original: endpointPairPhrase
-CONTROL_FLOWendpointPairPhraseCONTROL_FLOW
-// Original: : CONNECTING endpointPair
-: CONTROL_FLOWCONNECTINGCONTROL_FLOW CONTROL_FLOWendpointPairCONTROL_FLOW
-;
-
-// Original: endpointPair
-CONTROL_FLOWendpointPairCONTROL_FLOW
-// Original: : endpointPairDirected
-: CONTROL_FLOWendpointPairDirectedCONTROL_FLOW
-// Original: | endpointPairUndirected
-| CONTROL_FLOWendpointPairUndirectedCONTROL_FLOW
-;
-
-// Original: endpointPairDirected
-CONTROL_FLOWendpointPairDirectedCONTROL_FLOW
-// Original: : endpointPairPointingRight
-: CONTROL_FLOWendpointPairPointingRightCONTROL_FLOW
-// Original: | endpointPairPointingLeft
-| CONTROL_FLOWendpointPairPointingLeftCONTROL_FLOW
-;
-
-// Original: endpointPairPointingRight
-CONTROL_FLOWendpointPairPointingRightCONTROL_FLOW
-// Original: : LEFT_PAREN sourceNodeTypeAlias connectorPointingRight destinationNodeTypeAlias RIGHT_PAREN
-// Original: : LEFT_PAREN sourceNodeTypeAlias connectorPointingRight destinationNodeTypeAlias PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWconnectorPointingRightCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: endpointPairPointingLeft
-CONTROL_FLOWendpointPairPointingLeftCONTROL_FLOW
-// Original: : LEFT_PAREN destinationNodeTypeAlias LEFT_ARROW sourceNodeTypeAlias RIGHT_PAREN
-// Original: : LEFT_PAREN destinationNodeTypeAlias LEFT_ARROW sourceNodeTypeAlias PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWLEFT_ARROWCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: endpointPairUndirected
-CONTROL_FLOWendpointPairUndirectedCONTROL_FLOW
-// Original: : LEFT_PAREN sourceNodeTypeAlias connectorUndirected destinationNodeTypeAlias RIGHT_PAREN
-// Original: : LEFT_PAREN sourceNodeTypeAlias connectorUndirected destinationNodeTypeAlias PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWconnectorUndirectedCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: connectorPointingRight
-CONTROL_FLOWconnectorPointingRightCONTROL_FLOW
-// Original: : TO
-// Original: : KEYWORD
-: CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | RIGHT_ARROW
-// Original: | PUNCTUATION_OPERATOR
-| CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: connectorUndirected
-CONTROL_FLOWconnectorUndirectedCONTROL_FLOW
-// Original: : TO
-// Original: : KEYWORD
-: CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | TILDE
-| CONTROL_FLOWTILDECONTROL_FLOW
-;
-
-// Original: sourceNodeTypeAlias
-CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-;
-
-// Original: destinationNodeTypeAlias
-CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-;
-
-// 18.4 <label set phrase> and <label set specification>
-
-// Original: labelSetPhrase
-CONTROL_FLOWlabelSetPhraseCONTROL_FLOW
-// Original: : LABEL labelName
-: CONTROL_FLOWLABELCONTROL_FLOW CONTROL_FLOWlabelNameCONTROL_FLOW
-// Original: | LABELS labelSetSpecification
-| CONTROL_FLOWLABELSCONTROL_FLOW CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW
-// Original: | isOrColon labelSetSpecification
-| CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW
-;
-
-// Original: labelSetSpecification
-CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW
-// Original: : labelName (AMPERSAND labelName)*
-: labelName (PUNCTUATION_OPERATOR labelName)*
-;
-
-// 18.5 <property types specification>
-
-// Original: propertyTypesSpecification
-CONTROL_FLOWpropertyTypesSpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE propertyTypeList? RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWpropertyTypeListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: propertyTypeList
-CONTROL_FLOWpropertyTypeListCONTROL_FLOW
-// Original: : propertyType (COMMA propertyType)*
-: propertyType (PUNCTUATION_OPERATOR propertyType)*
-;
-
-// 18.6 <property type>
-
-// Original: propertyType
-CONTROL_FLOWpropertyTypeCONTROL_FLOW
-// Original: : propertyName typed? propertyValueType
-: CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWpropertyValueTypeCONTROL_FLOW
-;
-
-// 18.7 <property value type>
-
-// Original: propertyValueType
-CONTROL_FLOWpropertyValueTypeCONTROL_FLOW
-// Original: : valueType
-: CONTROL_FLOWvalueTypeCONTROL_FLOW
-;
-
-// 18.8 <binding table type>
-
-// Original: bindingTableType
-CONTROL_FLOWbindingTableTypeCONTROL_FLOW
-// Original: : BINDING? TABLE fieldTypesSpecification
-// Original: : KEYWORD? TABLE fieldTypesSpecification
-: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWfieldTypesSpecificationCONTROL_FLOW
-;
-
-// 18.9 <value type>
-
-// Original: valueType
-CONTROL_FLOWvalueTypeCONTROL_FLOW
-// Original: : predefinedType                                                                                                                              #predefinedTypeLabel
-: CONTROL_FLOWpredefinedTypeCONTROL_FLOW                                                                                                                              #CONTROL_FLOWpredefinedTypeLabelCONTROL_FLOW
-// <constructed value type>
-// Original: | pathValueType                                                                                                                               #pathValueTypeLabel
-| CONTROL_FLOWpathValueTypeCONTROL_FLOW                                                                                                                               #CONTROL_FLOWpathValueTypeLabelCONTROL_FLOW
-// Original: | listValueTypeName LEFT_ANGLE_BRACKET valueType RIGHT_ANGLE_BRACKET (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
-// Original: | listValueTypeName PUNCTUATION_OPERATOR valueType RIGHT_ANGLE_BRACKET (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
-// Original: | listValueTypeName PUNCTUATION_OPERATOR valueType RIGHT_ANGLE_BRACKET (PUNCTUATION_OPERATOR maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
-| CONTROL_FLOWlistValueTypeNameCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW (CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWmaxLengthCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW)? CONTROL_FLOWnotNullCONTROL_FLOW?     #CONTROL_FLOWlistValueTypeAlt1CONTROL_FLOW
-// Original: | valueType listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                    #listValueTypeAlt2
-// Original: | valueType listValueTypeName (PUNCTUATION_OPERATOR maxLength RIGHT_BRACKET)? notNull?                                                    #listValueTypeAlt2
-| CONTROL_FLOWvalueTypeCONTROL_FLOW CONTROL_FLOWlistValueTypeNameCONTROL_FLOW (CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWmaxLengthCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW)? CONTROL_FLOWnotNullCONTROL_FLOW?                                                    #CONTROL_FLOWlistValueTypeAlt2CONTROL_FLOW
-// Original: | listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                                #listValueTypeAlt3
-// Original: | listValueTypeName (PUNCTUATION_OPERATOR maxLength RIGHT_BRACKET)? notNull?                                                                #listValueTypeAlt3
-| CONTROL_FLOWlistValueTypeNameCONTROL_FLOW (CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWmaxLengthCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW)? CONTROL_FLOWnotNullCONTROL_FLOW?                                                                #CONTROL_FLOWlistValueTypeAlt3CONTROL_FLOW
-// Original: | recordType                                                                                                                                   #recordTypeLabel
-| CONTROL_FLOWrecordTypeCONTROL_FLOW                                                                                                                                   #CONTROL_FLOWrecordTypeLabelCONTROL_FLOW
-// <dynamic union type>
-// Original: | ANY VALUE? notNull?                                                                                                                        #openDynamicUnionTypeLabel
-| CONTROL_FLOWANYCONTROL_FLOW CONTROL_FLOWVALUECONTROL_FLOW? CONTROL_FLOWnotNullCONTROL_FLOW?                                                                                                                        #CONTROL_FLOWopenDynamicUnionTypeLabelCONTROL_FLOW
-// Original: | ANY? PROPERTY VALUE notNull?                                                                                                             #dynamicPropertyValueTypeLabel
-| CONTROL_FLOWANYCONTROL_FLOW? CONTROL_FLOWPROPERTYCONTROL_FLOW CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWnotNullCONTROL_FLOW?                                                                                                             #CONTROL_FLOWdynamicPropertyValueTypeLabelCONTROL_FLOW
-// <closed dynamic union type>
-// Original: | ANY VALUE? LEFT_ANGLE_BRACKET valueType (VERTICAL_BAR valueType)* RIGHT_ANGLE_BRACKET                                         #closedDynamicUnionTypeAtl1
-// Original: | ANY VALUE? PUNCTUATION_OPERATOR valueType (VERTICAL_BAR valueType)* RIGHT_ANGLE_BRACKET                                         #closedDynamicUnionTypeAtl1
-| CONTROL_FLOWANYCONTROL_FLOW CONTROL_FLOWVALUECONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW (CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW)* CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW                                         #CONTROL_FLOWclosedDynamicUnionTypeAtl1CONTROL_FLOW
-// Original: | valueType VERTICAL_BAR valueType                                                                                                        #closedDynamicUnionTypeAtl2
-| CONTROL_FLOWvalueTypeCONTROL_FLOW CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW                                                                                                        #CONTROL_FLOWclosedDynamicUnionTypeAtl2CONTROL_FLOW
-;
-
-// Original: typed
-CONTROL_FLOWtypedCONTROL_FLOW
-// Original: : DOUBLE_COLON
-: CONTROL_FLOWDOUBLE_COLONCONTROL_FLOW
-// Original: | TYPED
-| CONTROL_FLOWTYPEDCONTROL_FLOW
-;
-
-// Original: predefinedType
-CONTROL_FLOWpredefinedTypeCONTROL_FLOW
-// Original: : booleanType
-: CONTROL_FLOWbooleanTypeCONTROL_FLOW
-// Original: | characterStringType
-| CONTROL_FLOWcharacterStringTypeCONTROL_FLOW
-// Original: | byteStringType
-| CONTROL_FLOWbyteStringTypeCONTROL_FLOW
-// Original: | numericType
-| CONTROL_FLOWnumericTypeCONTROL_FLOW
-// Original: | temporalType
-| CONTROL_FLOWtemporalTypeCONTROL_FLOW
-// Original: | referenceValueType
-| CONTROL_FLOWreferenceValueTypeCONTROL_FLOW
-// Original: | immaterialValueType
-| CONTROL_FLOWimmaterialValueTypeCONTROL_FLOW
-;
-
-// Original: booleanType
-CONTROL_FLOWbooleanTypeCONTROL_FLOW
-// Original: : (BOOL | BOOLEAN) notNull?
-// Original: : (BOOL | DATA_TYPE) notNull?
-: (DATA_TYPE | DATA_TYPE) notNull?
-;
-
-// Original: characterStringType
-CONTROL_FLOWcharacterStringTypeCONTROL_FLOW
-// Original: : STRING (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
-// Original: : STRING (LEFT_PAREN (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
-// Original: : DATA_TYPE (LEFT_PAREN (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
-// Original: : DATA_TYPE (PUNCTUATION_OPERATOR (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
-: DATA_TYPE (PUNCTUATION_OPERATOR (minLength PUNCTUATION_OPERATOR)? maxLength PUNCTUATION_OPERATOR)? notNull?
-// Original: | CHAR (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
-// Original: | CHAR (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
-// Original: | DATA_TYPE (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
-| DATA_TYPE (PUNCTUATION_OPERATOR fixedLength PUNCTUATION_OPERATOR)? notNull?
-// Original: | VARCHAR (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
-// Original: | DATA_TYPE (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
-// Original: | DATA_TYPE (LEFT_PAREN maxLength PUNCTUATION_OPERATOR)? notNull?
-| DATA_TYPE (PUNCTUATION_OPERATOR maxLength PUNCTUATION_OPERATOR)? notNull?
-;
-
-// Original: byteStringType
-CONTROL_FLOWbyteStringTypeCONTROL_FLOW
-// Original: : BYTES (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
-// Original: : BYTES (LEFT_PAREN (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
-// Original: : BYTES (PUNCTUATION_OPERATOR (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
-// Original: : BYTES (PUNCTUATION_OPERATOR (minLength PUNCTUATION_OPERATOR)? maxLength PUNCTUATION_OPERATOR)? notNull?
-: DATA_TYPE (PUNCTUATION_OPERATOR (minLength PUNCTUATION_OPERATOR)? maxLength PUNCTUATION_OPERATOR)? notNull?
-// Original: | BINARY (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
-// Original: | BINARY (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
-// Original: | KEYWORD (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
-| KEYWORD (PUNCTUATION_OPERATOR fixedLength PUNCTUATION_OPERATOR)? notNull?
-// Original: | VARBINARY (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
-// Original: | VARBINARY (LEFT_PAREN maxLength PUNCTUATION_OPERATOR)? notNull?
-// Original: | DATA_TYPE (LEFT_PAREN maxLength PUNCTUATION_OPERATOR)? notNull?
-| DATA_TYPE (PUNCTUATION_OPERATOR maxLength PUNCTUATION_OPERATOR)? notNull?
-;
-
-// Original: minLength
-CONTROL_FLOWminLengthCONTROL_FLOW
-// Original: : unsignedInteger
-: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-;
-
-// Original: maxLength
-CONTROL_FLOWmaxLengthCONTROL_FLOW
-// Original: : unsignedInteger
-: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-;
-
-// Original: fixedLength
-CONTROL_FLOWfixedLengthCONTROL_FLOW
-// Original: : unsignedInteger
-: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-;
-
-// Original: numericType
-CONTROL_FLOWnumericTypeCONTROL_FLOW
-// Original: : exactNumericType
-: CONTROL_FLOWexactNumericTypeCONTROL_FLOW
-// Original: | approximateNumericType
-| CONTROL_FLOWapproximateNumericTypeCONTROL_FLOW
-;
-
-// Original: exactNumericType
-CONTROL_FLOWexactNumericTypeCONTROL_FLOW
-// Original: : binaryExactNumericType
-: CONTROL_FLOWbinaryExactNumericTypeCONTROL_FLOW
-// Original: | decimalExactNumericType
-| CONTROL_FLOWdecimalExactNumericTypeCONTROL_FLOW
-;
-
-// Original: binaryExactNumericType
-CONTROL_FLOWbinaryExactNumericTypeCONTROL_FLOW
-// Original: : signedBinaryExactNumericType
-: CONTROL_FLOWsignedBinaryExactNumericTypeCONTROL_FLOW
-// Original: | unsignedBinaryExactNumericType
-| CONTROL_FLOWunsignedBinaryExactNumericTypeCONTROL_FLOW
-;
-
-// Original: signedBinaryExactNumericType
-CONTROL_FLOWsignedBinaryExactNumericTypeCONTROL_FLOW
-// Original: : INT8 notNull?
-: DATA_TYPE notNull?
-// Original: | INT16 notNull?
-| DATA_TYPE notNull?
-// Original: | INT32 notNull?
-| DATA_TYPE notNull?
-// Original: | INT64 notNull?
-| DATA_TYPE notNull?
-// Original: | INT128 notNull?
-| DATA_TYPE notNull?
-// Original: | INT256 notNull?
-| DATA_TYPE notNull?
-// Original: | SMALLINT notNull?
-| DATA_TYPE notNull?
-// Original: | INT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
-// Original: | INT (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
-// Original: | INT (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
-| DATA_TYPE (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
-// Original: | BIGINT notNull?
-| DATA_TYPE notNull?
-// Original: | SIGNED? verboseBinaryExactNumericType
-| CONTROL_FLOWSIGNEDCONTROL_FLOW? CONTROL_FLOWverboseBinaryExactNumericTypeCONTROL_FLOW
-;
-
-// Original: unsignedBinaryExactNumericType
-CONTROL_FLOWunsignedBinaryExactNumericTypeCONTROL_FLOW
-// Original: : UINT8 notNull?
-: DATA_TYPE notNull?
-// Original: | UINT16 notNull?
-| DATA_TYPE notNull?
-// Original: | UINT32 notNull?
-| DATA_TYPE notNull?
-// Original: | UINT64 notNull?
-| DATA_TYPE notNull?
-// Original: | UINT128 notNull?
-| DATA_TYPE notNull?
-// Original: | UINT256 notNull?
-| DATA_TYPE notNull?
-// Original: | USMALLINT notNull?
-| DATA_TYPE notNull?
-// Original: | UINT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
-// Original: | UINT (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
-// Original: | UINT (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
-| DATA_TYPE (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
-// Original: | UBIGINT notNull?
-| DATA_TYPE notNull?
-// Original: | UNSIGNED verboseBinaryExactNumericType
-| CONTROL_FLOWUNSIGNEDCONTROL_FLOW CONTROL_FLOWverboseBinaryExactNumericTypeCONTROL_FLOW
-;
-
-// Original: verboseBinaryExactNumericType
-CONTROL_FLOWverboseBinaryExactNumericTypeCONTROL_FLOW
-: INTEGER8 notNull?
-| INTEGER16 notNull?
-| INTEGER32 notNull?
-| INTEGER64 notNull?
-| INTEGER128 notNull?
-| INTEGER256 notNull?
-// Original: | SMALL INTEGER notNull?
-| SMALL DATA_TYPE notNull?
-// Original: | INTEGER (LEFT_PAREN precision RIGHT_PAREN)? notNull?
-// Original: | INTEGER (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
-// Original: | DATA_TYPE (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
-| DATA_TYPE (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
-// Original: | BIG INTEGER notNull?
-// Original: | BIG DATA_TYPE notNull?
-| KEYWORD DATA_TYPE notNull?
-;
-
-// Original: decimalExactNumericType
-CONTROL_FLOWdecimalExactNumericTypeCONTROL_FLOW
-// Original: : (DECIMAL | DEC) (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN notNull?)?
-// Original: : (DECIMAL | DEC) (LEFT_PAREN precision (COMMA scale)? PUNCTUATION_OPERATOR notNull?)?
-// Original: : (DECIMAL | DEC) (PUNCTUATION_OPERATOR precision (COMMA scale)? PUNCTUATION_OPERATOR notNull?)?
-// Original: : (DECIMAL | DEC) (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR notNull?)?
-// Original: : (DATA_TYPE | DEC) (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR notNull?)?
-: (DATA_TYPE | DATA_TYPE) (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR notNull?)?
-;
-
-// Original: precision
-CONTROL_FLOWprecisionCONTROL_FLOW
-// Original: : unsignedDecimalInteger
-: CONTROL_FLOWunsignedDecimalIntegerCONTROL_FLOW
-;
-
-// Original: scale
-CONTROL_FLOWscaleCONTROL_FLOW
-// Original: : unsignedDecimalInteger
-: CONTROL_FLOWunsignedDecimalIntegerCONTROL_FLOW
-;
-
-// Original: approximateNumericType
-CONTROL_FLOWapproximateNumericTypeCONTROL_FLOW
-: FLOAT16 notNull?
-| FLOAT32 notNull?
-| FLOAT64 notNull?
-| FLOAT128 notNull?
-| FLOAT256 notNull?
-// Original: | FLOAT (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN)? notNull?
-// Original: | FLOAT (LEFT_PAREN precision (COMMA scale)? PUNCTUATION_OPERATOR)? notNull?
-// Original: | FLOAT (PUNCTUATION_OPERATOR precision (COMMA scale)? PUNCTUATION_OPERATOR)? notNull?
-// Original: | FLOAT (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR)? notNull?
-| DATA_TYPE (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR)? notNull?
-// Original: | REAL notNull?
-| DATA_TYPE notNull?
-// Original: | DOUBLE PRECISION? notNull?
-// Original: | DOUBLE KEYWORD? notNull?
-| DATA_TYPE KEYWORD? notNull?
-;
-
-// Original: temporalType
-CONTROL_FLOWtemporalTypeCONTROL_FLOW
-// Original: : temporalInstantType
-: CONTROL_FLOWtemporalInstantTypeCONTROL_FLOW
-// Original: | temporalDurationType
-| CONTROL_FLOWtemporalDurationTypeCONTROL_FLOW
-;
-
-// Original: temporalInstantType
-CONTROL_FLOWtemporalInstantTypeCONTROL_FLOW
-// Original: : datetimeType
-: CONTROL_FLOWdatetimeTypeCONTROL_FLOW
-// Original: | localdatetimeType
-| CONTROL_FLOWlocaldatetimeTypeCONTROL_FLOW
-// Original: | dateType
-| CONTROL_FLOWdateTypeCONTROL_FLOW
-// Original: | timeType
-| CONTROL_FLOWtimeTypeCONTROL_FLOW
-// Original: | localtimeType
-| CONTROL_FLOWlocaltimeTypeCONTROL_FLOW
-;
-
-// Original: datetimeType
-CONTROL_FLOWdatetimeTypeCONTROL_FLOW
-// Original: : ZONED DATETIME notNull?
-// Original: : ZONED DATA_TYPE notNull?
-: DATA_TYPE DATA_TYPE notNull?
-// Original: | TIMESTAMP WITH TIME ZONE notNull?
-// Original: | TIMESTAMP WITH DATA_TYPE ZONE notNull?
-// Original: | TIMESTAMP KEYWORD DATA_TYPE ZONE notNull?
-// Original: | TIMESTAMP KEYWORD DATA_TYPE KEYWORD notNull?
-| DATA_TYPE KEYWORD DATA_TYPE KEYWORD notNull?
-;
-
-// Original: localdatetimeType
-CONTROL_FLOWlocaldatetimeTypeCONTROL_FLOW
-// Original: : LOCAL DATETIME notNull?
-: LOCAL DATA_TYPE notNull?
-// Original: | TIMESTAMP (WITHOUT TIME ZONE)? notNull?
-// Original: | TIMESTAMP (WITHOUT DATA_TYPE ZONE)? notNull?
-// Original: | TIMESTAMP (KEYWORD DATA_TYPE ZONE)? notNull?
-// Original: | TIMESTAMP (KEYWORD DATA_TYPE KEYWORD)? notNull?
-| DATA_TYPE (KEYWORD DATA_TYPE KEYWORD)? notNull?
-;
-
-// Original: dateType
-CONTROL_FLOWdateTypeCONTROL_FLOW
-// Original: : DATE notNull?
-: DATA_TYPE notNull?
-;
-
-// Original: timeType
-CONTROL_FLOWtimeTypeCONTROL_FLOW
-// Original: : ZONED TIME notNull?
-// Original: : ZONED DATA_TYPE notNull?
-: DATA_TYPE DATA_TYPE notNull?
-// Original: | TIME WITH TIME ZONE notNull?
-// Original: | DATA_TYPE WITH DATA_TYPE ZONE notNull?
-// Original: | DATA_TYPE KEYWORD DATA_TYPE ZONE notNull?
-| DATA_TYPE KEYWORD DATA_TYPE KEYWORD notNull?
-;
-
-// Original: localtimeType
-CONTROL_FLOWlocaltimeTypeCONTROL_FLOW
-// Original: : LOCAL TIME notNull?
-: LOCAL DATA_TYPE notNull?
-// Original: | TIME WITHOUT TIME ZONE notNull?
-// Original: | DATA_TYPE WITHOUT DATA_TYPE ZONE notNull?
-// Original: | DATA_TYPE KEYWORD DATA_TYPE ZONE notNull?
-| DATA_TYPE KEYWORD DATA_TYPE KEYWORD notNull?
-;
-
-// Original: temporalDurationType
-CONTROL_FLOWtemporalDurationTypeCONTROL_FLOW
-// Original: : DURATION LEFT_PAREN temporalDurationQualifier RIGHT_PAREN notNull?
-// Original: : DURATION LEFT_PAREN temporalDurationQualifier PUNCTUATION_OPERATOR notNull?
-// Original: : DATA_TYPE LEFT_PAREN temporalDurationQualifier PUNCTUATION_OPERATOR notNull?
-: DATA_TYPE PUNCTUATION_OPERATOR temporalDurationQualifier PUNCTUATION_OPERATOR notNull?
-;
-
-// Original: temporalDurationQualifier
-CONTROL_FLOWtemporalDurationQualifierCONTROL_FLOW
-// Original: : YEAR TO MONTH
-// Original: : YEAR TO DATA_TYPE
-// Original: : DATA_TYPE TO DATA_TYPE
-// Original: : DATA_TYPE KEYWORD DATA_TYPE
-: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWDATA_TYPECONTROL_FLOW
-// Original: | DAY TO SECOND
-// Original: | DAY KEYWORD SECOND
-| CONTROL_FLOWDAYCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWSECONDCONTROL_FLOW
-;
-
-// Original: referenceValueType
-CONTROL_FLOWreferenceValueTypeCONTROL_FLOW
-// Original: : graphReferenceValueType
-: CONTROL_FLOWgraphReferenceValueTypeCONTROL_FLOW
-// Original: | bindingTableReferenceValueType
-| CONTROL_FLOWbindingTableReferenceValueTypeCONTROL_FLOW
-// Original: | nodeReferenceValueType
-| CONTROL_FLOWnodeReferenceValueTypeCONTROL_FLOW
-// Original: | edgeReferenceValueType
-| CONTROL_FLOWedgeReferenceValueTypeCONTROL_FLOW
-;
-
-// Original: immaterialValueType
-CONTROL_FLOWimmaterialValueTypeCONTROL_FLOW
-// Original: : nullType
-: CONTROL_FLOWnullTypeCONTROL_FLOW
-// Original: | emptyType
-| CONTROL_FLOWemptyTypeCONTROL_FLOW
-;
-
-// Original: nullType
-CONTROL_FLOWnullTypeCONTROL_FLOW
-// Original: : NULL
-: CONTROL_FLOWNULLCONTROL_FLOW
-;
-
-// Original: emptyType
-CONTROL_FLOWemptyTypeCONTROL_FLOW
-// Original: : NULL notNull
-: CONTROL_FLOWNULLCONTROL_FLOW CONTROL_FLOWnotNullCONTROL_FLOW
-// Original: | NOTHING
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-;
-
-// Original: graphReferenceValueType
-CONTROL_FLOWgraphReferenceValueTypeCONTROL_FLOW
-// Original: : openGraphReferenceValueType
-: CONTROL_FLOWopenGraphReferenceValueTypeCONTROL_FLOW
-// Original: | closedGraphReferenceValueType
-| CONTROL_FLOWclosedGraphReferenceValueTypeCONTROL_FLOW
-;
-
-// Original: closedGraphReferenceValueType
-CONTROL_FLOWclosedGraphReferenceValueTypeCONTROL_FLOW
-// Original: : PROPERTY? GRAPH nestedGraphTypeSpecification notNull?
-: KEYWORD? GRAPH nestedGraphTypeSpecification notNull?
-;
-
-// Original: openGraphReferenceValueType
-CONTROL_FLOWopenGraphReferenceValueTypeCONTROL_FLOW
-// Original: : ANY PROPERTY? GRAPH notNull?
-// Original: : ANY KEYWORD? GRAPH notNull?
-: KEYWORD KEYWORD? GRAPH notNull?
-;
-
-// Original: bindingTableReferenceValueType
-CONTROL_FLOWbindingTableReferenceValueTypeCONTROL_FLOW
-: bindingTableType notNull?
-;
-
-// Original: nodeReferenceValueType
-CONTROL_FLOWnodeReferenceValueTypeCONTROL_FLOW
-// Original: : openNodeReferenceValueType
-: CONTROL_FLOWopenNodeReferenceValueTypeCONTROL_FLOW
-// Original: | closedNodeReferenceValueType
-| CONTROL_FLOWclosedNodeReferenceValueTypeCONTROL_FLOW
-;
-
-// Original: closedNodeReferenceValueType
-CONTROL_FLOWclosedNodeReferenceValueTypeCONTROL_FLOW
-: nodeTypeSpecification notNull?
-;
-
-// Original: openNodeReferenceValueType
-CONTROL_FLOWopenNodeReferenceValueTypeCONTROL_FLOW
-// Original: : ANY? nodeSynonym notNull?
-: KEYWORD? nodeSynonym notNull?
-;
-
-// Original: edgeReferenceValueType
-CONTROL_FLOWedgeReferenceValueTypeCONTROL_FLOW
-// Original: : openEdgeReferenceValueType
-: CONTROL_FLOWopenEdgeReferenceValueTypeCONTROL_FLOW
-// Original: | closedEdgeReferenceValueType
-| CONTROL_FLOWclosedEdgeReferenceValueTypeCONTROL_FLOW
-;
-
-// Original: closedEdgeReferenceValueType
-CONTROL_FLOWclosedEdgeReferenceValueTypeCONTROL_FLOW
-: edgeTypeSpecification notNull?
-;
-
-// Original: openEdgeReferenceValueType
-CONTROL_FLOWopenEdgeReferenceValueTypeCONTROL_FLOW
-// Original: : ANY? edgeSynonym notNull?
-: KEYWORD? edgeSynonym notNull?
-;
-
-// Original: pathValueType
-CONTROL_FLOWpathValueTypeCONTROL_FLOW
-// Original: : PATH notNull?
-: KEYWORD notNull?
-;
-
-// Original: listValueTypeName
-CONTROL_FLOWlistValueTypeNameCONTROL_FLOW
-// Original: : GROUP? listValueTypeNameSynonym
-// Original: : KEYWORD? listValueTypeNameSynonym
-: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWlistValueTypeNameSynonymCONTROL_FLOW
-;
-
-// Original: listValueTypeNameSynonym
-CONTROL_FLOWlistValueTypeNameSynonymCONTROL_FLOW
-// Original: : LIST
-: CONTROL_FLOWLISTCONTROL_FLOW
-// Original: | ARRAY
-| CONTROL_FLOWARRAYCONTROL_FLOW
-;
-
-// Original: recordType
-CONTROL_FLOWrecordTypeCONTROL_FLOW
-// Original: : ANY? RECORD notNull?
-: KEYWORD? RECORD notNull?
-| RECORD? fieldTypesSpecification notNull?
-;
-
-// Original: fieldTypesSpecification
-CONTROL_FLOWfieldTypesSpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE fieldTypeList? RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWfieldTypeListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: fieldTypeList
-CONTROL_FLOWfieldTypeListCONTROL_FLOW
-// Original: : fieldType (COMMA fieldType)*
-: fieldType (PUNCTUATION_OPERATOR fieldType)*
-;
-
-// Original: notNull
-CONTROL_FLOWnotNullCONTROL_FLOW
-// Original: :  NOT NULL
-:  CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWNULLCONTROL_FLOW
-;
-
-// 18.10 <field type>
-
-// Original: fieldType
-CONTROL_FLOWfieldTypeCONTROL_FLOW
-// Original: : fieldName typed? valueType
-: CONTROL_FLOWfieldNameCONTROL_FLOW CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWvalueTypeCONTROL_FLOW
-;
-
-// 19.1 <search condition>
-
-// Original: searchCondition
-CONTROL_FLOWsearchConditionCONTROL_FLOW
-// Original: : booleanValueExpression
-: CONTROL_FLOWbooleanValueExpressionCONTROL_FLOW
-;
-
-// 19.2 <predicate>
-
-// Original: predicate
-CONTROL_FLOWpredicateCONTROL_FLOW
-// Original: : existsPredicate
-: CONTROL_FLOWexistsPredicateCONTROL_FLOW
-// Original: | nullPredicate
-| CONTROL_FLOWnullPredicateCONTROL_FLOW
-// Original: | valueTypePredicate
-| CONTROL_FLOWvalueTypePredicateCONTROL_FLOW
-// Original: | directedPredicate
-| CONTROL_FLOWdirectedPredicateCONTROL_FLOW
-// Original: | labeledPredicate
-| CONTROL_FLOWlabeledPredicateCONTROL_FLOW
-// Original: | sourceDestinationPredicate
-| CONTROL_FLOWsourceDestinationPredicateCONTROL_FLOW
-// Original: | all_differentPredicate
-| CONTROL_FLOWall_differentPredicateCONTROL_FLOW
-// Original: | samePredicate
-| CONTROL_FLOWsamePredicateCONTROL_FLOW
-// Original: | property_existsPredicate
-| CONTROL_FLOWproperty_existsPredicateCONTROL_FLOW
-;
-
-// 19.3 <comparison predicate>
-
-// Original: // The <comparison predicate> productions moved to valueExpression
-// CONTROL_FLOWTheCONTROL_FLOW <CONTROL_FLOWcomparisonCONTROL_FLOW CONTROL_FLOWpredicateCONTROL_FLOW> CONTROL_FLOWproductionsCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-// to avoid left mutually recursive productions.
-
-// Original: comparisonPredicatePart2
-CONTROL_FLOWcomparisonPredicatePart2CONTROL_FLOW
-// Original: : compOp valueExpression
-: CONTROL_FLOWcompOpCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: compOp
-CONTROL_FLOWcompOpCONTROL_FLOW
-// Original: : EQUALS_OPERATOR
-: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW
-// Original: | NOT_EQUALS_OPERATOR
-| CONTROL_FLOWNOT_EQUALS_OPERATORCONTROL_FLOW
-// Original: | LEFT_ANGLE_BRACKET
-// Original: | PUNCTUATION_OPERATOR
-| CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-// Original: | RIGHT_ANGLE_BRACKET
-| CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
-// Original: | LESS_THAN_OR_EQUALS_OPERATOR
-| CONTROL_FLOWLESS_THAN_OR_EQUALS_OPERATORCONTROL_FLOW
-// Original: | GREATER_THAN_OR_EQUALS_OPERATOR
-| CONTROL_FLOWGREATER_THAN_OR_EQUALS_OPERATORCONTROL_FLOW
-;
-
-// 19.4 <exists predicate>
-
-// Original: existsPredicate
-CONTROL_FLOWexistsPredicateCONTROL_FLOW
-// Original: : EXISTS (LEFT_BRACE graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern RIGHT_PAREN | LEFT_BRACE matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock RIGHT_PAREN | nestedQuerySpecification)
-// Original: : EXISTS (LEFT_BRACE graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern PUNCTUATION_OPERATOR | LEFT_BRACE matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
-// Original: : EXISTS (PUNCTUATION_OPERATOR graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
-// Original: : KEYWORD (PUNCTUATION_OPERATOR graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
-// Original: : KEYWORD (PUNCTUATION_OPERATOR graphPattern RIGHT_BRACE | PUNCTUATION_OPERATOR graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock RIGHT_BRACE | PUNCTUATION_OPERATOR matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
-: KEYWORD (PUNCTUATION_OPERATOR graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
-;
-
-// 19.5 <null predicate>
-
-// Original: nullPredicate
-CONTROL_FLOWnullPredicateCONTROL_FLOW
-// Original: : valueExpressionPrimary nullPredicatePart2
-: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW CONTROL_FLOWnullPredicatePart2CONTROL_FLOW
-;
-
-// Original: nullPredicatePart2
-CONTROL_FLOWnullPredicatePart2CONTROL_FLOW
-// Original: : IS NOT? NULL
-: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWNULLCONTROL_FLOW
-;
-
-// 19.6 <value type predicate>
-
-// Original: valueTypePredicate
-CONTROL_FLOWvalueTypePredicateCONTROL_FLOW
-// Original: : valueExpressionPrimary valueTypePredicatePart2
-: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW CONTROL_FLOWvalueTypePredicatePart2CONTROL_FLOW
-;
-
-// Original: valueTypePredicatePart2
-CONTROL_FLOWvalueTypePredicatePart2CONTROL_FLOW
-// Original: : IS NOT? typed valueType
-: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWtypedCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW
-;
-
-// 19.7 <normalized predicate>
-
-// Original: normalizedPredicatePart2
-CONTROL_FLOWnormalizedPredicatePart2CONTROL_FLOW
-// Original: : IS NOT? normalForm? NORMALIZED
-: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWnormalFormCONTROL_FLOW? CONTROL_FLOWNORMALIZEDCONTROL_FLOW
-;
-
-// 19.8 <directed predicate>
-
-// Original: directedPredicate
-CONTROL_FLOWdirectedPredicateCONTROL_FLOW
-// Original: : elementVariableReference directedPredicatePart2
-: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWdirectedPredicatePart2CONTROL_FLOW
-;
-
-// Original: directedPredicatePart2
-CONTROL_FLOWdirectedPredicatePart2CONTROL_FLOW
-// Original: : IS NOT? DIRECTED
-: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWDIRECTEDCONTROL_FLOW
-;
-
-// 19.9 <labled predicate>
-
-// Original: labeledPredicate
-CONTROL_FLOWlabeledPredicateCONTROL_FLOW
-// Original: : elementVariableReference labeledPredicatePart2
-: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWlabeledPredicatePart2CONTROL_FLOW
-;
-
-// Original: labeledPredicatePart2
-CONTROL_FLOWlabeledPredicatePart2CONTROL_FLOW
-// Original: : isLabeledOrColon labelExpression
-: CONTROL_FLOWisLabeledOrColonCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW
-;
-
-// Original: isLabeledOrColon
-CONTROL_FLOWisLabeledOrColonCONTROL_FLOW
-// Original: : IS NOT? LABELED
-: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWLABELEDCONTROL_FLOW
-// Original: | COLON
-| CONTROL_FLOWCOLONCONTROL_FLOW
-;
-
-// 19.10 <source/destination predicate>
-
-// Original: sourceDestinationPredicate
-CONTROL_FLOWsourceDestinationPredicateCONTROL_FLOW
-// Original: : nodeReference sourcePredicatePart2
-: CONTROL_FLOWnodeReferenceCONTROL_FLOW CONTROL_FLOWsourcePredicatePart2CONTROL_FLOW
-// Original: | nodeReference destinationPredicatePart2
-| CONTROL_FLOWnodeReferenceCONTROL_FLOW CONTROL_FLOWdestinationPredicatePart2CONTROL_FLOW
-;
-
-// Original: nodeReference
-CONTROL_FLOWnodeReferenceCONTROL_FLOW
-// Original: : elementVariableReference
-: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
-;
-
-// Original: sourcePredicatePart2
-CONTROL_FLOWsourcePredicatePart2CONTROL_FLOW
-// Original: : IS NOT? SOURCE OF edgeReference
-// Original: : IS NOT? KEYWORD OF edgeReference
-: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWedgeReferenceCONTROL_FLOW
-;
-
-// Original: destinationPredicatePart2
-CONTROL_FLOWdestinationPredicatePart2CONTROL_FLOW
-// Original: : IS NOT? DESTINATION OF edgeReference
-: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWDESTINATIONCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWedgeReferenceCONTROL_FLOW
-;
-
-// Original: edgeReference
-CONTROL_FLOWedgeReferenceCONTROL_FLOW
-// Original: : elementVariableReference
-: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
-;
-
-// 19.11 <all different predicate>
-
-// Original: all_differentPredicate
-CONTROL_FLOWall_differentPredicateCONTROL_FLOW
-// Original: : ALL_DIFFERENT LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* PUNCTUATION_OPERATOR
-: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW)* CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 19.12 <same predicate>
-
-// Original: samePredicate
-CONTROL_FLOWsamePredicateCONTROL_FLOW
-// Original: : SAME LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
-// Original: : KEYWORD LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
-// Original: : KEYWORD LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* PUNCTUATION_OPERATOR
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW)* CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 19.13 <property exists predicate>
-
-// Original: property_existsPredicate
-CONTROL_FLOWproperty_existsPredicateCONTROL_FLOW
-// Original: : PROPERTY_EXISTS LEFT_PAREN elementVariableReference COMMA propertyName RIGHT_PAREN
-// Original: : PROPERTY_EXISTS LEFT_PAREN elementVariableReference COMMA propertyName PUNCTUATION_OPERATOR
-: CONTROL_FLOWPROPERTY_EXISTSCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 20.1 <value expression>
-
-// Original: // This version of valueExpression sucks up rules broken out in the standard to a single production. This
-// CONTROL_FLOWThisCONTROL_FLOW CONTROL_FLOWversionCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWsucksCONTROL_FLOW CONTROL_FLOWupCONTROL_FLOW CONTROL_FLOWrulesCONTROL_FLOW CONTROL_FLOWbrokenCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWstandardCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWsingleCONTROL_FLOW CONTROL_FLOWproductionCONTROL_FLOW. CONTROL_FLOWThisCONTROL_FLOW
-// eliminates ambiguity in multiple rules specifying valueExpressionPrimary.
-
-// Original: valueExpression
-CONTROL_FLOWvalueExpressionCONTROL_FLOW
-// Original: // Numeric, datetime and duration types all support roughly the same expressions. So here
-// CONTROL_FLOWNumericCONTROL_FLOW, CONTROL_FLOWdatetimeCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWdurationCONTROL_FLOW CONTROL_FLOWtypesCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWsupportCONTROL_FLOW CONTROL_FLOWroughlyCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWsameCONTROL_FLOW CONTROL_FLOWexpressionsCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWhereCONTROL_FLOW
-// Original: // we define a rule that deals with all of them. It is up to the implementation to post
-// CONTROL_FLOWweCONTROL_FLOW CONTROL_FLOWdefineCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWruleCONTROL_FLOW CONTROL_FLOWthatCONTROL_FLOW CONTROL_FLOWdealsCONTROL_FLOW CONTROL_FLOWwithCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW. CONTROL_FLOWItCONTROL_FLOW CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWupCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWimplementationCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWpostCONTROL_FLOW
-// process the sytnax tree and flag invalid type and function combinations.
-// Original: : sign = (PLUS_SIGN | MINUS_SIGN) valueExpression                       #signedExprAlt
-: CONTROL_FLOWsignCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW                       #CONTROL_FLOWsignedExprAltCONTROL_FLOW
-// Original: | valueExpression operator = (ASTERISK | SOLIDUS) valueExpression       #multDivExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWASTERISKCONTROL_FLOW | CONTROL_FLOWSOLIDUSCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW       #CONTROL_FLOWmultDivExprAltCONTROL_FLOW
-// Original: | valueExpression operator = (PLUS_SIGN | MINUS_SIGN) valueExpression   #addSubtractExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW   #CONTROL_FLOWaddSubtractExprAltCONTROL_FLOW
-// Original: // Character strings, byte strings, lists and paths all support the same concatenation
-// CONTROL_FLOWCharacterCONTROL_FLOW CONTROL_FLOWstringsCONTROL_FLOW, CONTROL_FLOWbyteCONTROL_FLOW CONTROL_FLOWstringsCONTROL_FLOW, CONTROL_FLOWlistsCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWpathsCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWsupportCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWsameCONTROL_FLOW CONTROL_FLOWconcatenationCONTROL_FLOW
-// Original: // operator. So here we define a rule that deals with all of them. Of course the types
-// CONTROL_FLOWoperatorCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWhereCONTROL_FLOW CONTROL_FLOWweCONTROL_FLOW CONTROL_FLOWdefineCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWruleCONTROL_FLOW CONTROL_FLOWthatCONTROL_FLOW CONTROL_FLOWdealsCONTROL_FLOW CONTROL_FLOWwithCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW. CONTROL_FLOWOfCONTROL_FLOW CONTROL_FLOWcourseCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWtypesCONTROL_FLOW
-// Original: // cannot be combined. So it is up to implementation to post process the sytax tree
-// CONTROL_FLOWcannotCONTROL_FLOW CONTROL_FLOWbeCONTROL_FLOW CONTROL_FLOWcombinedCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWitCONTROL_FLOW CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWupCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWimplementationCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWpostCONTROL_FLOW CONTROL_FLOWprocessCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWsytaxCONTROL_FLOW CONTROL_FLOWtreeCONTROL_FLOW
-// and flag invalid type and function combinations.
-// Original: | valueExpression CONCATENATION_OPERATOR valueExpression                #concatenationExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWCONCATENATION_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW                #CONTROL_FLOWconcatenationExprAltCONTROL_FLOW
-// Boolean value expression included here.
-// Original: | NOT valueExpression                                                   #notExprAlt
-| CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW                                                   #CONTROL_FLOWnotExprAltCONTROL_FLOW
-// Original: | valueExpression IS NOT? truthValue                                    #isNotExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWtruthValueCONTROL_FLOW                                    #CONTROL_FLOWisNotExprAltCONTROL_FLOW
-// Original: | valueExpression AND valueExpression                                   #conjunctiveExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWANDCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW                                   #CONTROL_FLOWconjunctiveExprAltCONTROL_FLOW
-// Original: | valueExpression operator = (OR | XOR) valueExpression                 #disjunctiveExprAlt
-// Original: | valueExpression operator = (OR | KEYWORD) valueExpression                 #disjunctiveExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWORCONTROL_FLOW | CONTROL_FLOWKEYWORDCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW                 #CONTROL_FLOWdisjunctiveExprAltCONTROL_FLOW
-// The comparisonPredicate productions moved here to eliminate left mutual recursion.
-// Original: | valueExpression comparisonPredicatePart2                              #comparisonExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWcomparisonPredicatePart2CONTROL_FLOW                              #CONTROL_FLOWcomparisonExprAltCONTROL_FLOW
-// Original: | predicate                                                             #predicateExprAlt
-| CONTROL_FLOWpredicateCONTROL_FLOW                                                             #CONTROL_FLOWpredicateExprAltCONTROL_FLOW
-// The normalizedPredicate productions moved here to eliminate left mutual recursion.
-// Original: | valueExpression normalizedPredicatePart2                              #normalizedPredicateExprAlt
-| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWnormalizedPredicatePart2CONTROL_FLOW                              #CONTROL_FLOWnormalizedPredicateExprAltCONTROL_FLOW
-// Original: | PROPERTY? GRAPH graphExpression                                       #propertyGraphExprAlt
-| CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW                                       #CONTROL_FLOWpropertyGraphExprAltCONTROL_FLOW
-// Original: | BINDING? TABLE bindingTableExpression                                 #bindingTableExprAlt
-// Original: | KEYWORD? TABLE bindingTableExpression                                 #bindingTableExprAlt
-| CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWbindingTableExpressionCONTROL_FLOW                                 #CONTROL_FLOWbindingTableExprAltCONTROL_FLOW
-// Original: | valueFunction                                                         #valueFunctionExprAlt
-| CONTROL_FLOWvalueFunctionCONTROL_FLOW                                                         #CONTROL_FLOWvalueFunctionExprAltCONTROL_FLOW
-// Original: | valueExpressionPrimary                                                #primaryExprAlt
-| CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW                                                #CONTROL_FLOWprimaryExprAltCONTROL_FLOW
-;
-
-// Original: valueFunction
-CONTROL_FLOWvalueFunctionCONTROL_FLOW
-// Original: : numericValueFunction
-: CONTROL_FLOWnumericValueFunctionCONTROL_FLOW
-// Original: | datetimeSubtraction
-| CONTROL_FLOWdatetimeSubtractionCONTROL_FLOW
-// Original: | datetimeValueFunction
-| CONTROL_FLOWdatetimeValueFunctionCONTROL_FLOW
-// Original: | durationValueFunction
-| CONTROL_FLOWdurationValueFunctionCONTROL_FLOW
-// Original: | characterOrByteStringFunction
-| CONTROL_FLOWcharacterOrByteStringFunctionCONTROL_FLOW
-// Original: | listValueFunction
-| CONTROL_FLOWlistValueFunctionCONTROL_FLOW
-;
-
-// Original: booleanValueExpression
-CONTROL_FLOWbooleanValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: characterOrByteStringFunction
-CONTROL_FLOWcharacterOrByteStringFunctionCONTROL_FLOW
-// Original: : subCharacterOrByteString
-: CONTROL_FLOWsubCharacterOrByteStringCONTROL_FLOW
-// Original: | trimSingleCharacterOrByteString
-| CONTROL_FLOWtrimSingleCharacterOrByteStringCONTROL_FLOW
-// Original: | foldCharacterString
-| CONTROL_FLOWfoldCharacterStringCONTROL_FLOW
-// Original: | trimMultiCharacterCharacterString
-| CONTROL_FLOWtrimMultiCharacterCharacterStringCONTROL_FLOW
-// Original: | normalizeCharacterString
-| CONTROL_FLOWnormalizeCharacterStringCONTROL_FLOW
-;
-
-// Original: subCharacterOrByteString
-CONTROL_FLOWsubCharacterOrByteStringCONTROL_FLOW
-// Original: : (LEFT | RIGHT) LEFT_PAREN valueExpression COMMA stringLength RIGHT_PAREN
-// Original: : (KEYWORD | RIGHT) LEFT_PAREN valueExpression COMMA stringLength RIGHT_PAREN
-// Original: : (KEYWORD | RIGHT) LEFT_PAREN valueExpression COMMA stringLength PUNCTUATION_OPERATOR
-: (CONTROL_FLOWKEYWORDCONTROL_FLOW | CONTROL_FLOWRIGHTCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWstringLengthCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: trimSingleCharacterOrByteString
-CONTROL_FLOWtrimSingleCharacterOrByteStringCONTROL_FLOW
-// Original: : TRIM LEFT_PAREN trimOperands RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN trimOperands RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN trimOperands PUNCTUATION_OPERATOR
-: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWtrimOperandsCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: foldCharacterString
-CONTROL_FLOWfoldCharacterStringCONTROL_FLOW
-// Original: : (UPPER | LOWER) LEFT_PAREN valueExpression RIGHT_PAREN
-// Original: : (UPPER | LOWER) LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
-// Original: : (FUNCTION | LOWER) LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
-: (CONTROL_FLOWFUNCTIONCONTROL_FLOW | CONTROL_FLOWLOWERCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: trimMultiCharacterCharacterString
-CONTROL_FLOWtrimMultiCharacterCharacterStringCONTROL_FLOW
-// Original: : (BTRIM | LTRIM | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? RIGHT_PAREN
-// Original: : (BTRIM | FUNCTION | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? RIGHT_PAREN
-// Original: : (BTRIM | FUNCTION | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? PUNCTUATION_OPERATOR
-: (CONTROL_FLOWBTRIMCONTROL_FLOW | CONTROL_FLOWFUNCTIONCONTROL_FLOW | CONTROL_FLOWRTRIMCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW)? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: normalizeCharacterString
-CONTROL_FLOWnormalizeCharacterStringCONTROL_FLOW
-// Original: : NORMALIZE LEFT_PAREN valueExpression (COMMA normalForm)? RIGHT_PAREN
-// Original: : NORMALIZE LEFT_PAREN valueExpression (COMMA normalForm)? PUNCTUATION_OPERATOR
-: CONTROL_FLOWNORMALIZECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnormalFormCONTROL_FLOW)? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: nodeReferenceValueExpression
-CONTROL_FLOWnodeReferenceValueExpressionCONTROL_FLOW
-// Original: : valueExpressionPrimary
-: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
-;
-
-// Original: edgeReferenceValueExpression
-CONTROL_FLOWedgeReferenceValueExpressionCONTROL_FLOW
-// Original: : valueExpressionPrimary
-: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
-;
-
-// Original: aggregatingValueExpression
-CONTROL_FLOWaggregatingValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.2 <value expression primary>
-
-// Original: valueExpressionPrimary
-CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
-// Original: : parenthesizedValueExpression
-: CONTROL_FLOWparenthesizedValueExpressionCONTROL_FLOW
-// Original: | aggregateFunction
-| CONTROL_FLOWaggregateFunctionCONTROL_FLOW
-// Original: | unsignedValueSpecification
-| CONTROL_FLOWunsignedValueSpecificationCONTROL_FLOW
-// Original: // List and Record literals are reduntantly/abiguously part of the literal production
-// CONTROL_FLOWListCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWRecordCONTROL_FLOW CONTROL_FLOWliteralsCONTROL_FLOW CONTROL_FLOWareCONTROL_FLOW CONTROL_FLOWreduntantlyCONTROL_FLOW/CONTROL_FLOWabiguouslyCONTROL_FLOW CONTROL_FLOWpartCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWliteralCONTROL_FLOW CONTROL_FLOWproductionCONTROL_FLOW
-// Original: //    | listValueConstructor
-//    | CONTROL_FLOWlistValueConstructorCONTROL_FLOW
-// Original: //    | recordConstructor
-//    | CONTROL_FLOWrecordConstructorCONTROL_FLOW
-// Original: | pathValueConstructor
-| CONTROL_FLOWpathValueConstructorCONTROL_FLOW
-// Original: | valueExpressionPrimary PERIOD propertyName      // <propertyReference
-| CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW      // <CONTROL_FLOWpropertyReferenceCONTROL_FLOW
-// Original: | valueQueryExpression
-| CONTROL_FLOWvalueQueryExpressionCONTROL_FLOW
-// Original: | caseExpression
-| CONTROL_FLOWcaseExpressionCONTROL_FLOW
-// Original: | castSpecification
-| CONTROL_FLOWcastSpecificationCONTROL_FLOW
-// Original: | element_idFunction
-| CONTROL_FLOWelement_idFunctionCONTROL_FLOW
-// Original: | letValueExpression
-| CONTROL_FLOWletValueExpressionCONTROL_FLOW
-// Original: | bindingVariableReference
-| CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
-;
-
-// Original: parenthesizedValueExpression
-CONTROL_FLOWparenthesizedValueExpressionCONTROL_FLOW
-// Original: : LEFT_PAREN valueExpression RIGHT_PAREN
-// Original: : LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: nonParenthesizedValueExpressionPrimary
-CONTROL_FLOWnonParenthesizedValueExpressionPrimaryCONTROL_FLOW
-// Original: : nonParenthesizedValueExpressionPrimarySpecialCase
-: CONTROL_FLOWnonParenthesizedValueExpressionPrimarySpecialCaseCONTROL_FLOW
-// Original: | bindingVariableReference
-| CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
-;
-
-// Original: nonParenthesizedValueExpressionPrimarySpecialCase
-CONTROL_FLOWnonParenthesizedValueExpressionPrimarySpecialCaseCONTROL_FLOW
-// Original: : aggregateFunction
-: CONTROL_FLOWaggregateFunctionCONTROL_FLOW
-// Original: | unsignedValueSpecification
-| CONTROL_FLOWunsignedValueSpecificationCONTROL_FLOW
-// Original: // List and Record literals are reduntantly/abiguously part of the literal production
-// CONTROL_FLOWListCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWRecordCONTROL_FLOW CONTROL_FLOWliteralsCONTROL_FLOW CONTROL_FLOWareCONTROL_FLOW CONTROL_FLOWreduntantlyCONTROL_FLOW/CONTROL_FLOWabiguouslyCONTROL_FLOW CONTROL_FLOWpartCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWliteralCONTROL_FLOW CONTROL_FLOWproductionCONTROL_FLOW
-// Original: //    | listValueConstructor
-//    | CONTROL_FLOWlistValueConstructorCONTROL_FLOW
-// Original: //    | recordConstructor
-//    | CONTROL_FLOWrecordConstructorCONTROL_FLOW
-// Original: | pathValueConstructor
-| CONTROL_FLOWpathValueConstructorCONTROL_FLOW
-// Original: | valueExpressionPrimary PERIOD propertyName      // <property reference>
-| valueExpressionPrimary PUNCTUATION_OPERATOR propertyName      // <property reference>
-// Original: | valueQueryExpression
-| CONTROL_FLOWvalueQueryExpressionCONTROL_FLOW
-// Original: | caseExpression
-| CONTROL_FLOWcaseExpressionCONTROL_FLOW
-// Original: | castSpecification
-| CONTROL_FLOWcastSpecificationCONTROL_FLOW
-// Original: | element_idFunction
-| CONTROL_FLOWelement_idFunctionCONTROL_FLOW
-// Original: | letValueExpression
-| CONTROL_FLOWletValueExpressionCONTROL_FLOW
-;
-
-// 20.3 <value specification>
-
-// Original: unsignedValueSpecification
-CONTROL_FLOWunsignedValueSpecificationCONTROL_FLOW
-// Original: : unsignedLiteral
-: CONTROL_FLOWunsignedLiteralCONTROL_FLOW
-// Original: | generalValueSpecification
-| CONTROL_FLOWgeneralValueSpecificationCONTROL_FLOW
-;
-
-// Original: nonNegativeIntegerSpecification
-CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
-// Original: : unsignedInteger
-: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-// Original: | dynamicParameterSpecification
-| CONTROL_FLOWdynamicParameterSpecificationCONTROL_FLOW
-;
-
-// Original: generalValueSpecification
-CONTROL_FLOWgeneralValueSpecificationCONTROL_FLOW
-// Original: : dynamicParameterSpecification
-: CONTROL_FLOWdynamicParameterSpecificationCONTROL_FLOW
-// Original: | SESSION_USER
-| CONTROL_FLOWSESSION_USERCONTROL_FLOW
-;
-
-// 20.4 <dynamic parameter specification>
-
-// Original: dynamicParameterSpecification
-CONTROL_FLOWdynamicParameterSpecificationCONTROL_FLOW
-// Original: : GENERAL_PARAMETER_REFERENCE
-: CONTROL_FLOWGENERAL_PARAMETER_REFERENCECONTROL_FLOW
-;
-
-// 20.5 <let value expression>
-
-// Original: letValueExpression
-CONTROL_FLOWletValueExpressionCONTROL_FLOW
-// Original: : LET letVariableDefinitionList IN valueExpression END
-: CONTROL_FLOWLETCONTROL_FLOW CONTROL_FLOWletVariableDefinitionListCONTROL_FLOW CONTROL_FLOWINCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWENDCONTROL_FLOW
-;
-
-// 20.6 <value query expression>
-
-// Original: valueQueryExpression
-CONTROL_FLOWvalueQueryExpressionCONTROL_FLOW
-// Original: : VALUE nestedQuerySpecification
-: CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
-;
-
-// 20.7 <case expression>
-
-// Original: caseExpression
-CONTROL_FLOWcaseExpressionCONTROL_FLOW
-// Original: : caseAbbreviation
-: CONTROL_FLOWcaseAbbreviationCONTROL_FLOW
-// Original: | caseSpecification
-| CONTROL_FLOWcaseSpecificationCONTROL_FLOW
-;
-
-// Original: caseAbbreviation
-CONTROL_FLOWcaseAbbreviationCONTROL_FLOW
-// Original: : NULLIF LEFT_PAREN valueExpression COMMA valueExpression RIGHT_PAREN
-// Original: : NULLIF LEFT_PAREN valueExpression COMMA valueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWNULLIFCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-// Original: | COALESCE LEFT_PAREN valueExpression (COMMA valueExpression)+ RIGHT_PAREN
-// Original: | COALESCE LEFT_PAREN valueExpression (COMMA valueExpression)+ PUNCTUATION_OPERATOR
-| CONTROL_FLOWCOALESCECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW)+ CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: caseSpecification
-CONTROL_FLOWcaseSpecificationCONTROL_FLOW
-// Original: : simpleCase
-: CONTROL_FLOWsimpleCaseCONTROL_FLOW
-// Original: | searchedCase
-| CONTROL_FLOWsearchedCaseCONTROL_FLOW
-;
-
-// Original: simpleCase
-CONTROL_FLOWsimpleCaseCONTROL_FLOW
-// Original: : CASE caseOperand simpleWhenClause+ elseClause? END
-: CONTROL_FLOWCASECONTROL_FLOW CONTROL_FLOWcaseOperandCONTROL_FLOW CONTROL_FLOWsimpleWhenClauseCONTROL_FLOW+ CONTROL_FLOWelseClauseCONTROL_FLOW? CONTROL_FLOWENDCONTROL_FLOW
-;
-
-// Original: searchedCase
-CONTROL_FLOWsearchedCaseCONTROL_FLOW
-// Original: : CASE searchedWhenClause+ elseClause? END
-: CONTROL_FLOWCASECONTROL_FLOW CONTROL_FLOWsearchedWhenClauseCONTROL_FLOW+ CONTROL_FLOWelseClauseCONTROL_FLOW? CONTROL_FLOWENDCONTROL_FLOW
-;
-
-// Original: simpleWhenClause
-CONTROL_FLOWsimpleWhenClauseCONTROL_FLOW
-// Original: : WHEN whenOperandList THEN result
-// Original: : WHEN whenOperandList CONTROL_FLOW result
-: CONTROL_FLOWWHENCONTROL_FLOW CONTROL_FLOWwhenOperandListCONTROL_FLOW CONTROL_FLOWCONTROL_FLOWCONTROL_FLOW CONTROL_FLOWresultCONTROL_FLOW
-;
-
-// Original: searchedWhenClause
-CONTROL_FLOWsearchedWhenClauseCONTROL_FLOW
-// Original: : WHEN searchCondition THEN result
-// Original: : WHEN searchCondition CONTROL_FLOW result
-: CONTROL_FLOWWHENCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW CONTROL_FLOWCONTROL_FLOWCONTROL_FLOW CONTROL_FLOWresultCONTROL_FLOW
-;
-
-// Original: elseClause
-CONTROL_FLOWelseClauseCONTROL_FLOW
-// Original: : ELSE result
-: CONTROL_FLOWELSECONTROL_FLOW CONTROL_FLOWresultCONTROL_FLOW
-;
-
-// Original: caseOperand
-CONTROL_FLOWcaseOperandCONTROL_FLOW
-// Original: : nonParenthesizedValueExpressionPrimary
-: CONTROL_FLOWnonParenthesizedValueExpressionPrimaryCONTROL_FLOW
-// Original: | elementVariableReference
-| CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
-;
-
-// Original: whenOperandList
-CONTROL_FLOWwhenOperandListCONTROL_FLOW
-// Original: : whenOperand (COMMA whenOperand)*
-: whenOperand (PUNCTUATION_OPERATOR whenOperand)*
-;
-
-// Original: whenOperand
-CONTROL_FLOWwhenOperandCONTROL_FLOW
-// Original: : nonParenthesizedValueExpressionPrimary
-: CONTROL_FLOWnonParenthesizedValueExpressionPrimaryCONTROL_FLOW
-// Original: | comparisonPredicatePart2
-| CONTROL_FLOWcomparisonPredicatePart2CONTROL_FLOW
-// Original: | nullPredicatePart2
-| CONTROL_FLOWnullPredicatePart2CONTROL_FLOW
-// Original: | valueTypePredicatePart2
-| CONTROL_FLOWvalueTypePredicatePart2CONTROL_FLOW
-// Original: | normalizedPredicatePart2
-| CONTROL_FLOWnormalizedPredicatePart2CONTROL_FLOW
-// Original: | directedPredicatePart2
-| CONTROL_FLOWdirectedPredicatePart2CONTROL_FLOW
-// Original: | labeledPredicatePart2
-| CONTROL_FLOWlabeledPredicatePart2CONTROL_FLOW
-// Original: | sourcePredicatePart2
-| CONTROL_FLOWsourcePredicatePart2CONTROL_FLOW
-// Original: | destinationPredicatePart2
-| CONTROL_FLOWdestinationPredicatePart2CONTROL_FLOW
-;
-
-// Original: result
-CONTROL_FLOWresultCONTROL_FLOW
-// Original: : resultExpression
-: CONTROL_FLOWresultExpressionCONTROL_FLOW
-// Original: | nullLiteral
-| CONTROL_FLOWnullLiteralCONTROL_FLOW
-;
-
-// Original: resultExpression
-CONTROL_FLOWresultExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.8 <cast specification>
-
-// Original: castSpecification
-CONTROL_FLOWcastSpecificationCONTROL_FLOW
-// Original: : CAST LEFT_PAREN castOperand AS castTarget RIGHT_PAREN
-// Original: : CAST LEFT_PAREN castOperand KEYWORD castTarget RIGHT_PAREN
-// Original: : CAST LEFT_PAREN castOperand KEYWORD castTarget PUNCTUATION_OPERATOR
-: CONTROL_FLOWCASTCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWcastOperandCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWcastTargetCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: castOperand
-CONTROL_FLOWcastOperandCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-// Original: | nullLiteral
-| CONTROL_FLOWnullLiteralCONTROL_FLOW
-;
-
-// Original: castTarget
-CONTROL_FLOWcastTargetCONTROL_FLOW
-// Original: : valueType
-: CONTROL_FLOWvalueTypeCONTROL_FLOW
-;
-
-// 20.9 <aggregate function>
-
-// Original: aggregateFunction
-CONTROL_FLOWaggregateFunctionCONTROL_FLOW
-// Original: : COUNT LEFT_PAREN ASTERISK RIGHT_PAREN
-// Original: : COUNT LEFT_PAREN ASTERISK PUNCTUATION_OPERATOR
-: CONTROL_FLOWCOUNTCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWASTERISKCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-// Original: | generalSetFunction
-| CONTROL_FLOWgeneralSetFunctionCONTROL_FLOW
-// Original: | binarySetFunction
-| CONTROL_FLOWbinarySetFunctionCONTROL_FLOW
-;
-
-// Original: generalSetFunction
-CONTROL_FLOWgeneralSetFunctionCONTROL_FLOW
-// Original: : generalSetFunctionType LEFT_PAREN setQuantifier? valueExpression RIGHT_PAREN
-// Original: : generalSetFunctionType LEFT_PAREN setQuantifier? valueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWgeneralSetFunctionTypeCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsetQuantifierCONTROL_FLOW? CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: binarySetFunction
-CONTROL_FLOWbinarySetFunctionCONTROL_FLOW
-// Original: : binarySetFunctionType LEFT_PAREN dependentValueExpression COMMA independentValueExpression RIGHT_PAREN
-// Original: : binarySetFunctionType LEFT_PAREN dependentValueExpression COMMA independentValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWbinarySetFunctionTypeCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdependentValueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWindependentValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: generalSetFunctionType
-CONTROL_FLOWgeneralSetFunctionTypeCONTROL_FLOW
-// Original: : AVG
-: CONTROL_FLOWAVGCONTROL_FLOW
-// Original: | COUNT
-| CONTROL_FLOWCOUNTCONTROL_FLOW
-// Original: | MAX
-| CONTROL_FLOWMAXCONTROL_FLOW
-// Original: | MIN
-// Original: | DATA_TYPE
-| CONTROL_FLOWDATA_TYPECONTROL_FLOW
-// Original: | SUM
-// Original: | FUNCTION
-| CONTROL_FLOWFUNCTIONCONTROL_FLOW
-// Original: | COLLECT_LIST
-| CONTROL_FLOWCOLLECT_LISTCONTROL_FLOW
-// Original: | STDDEV_SAMP
-| CONTROL_FLOWSTDDEV_SAMPCONTROL_FLOW
-// Original: | STDDEV_POP
-// Original: | FUNCTION
-| CONTROL_FLOWFUNCTIONCONTROL_FLOW
-;
-
-// Original: setQuantifier
-CONTROL_FLOWsetQuantifierCONTROL_FLOW
-// Original: : DISTINCT
-: CONTROL_FLOWDISTINCTCONTROL_FLOW
-// Original: | ALL
-| CONTROL_FLOWALLCONTROL_FLOW
-;
-
-// Original: binarySetFunctionType
-CONTROL_FLOWbinarySetFunctionTypeCONTROL_FLOW
-// Original: : PERCENTILE_CONT
-: CONTROL_FLOWPERCENTILE_CONTCONTROL_FLOW
-// Original: | PERCENTILE_DISC
-| CONTROL_FLOWPERCENTILE_DISCCONTROL_FLOW
-;
-
-// Original: dependentValueExpression
-CONTROL_FLOWdependentValueExpressionCONTROL_FLOW
-// Original: : setQuantifier? numericValueExpression
-: CONTROL_FLOWsetQuantifierCONTROL_FLOW? CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// Original: independentValueExpression
-CONTROL_FLOWindependentValueExpressionCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// 20.10 <element_id function>
-
-// Original: element_idFunction
-CONTROL_FLOWelement_idFunctionCONTROL_FLOW
-// Original: : ELEMENT_ID LEFT_PAREN elementVariableReference RIGHT_PAREN
-// Original: : ELEMENT_ID LEFT_PAREN elementVariableReference PUNCTUATION_OPERATOR
-// Original: : DATA_TYPE LEFT_PAREN elementVariableReference PUNCTUATION_OPERATOR
-: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 20.11 <property reference>
-
-// 20.12 <binding variable reference>
-
-// Original: bindingVariableReference
-CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
-// Original: : bindingVariable
-: CONTROL_FLOWbindingVariableCONTROL_FLOW
-;
-
-// The path value expression was combined with list and string value expressions.
-// See listStringOrPathValueExpression.
-
-// Original: pathValueExpression
-CONTROL_FLOWpathValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.14 <path value constructor>
-
-// Original: pathValueConstructor
-CONTROL_FLOWpathValueConstructorCONTROL_FLOW
-// Original: : pathValueConstructorByEnumeration
-: CONTROL_FLOWpathValueConstructorByEnumerationCONTROL_FLOW
-;
-
-// Original: pathValueConstructorByEnumeration
-CONTROL_FLOWpathValueConstructorByEnumerationCONTROL_FLOW
-// Original: : PATH LEFT_BRACKET pathElementList RIGHT_BRACKET
-// Original: : KEYWORD LEFT_BRACKET pathElementList RIGHT_BRACKET
-// Original: : KEYWORD PUNCTUATION_OPERATOR pathElementList RIGHT_BRACKET
-: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWpathElementListCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW
-;
-
-// Original: pathElementList
-CONTROL_FLOWpathElementListCONTROL_FLOW
-: pathElementListStart pathElementListStep*
-;
-
-// Original: pathElementListStart
-CONTROL_FLOWpathElementListStartCONTROL_FLOW
-// Original: : nodeReferenceValueExpression
-: CONTROL_FLOWnodeReferenceValueExpressionCONTROL_FLOW
-;
-
-// Original: pathElementListStep
-CONTROL_FLOWpathElementListStepCONTROL_FLOW
-// Original: : COMMA edgeReferenceValueExpression COMMA nodeReferenceValueExpression
-: CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWedgeReferenceValueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnodeReferenceValueExpressionCONTROL_FLOW
-;
-
-// 20.15 <list value expression>
-
-// The list value expression was combined with path and string value expressions.
-// See listStringOrPathValueExpression.
-
-// Original: listValueExpression
-CONTROL_FLOWlistValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.16 <list value function>
-
-// Original: // Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
-// CONTROL_FLOWNoteCONTROL_FLOW: CONTROL_FLOWByteStringCONTROL_FLOW CONTROL_FLOWfunctionsCONTROL_FLOW CONTROL_FLOWwereCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterByteStringOrListFunctionCONTROL_FLOW, CONTROL_FLOWsomeCONTROL_FLOW CONTROL_FLOWalternativesCONTROL_FLOW
-// Original: // apply to characterString, byteString and list. Breaking them out separately resulted in
-// CONTROL_FLOWapplyCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterStringCONTROL_FLOW, CONTROL_FLOWbyteStringCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWlistCONTROL_FLOW. CONTROL_FLOWBreakingCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWseparatelyCONTROL_FLOW CONTROL_FLOWresultedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW
-// ambiguity.
-
-// Original: listValueFunction
-CONTROL_FLOWlistValueFunctionCONTROL_FLOW
-// Original: : trimListFunction
-: CONTROL_FLOWtrimListFunctionCONTROL_FLOW
-// Original: | elementsFunction
-| CONTROL_FLOWelementsFunctionCONTROL_FLOW
-;
-
-// Original: trimListFunction
-CONTROL_FLOWtrimListFunctionCONTROL_FLOW
-// Original: : TRIM LEFT_PAREN listValueExpression COMMA numericValueExpression RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN listValueExpression COMMA numericValueExpression RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN listValueExpression COMMA numericValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlistValueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: elementsFunction
-CONTROL_FLOWelementsFunctionCONTROL_FLOW
-// Original: : ELEMENTS LEFT_PAREN pathValueExpression RIGHT_PAREN
-// Original: : ELEMENTS LEFT_PAREN pathValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWELEMENTSCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWpathValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 20.17 <list value constructor>
-
-// Original: listValueConstructor
-CONTROL_FLOWlistValueConstructorCONTROL_FLOW
-// Original: : listValueConstructorByEnumeration
-: CONTROL_FLOWlistValueConstructorByEnumerationCONTROL_FLOW
-;
-
-// Original: listValueConstructorByEnumeration
-CONTROL_FLOWlistValueConstructorByEnumerationCONTROL_FLOW
-// Original: : listValueTypeName? LEFT_BRACKET listElementList? RIGHT_BRACKET
-// Original: : listValueTypeName? PUNCTUATION_OPERATOR listElementList? RIGHT_BRACKET
-: CONTROL_FLOWlistValueTypeNameCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWlistElementListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW
-;
-
-// Original: listElementList
-CONTROL_FLOWlistElementListCONTROL_FLOW
-// Original: : listElement (COMMA listElement)*
-: listElement (PUNCTUATION_OPERATOR listElement)*
-;
-
-// Original: listElement
-CONTROL_FLOWlistElementCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.18 <record constructor>
-
-// Original: recordConstructor
-CONTROL_FLOWrecordConstructorCONTROL_FLOW
-// Original: : RECORD? fieldsSpecification
-: CONTROL_FLOWRECORDCONTROL_FLOW? CONTROL_FLOWfieldsSpecificationCONTROL_FLOW
-;
-
-// Original: fieldsSpecification
-CONTROL_FLOWfieldsSpecificationCONTROL_FLOW
-// Original: : LEFT_BRACE fieldList? RIGHT_BRACE
-: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWfieldListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
-;
-
-// Original: fieldList
-CONTROL_FLOWfieldListCONTROL_FLOW
-// Original: : field (COMMA field)*
-: field (PUNCTUATION_OPERATOR field)*
-;
-
-// 20.19 <field>
-
-// Original: field
-CONTROL_FLOWfieldCONTROL_FLOW
-// Original: : fieldName COLON valueExpression
-: CONTROL_FLOWfieldNameCONTROL_FLOW CONTROL_FLOWCOLONCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.20 <boolean value expression>
-
-// Original: // Most of <boolean value expression> is incorporated in valueExpression
-// CONTROL_FLOWMostCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW <CONTROL_FLOWbooleanCONTROL_FLOW CONTROL_FLOWvalueCONTROL_FLOW CONTROL_FLOWexpressionCONTROL_FLOW> CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWincorporatedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
-
-// Original: truthValue
-CONTROL_FLOWtruthValueCONTROL_FLOW
-// Original: : BOOLEAN_LITERAL
-: CONTROL_FLOWBOOLEAN_LITERALCONTROL_FLOW
-;
-
-// 20.21 <numeric value expression>
-
-// Original: numericValueExpression
-CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-// Original: : sign = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
-: CONTROL_FLOWsignCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-// Original: | numericValueExpression operator = (ASTERISK | SOLIDUS) numericValueExpression
-| CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWASTERISKCONTROL_FLOW | CONTROL_FLOWSOLIDUSCONTROL_FLOW) CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-// Original: | numericValueExpression operator = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
-| CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-// Original: | valueExpressionPrimary
-| CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
-// Original: | numericValueFunction
-| CONTROL_FLOWnumericValueFunctionCONTROL_FLOW
-;
-
-// 20.22 <numeric value function>
-
-// Original: numericValueFunction
-CONTROL_FLOWnumericValueFunctionCONTROL_FLOW
-// Original: : lengthExpression
-: CONTROL_FLOWlengthExpressionCONTROL_FLOW
-// Original: | cardinalityExpression
-| CONTROL_FLOWcardinalityExpressionCONTROL_FLOW
-// Original: | absoluteValueExpression
-| CONTROL_FLOWabsoluteValueExpressionCONTROL_FLOW
-// Original: | modulusExpression
-| CONTROL_FLOWmodulusExpressionCONTROL_FLOW
-// Original: | trigonometricFunction
-| CONTROL_FLOWtrigonometricFunctionCONTROL_FLOW
-// Original: | generalLogarithmFunction
-| CONTROL_FLOWgeneralLogarithmFunctionCONTROL_FLOW
-// Original: | commonLogarithm
-| CONTROL_FLOWcommonLogarithmCONTROL_FLOW
-// Original: | naturalLogarithm
-| CONTROL_FLOWnaturalLogarithmCONTROL_FLOW
-// Original: | exponentialFunction
-| CONTROL_FLOWexponentialFunctionCONTROL_FLOW
-// Original: | powerFunction
-| CONTROL_FLOWpowerFunctionCONTROL_FLOW
-// Original: | squareRoot
-| CONTROL_FLOWsquareRootCONTROL_FLOW
-// Original: | floorFunction
-| CONTROL_FLOWfloorFunctionCONTROL_FLOW
-// Original: | ceilingFunction
-| CONTROL_FLOWceilingFunctionCONTROL_FLOW
-;
-
-// Original: lengthExpression
-CONTROL_FLOWlengthExpressionCONTROL_FLOW
-// Original: : charLengthExpression
-: CONTROL_FLOWcharLengthExpressionCONTROL_FLOW
-// Original: | byteLengthExpression
-| CONTROL_FLOWbyteLengthExpressionCONTROL_FLOW
-// Original: | pathLengthExpression
-| CONTROL_FLOWpathLengthExpressionCONTROL_FLOW
-;
-
-// Original: cardinalityExpression
-CONTROL_FLOWcardinalityExpressionCONTROL_FLOW
-// Original: : CARDINALITY LEFT_PAREN cardinalityExpressionArgument RIGHT_PAREN
-// Original: : CARDINALITY LEFT_PAREN cardinalityExpressionArgument PUNCTUATION_OPERATOR
-: CONTROL_FLOWCARDINALITYCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWcardinalityExpressionArgumentCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-// Original: | SIZE LEFT_PAREN listValueExpression RIGHT_PAREN
-// Original: | DATA_TYPE LEFT_PAREN listValueExpression RIGHT_PAREN
-// Original: | DATA_TYPE LEFT_PAREN listValueExpression PUNCTUATION_OPERATOR
-| CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlistValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: cardinalityExpressionArgument
-CONTROL_FLOWcardinalityExpressionArgumentCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: charLengthExpression
-CONTROL_FLOWcharLengthExpressionCONTROL_FLOW
-// Original: : (CHAR_LENGTH | CHARACTER_LENGTH) LEFT_PAREN characterStringValueExpression RIGHT_PAREN
-// Original: : (CHAR_LENGTH | CHARACTER_LENGTH) LEFT_PAREN characterStringValueExpression PUNCTUATION_OPERATOR
-: (CONTROL_FLOWCHAR_LENGTHCONTROL_FLOW | CONTROL_FLOWCHARACTER_LENGTHCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWcharacterStringValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: byteLengthExpression
-CONTROL_FLOWbyteLengthExpressionCONTROL_FLOW
-// Original: : (BYTE_LENGTH | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression RIGHT_PAREN
-// Original: : (DATA_TYPE | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression RIGHT_PAREN
-// Original: : (DATA_TYPE | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression PUNCTUATION_OPERATOR
-// Original: : (DATA_TYPE | FUNCTION) LEFT_PAREN byteStringValueExpression PUNCTUATION_OPERATOR
-: (CONTROL_FLOWDATA_TYPECONTROL_FLOW | CONTROL_FLOWFUNCTIONCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWbyteStringValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: pathLengthExpression
-CONTROL_FLOWpathLengthExpressionCONTROL_FLOW
-// Original: : PATH_LENGTH LEFT_PAREN pathValueExpression RIGHT_PAREN
-// Original: : PATH_LENGTH LEFT_PAREN pathValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWPATH_LENGTHCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWpathValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// absoluteValueExpression applies to both numeric types and duration types. They have the same syntax.
-// Original: absoluteValueExpression
-CONTROL_FLOWabsoluteValueExpressionCONTROL_FLOW
-// Original: : ABS LEFT_PAREN valueExpression RIGHT_PAREN
-// Original: : ABS LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
-// Original: : FUNCTION LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: modulusExpression
-CONTROL_FLOWmodulusExpressionCONTROL_FLOW
-// Original: : MOD LEFT_PAREN numericValueExpressionDividend COMMA numericValueExpressionDivisor RIGHT_PAREN
-// Original: : MOD LEFT_PAREN numericValueExpressionDividend COMMA numericValueExpressionDivisor PUNCTUATION_OPERATOR
-: CONTROL_FLOWMODCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionDividendCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnumericValueExpressionDivisorCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: numericValueExpressionDividend
-CONTROL_FLOWnumericValueExpressionDividendCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// Original: numericValueExpressionDivisor
-CONTROL_FLOWnumericValueExpressionDivisorCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// Original: trigonometricFunction
-CONTROL_FLOWtrigonometricFunctionCONTROL_FLOW
-// Original: : trigonometricFunctionName LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : trigonometricFunctionName LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWtrigonometricFunctionNameCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: trigonometricFunctionName
-CONTROL_FLOWtrigonometricFunctionNameCONTROL_FLOW
-// Original: : SIN
-: CONTROL_FLOWSINCONTROL_FLOW
-// Original: | COS
-| CONTROL_FLOWCOSCONTROL_FLOW
-// Original: | TAN
-| CONTROL_FLOWTANCONTROL_FLOW
-// Original: | COT
-| CONTROL_FLOWCOTCONTROL_FLOW
-// Original: | SINH
-| CONTROL_FLOWSINHCONTROL_FLOW
-// Original: | COSH
-| CONTROL_FLOWCOSHCONTROL_FLOW
-// Original: | TANH
-| CONTROL_FLOWTANHCONTROL_FLOW
-// Original: | ASIN
-| CONTROL_FLOWASINCONTROL_FLOW
-// Original: | ACOS
-| CONTROL_FLOWACOSCONTROL_FLOW
-// Original: | ATAN
-| CONTROL_FLOWATANCONTROL_FLOW
-// Original: | DEGREES
-| CONTROL_FLOWDEGREESCONTROL_FLOW
-// Original: | RADIANS
-| CONTROL_FLOWRADIANSCONTROL_FLOW
-;
-
-// Original: generalLogarithmFunction
-CONTROL_FLOWgeneralLogarithmFunctionCONTROL_FLOW
-// Original: : LOG LEFT_PAREN generalLogarithmBase COMMA generalLogarithmArgument RIGHT_PAREN
-// Original: : LOG LEFT_PAREN generalLogarithmBase COMMA generalLogarithmArgument PUNCTUATION_OPERATOR
-: CONTROL_FLOWLOGCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWgeneralLogarithmBaseCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWgeneralLogarithmArgumentCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: generalLogarithmBase
-CONTROL_FLOWgeneralLogarithmBaseCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// Original: generalLogarithmArgument
-CONTROL_FLOWgeneralLogarithmArgumentCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// Original: commonLogarithm
-CONTROL_FLOWcommonLogarithmCONTROL_FLOW
-// Original: : LOG10 LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: naturalLogarithm
-CONTROL_FLOWnaturalLogarithmCONTROL_FLOW
-// Original: : LN LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : LN LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWLNCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: exponentialFunction
-CONTROL_FLOWexponentialFunctionCONTROL_FLOW
-// Original: : EXP LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : EXP LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWEXPCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: powerFunction
-CONTROL_FLOWpowerFunctionCONTROL_FLOW
-// Original: : POWER LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent RIGHT_PAREN
-// Original: : POWER LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent PUNCTUATION_OPERATOR
-// Original: : FUNCTION LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent PUNCTUATION_OPERATOR
-: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionBaseCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnumericValueExpressionExponentCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: numericValueExpressionBase
-CONTROL_FLOWnumericValueExpressionBaseCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// Original: numericValueExpressionExponent
-CONTROL_FLOWnumericValueExpressionExponentCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// Original: squareRoot
-CONTROL_FLOWsquareRootCONTROL_FLOW
-// Original: : SQRT LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : SQRT LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWSQRTCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: floorFunction
-CONTROL_FLOWfloorFunctionCONTROL_FLOW
-// Original: : FLOOR LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : FUNCTION LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
-: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: ceilingFunction
-CONTROL_FLOWceilingFunctionCONTROL_FLOW
-// Original: : (CEIL | CEILING) LEFT_PAREN numericValueExpression RIGHT_PAREN
-// Original: : (CEIL | CEILING) LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
-: (CONTROL_FLOWCEILCONTROL_FLOW | CONTROL_FLOWCEILINGCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// 20.23 <string value expression>
-
-// The string value expressions were combined with list and path value expressions.
-
-// Original: characterStringValueExpression
-CONTROL_FLOWcharacterStringValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: byteStringValueExpression
-CONTROL_FLOWbyteStringValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.24 <string value function>
-
-// Original: // Note: String functions were moved to characterByteStringOrListFunction, some alternatives
-// CONTROL_FLOWNoteCONTROL_FLOW: CONTROL_FLOWStringCONTROL_FLOW CONTROL_FLOWfunctionsCONTROL_FLOW CONTROL_FLOWwereCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterByteStringOrListFunctionCONTROL_FLOW, CONTROL_FLOWsomeCONTROL_FLOW CONTROL_FLOWalternativesCONTROL_FLOW
-// Original: // apply to characterString, byteString and list. Breaking them out separately resulted in
-// CONTROL_FLOWapplyCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterStringCONTROL_FLOW, CONTROL_FLOWbyteStringCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWlistCONTROL_FLOW. CONTROL_FLOWBreakingCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWseparatelyCONTROL_FLOW CONTROL_FLOWresultedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW
-// ambiguity.
-
-// Original: trimOperands
-CONTROL_FLOWtrimOperandsCONTROL_FLOW
-// Original: : (trimSpecification? trimCharacterOrByteString? FROM)? trimCharacterOrByteStringSource
-: (CONTROL_FLOWtrimSpecificationCONTROL_FLOW? CONTROL_FLOWtrimCharacterOrByteStringCONTROL_FLOW? CONTROL_FLOWFROMCONTROL_FLOW)? CONTROL_FLOWtrimCharacterOrByteStringSourceCONTROL_FLOW
-;
-
-// Original: trimCharacterOrByteStringSource
-CONTROL_FLOWtrimCharacterOrByteStringSourceCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: trimSpecification
-CONTROL_FLOWtrimSpecificationCONTROL_FLOW
-// Original: : LEADING
-: CONTROL_FLOWLEADINGCONTROL_FLOW
-// Original: | TRAILING
-| CONTROL_FLOWTRAILINGCONTROL_FLOW
-// Original: | BOTH
-| CONTROL_FLOWBOTHCONTROL_FLOW
-;
-
-// Original: trimCharacterOrByteString
-CONTROL_FLOWtrimCharacterOrByteStringCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: normalForm
-CONTROL_FLOWnormalFormCONTROL_FLOW
-// Original: : NFC
-: CONTROL_FLOWNFCCONTROL_FLOW
-// Original: | NFD
-| CONTROL_FLOWNFDCONTROL_FLOW
-// Original: | NFKC
-| CONTROL_FLOWNFKCCONTROL_FLOW
-// Original: | NFKD
-| CONTROL_FLOWNFKDCONTROL_FLOW
-;
-
-// Original: stringLength
-CONTROL_FLOWstringLengthCONTROL_FLOW
-// Original: : numericValueExpression
-: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
-;
-
-// 20.25 <byte string function>
-
-// Original: // Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
-// CONTROL_FLOWNoteCONTROL_FLOW: CONTROL_FLOWByteStringCONTROL_FLOW CONTROL_FLOWfunctionsCONTROL_FLOW CONTROL_FLOWwereCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterByteStringOrListFunctionCONTROL_FLOW, CONTROL_FLOWsomeCONTROL_FLOW CONTROL_FLOWalternativesCONTROL_FLOW
-// Original: // apply to characterString, byteString and list. Breaking them out separately resulted in
-// CONTROL_FLOWapplyCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterStringCONTROL_FLOW, CONTROL_FLOWbyteStringCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWlistCONTROL_FLOW. CONTROL_FLOWBreakingCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWseparatelyCONTROL_FLOW CONTROL_FLOWresultedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW
-// ambiguity.
-
-// 20.26 <datetime value expression>
-
-// The implementation should enforce that the data type is a datetime value.
-// Original: datetimeValueExpression
-CONTROL_FLOWdatetimeValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// 20.27 <datetime value function>
-
-// Original: datetimeValueFunction
-CONTROL_FLOWdatetimeValueFunctionCONTROL_FLOW
-// Original: : dateFunction
-: CONTROL_FLOWdateFunctionCONTROL_FLOW
-// Original: | timeFunction
-| CONTROL_FLOWtimeFunctionCONTROL_FLOW
-// Original: | datetimeFunction
-| CONTROL_FLOWdatetimeFunctionCONTROL_FLOW
-// Original: | localtimeFunction
-| CONTROL_FLOWlocaltimeFunctionCONTROL_FLOW
-// Original: | localdatetimeFunction
-| CONTROL_FLOWlocaldatetimeFunctionCONTROL_FLOW
-;
-
-// Original: dateFunction
-CONTROL_FLOWdateFunctionCONTROL_FLOW
-// Original: : CURRENT_DATE
-: CONTROL_FLOWCURRENT_DATECONTROL_FLOW
-// Original: | DATE LEFT_PAREN dateFunctionParameters? RIGHT_PAREN
-// Original: | DATE LEFT_PAREN dateFunctionParameters? PUNCTUATION_OPERATOR
-| CONTROL_FLOWDATECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdateFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: timeFunction
-CONTROL_FLOWtimeFunctionCONTROL_FLOW
-// Original: : CURRENT_TIME
-: CONTROL_FLOWCURRENT_TIMECONTROL_FLOW
-// Original: | ZONED_TIME LEFT_PAREN timeFunctionParameters? RIGHT_PAREN
-// Original: | ZONED_TIME LEFT_PAREN timeFunctionParameters? PUNCTUATION_OPERATOR
-| CONTROL_FLOWZONED_TIMECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWtimeFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: localtimeFunction
-CONTROL_FLOWlocaltimeFunctionCONTROL_FLOW
-// Original: : LOCAL_TIME (LEFT_PAREN timeFunctionParameters? RIGHT_PAREN)?
-// Original: : LOCAL_TIME (LEFT_PAREN timeFunctionParameters? PUNCTUATION_OPERATOR)?
-: LOCAL_TIME (PUNCTUATION_OPERATOR timeFunctionParameters? PUNCTUATION_OPERATOR)?
-;
-
-// Original: datetimeFunction
-CONTROL_FLOWdatetimeFunctionCONTROL_FLOW
-// Original: : CURRENT_TIMESTAMP
-: CONTROL_FLOWCURRENT_TIMESTAMPCONTROL_FLOW
-// Original: | ZONED_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
-// Original: | ZONED_DATETIME LEFT_PAREN datetimeFunctionParameters? PUNCTUATION_OPERATOR
-| CONTROL_FLOWZONED_DATETIMECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdatetimeFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: localdatetimeFunction
-CONTROL_FLOWlocaldatetimeFunctionCONTROL_FLOW
-// Original: : LOCAL_TIMESTAMP
-: CONTROL_FLOWLOCAL_TIMESTAMPCONTROL_FLOW
-// Original: | LOCAL_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
-// Original: | LOCAL_DATETIME LEFT_PAREN datetimeFunctionParameters? PUNCTUATION_OPERATOR
-| CONTROL_FLOWLOCAL_DATETIMECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdatetimeFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: dateFunctionParameters
-CONTROL_FLOWdateFunctionParametersCONTROL_FLOW
-// Original: : dateString
-: CONTROL_FLOWdateStringCONTROL_FLOW
-// Original: | recordConstructor
-| CONTROL_FLOWrecordConstructorCONTROL_FLOW
-;
-
-// Original: timeFunctionParameters
-CONTROL_FLOWtimeFunctionParametersCONTROL_FLOW
-// Original: : timeString
-: CONTROL_FLOWtimeStringCONTROL_FLOW
-// Original: | recordConstructor
-| CONTROL_FLOWrecordConstructorCONTROL_FLOW
-;
-
-// Original: datetimeFunctionParameters
-CONTROL_FLOWdatetimeFunctionParametersCONTROL_FLOW
-// Original: : datetimeString
-: CONTROL_FLOWdatetimeStringCONTROL_FLOW
-// Original: | recordConstructor
-| CONTROL_FLOWrecordConstructorCONTROL_FLOW
-;
-
-// 20.28 <duration value expression>
-
-// The implemenation should enforce that the data type is a duration value.
-// Original: durationValueExpression
-CONTROL_FLOWdurationValueExpressionCONTROL_FLOW
-// Original: : valueExpression
-: CONTROL_FLOWvalueExpressionCONTROL_FLOW
-;
-
-// Original: datetimeSubtraction
-CONTROL_FLOWdatetimeSubtractionCONTROL_FLOW
-// Original: : DURATION_BETWEEN LEFT_PAREN datetimeSubtractionParameters RIGHT_PAREN temporalDurationQualifier?
-// Original: : DURATION_BETWEEN LEFT_PAREN datetimeSubtractionParameters PUNCTUATION_OPERATOR temporalDurationQualifier?
-// Original: : DATA_TYPE LEFT_PAREN datetimeSubtractionParameters PUNCTUATION_OPERATOR temporalDurationQualifier?
-: DATA_TYPE PUNCTUATION_OPERATOR datetimeSubtractionParameters PUNCTUATION_OPERATOR temporalDurationQualifier?
-;
-
-// Original: datetimeSubtractionParameters
-CONTROL_FLOWdatetimeSubtractionParametersCONTROL_FLOW
-// Original: : datetimeValueExpression1 COMMA datetimeValueExpression2
-: CONTROL_FLOWdatetimeValueExpression1CONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWdatetimeValueExpression2CONTROL_FLOW
-;
-
-// Original: datetimeValueExpression1
-CONTROL_FLOWdatetimeValueExpression1CONTROL_FLOW
-// Original: : datetimeValueExpression
-: CONTROL_FLOWdatetimeValueExpressionCONTROL_FLOW
-;
-
-// Original: datetimeValueExpression2
-CONTROL_FLOWdatetimeValueExpression2CONTROL_FLOW
-// Original: : datetimeValueExpression
-: CONTROL_FLOWdatetimeValueExpressionCONTROL_FLOW
-;
-
-// 20.29 <duration value function>
-
-// Original: durationValueFunction
-CONTROL_FLOWdurationValueFunctionCONTROL_FLOW
-// Original: : durationFunction
-: CONTROL_FLOWdurationFunctionCONTROL_FLOW
-// Original: | absoluteValueExpression
-| CONTROL_FLOWabsoluteValueExpressionCONTROL_FLOW
-;
-
-// Original: durationFunction
-CONTROL_FLOWdurationFunctionCONTROL_FLOW
-// Original: : DURATION LEFT_PAREN durationFunctionParameters RIGHT_PAREN
-// Original: : DURATION LEFT_PAREN durationFunctionParameters PUNCTUATION_OPERATOR
-: CONTROL_FLOWDURATIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdurationFunctionParametersCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
-;
-
-// Original: durationFunctionParameters
-CONTROL_FLOWdurationFunctionParametersCONTROL_FLOW
-// Original: : durationString
-: CONTROL_FLOWdurationStringCONTROL_FLOW
-// Original: | recordConstructor
-| CONTROL_FLOWrecordConstructorCONTROL_FLOW
-;
-
-// Original: // 21.1 Names and Variables
-// CONTROL_FLOW21CONTROL_FLOW.CONTROL_FLOW1CONTROL_FLOW CONTROL_FLOWNamesCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWVariablesCONTROL_FLOW
-
-// Original: objectName
-CONTROL_FLOWobjectNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: objectNameOrBindingVariable
-CONTROL_FLOWobjectNameOrBindingVariableCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-;
-
-// Original: directoryName
-CONTROL_FLOWdirectoryNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: schemaName
-CONTROL_FLOWschemaNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: graphName
-CONTROL_FLOWgraphNameCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-// Original: | delimitedGraphName
-| CONTROL_FLOWdelimitedGraphNameCONTROL_FLOW
-;
-
-// Original: delimitedGraphName
-CONTROL_FLOWdelimitedGraphNameCONTROL_FLOW
-// Original: // DELIMITED_IDENTIFIER
-// CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
-// Original: : DOUBLE_QUOTED_CHARACTER_SEQUENCE
-: CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
-| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: graphTypeName
-CONTROL_FLOWgraphTypeNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: nodeTypeName
-CONTROL_FLOWnodeTypeNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: edgeTypeName
-CONTROL_FLOWedgeTypeNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: bindingTableName
-CONTROL_FLOWbindingTableNameCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-// Original: | delimitedBindingTableName
-| CONTROL_FLOWdelimitedBindingTableNameCONTROL_FLOW
-;
-
-// Original: delimitedBindingTableName
-CONTROL_FLOWdelimitedBindingTableNameCONTROL_FLOW
-// Original: // DELIMITED_IDENTIFIER
-// CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
-// Original: : DOUBLE_QUOTED_CHARACTER_SEQUENCE
-: CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
-| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: procedureName
-CONTROL_FLOWprocedureNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: labelName
-CONTROL_FLOWlabelNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: propertyName
-CONTROL_FLOWpropertyNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: fieldName
-CONTROL_FLOWfieldNameCONTROL_FLOW
-// Original: : identifier
-: CONTROL_FLOWidentifierCONTROL_FLOW
-;
-
-// Original: elementVariable
-CONTROL_FLOWelementVariableCONTROL_FLOW
-// Original: : bindingVariable
-: CONTROL_FLOWbindingVariableCONTROL_FLOW
-;
-
-// Original: pathVariable
-CONTROL_FLOWpathVariableCONTROL_FLOW
-// Original: : bindingVariable
-: CONTROL_FLOWbindingVariableCONTROL_FLOW
-;
-
-// Original: subpathVariable
-CONTROL_FLOWsubpathVariableCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-;
-
-// Original: bindingVariable
-CONTROL_FLOWbindingVariableCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-;
-
-// 21.2 <literal>
-
-// Original: unsignedLiteral
-CONTROL_FLOWunsignedLiteralCONTROL_FLOW
-// Original: : unsignedNumericLiteral
-: CONTROL_FLOWunsignedNumericLiteralCONTROL_FLOW
-// Original: | generalLiteral
-| CONTROL_FLOWgeneralLiteralCONTROL_FLOW
-;
-
-// Original: generalLiteral
-CONTROL_FLOWgeneralLiteralCONTROL_FLOW
-// Original: : BOOLEAN_LITERAL
-: CONTROL_FLOWBOOLEAN_LITERALCONTROL_FLOW
-// Original: | characterStringLiteral
-| CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
-// Original: | BYTE_STRING_LITERAL
-| CONTROL_FLOWBYTE_STRING_LITERALCONTROL_FLOW
-// Original: | temporalLiteral
-| CONTROL_FLOWtemporalLiteralCONTROL_FLOW
-// Original: | durationLiteral
-| CONTROL_FLOWdurationLiteralCONTROL_FLOW
-// Original: | nullLiteral
-| CONTROL_FLOWnullLiteralCONTROL_FLOW
-// Original: | listLiteral
-| CONTROL_FLOWlistLiteralCONTROL_FLOW
-// Original: | recordLiteral
-| CONTROL_FLOWrecordLiteralCONTROL_FLOW
-;
-
-// Original: temporalLiteral
-CONTROL_FLOWtemporalLiteralCONTROL_FLOW
-// Original: : dateLiteral
-: CONTROL_FLOWdateLiteralCONTROL_FLOW
-// Original: | timeLiteral
-| CONTROL_FLOWtimeLiteralCONTROL_FLOW
-// Original: | datetimeLiteral
-| CONTROL_FLOWdatetimeLiteralCONTROL_FLOW
-// Original: //    | sqlDatetimeLiteral
-//    | CONTROL_FLOWsqlDatetimeLiteralCONTROL_FLOW
-;
-
-// Original: dateLiteral
-CONTROL_FLOWdateLiteralCONTROL_FLOW
-// Original: : DATE dateString
-: CONTROL_FLOWDATECONTROL_FLOW CONTROL_FLOWdateStringCONTROL_FLOW
-;
-
-// Original: timeLiteral
-CONTROL_FLOWtimeLiteralCONTROL_FLOW
-// Original: : TIME timeString
-: CONTROL_FLOWTIMECONTROL_FLOW CONTROL_FLOWtimeStringCONTROL_FLOW
-;
-
-// Original: datetimeLiteral
-CONTROL_FLOWdatetimeLiteralCONTROL_FLOW
-// Original: : (DATETIME | TIMESTAMP) datetimeString
-: (CONTROL_FLOWDATETIMECONTROL_FLOW | CONTROL_FLOWTIMESTAMPCONTROL_FLOW) CONTROL_FLOWdatetimeStringCONTROL_FLOW
-;
-
-// Original: listLiteral
-CONTROL_FLOWlistLiteralCONTROL_FLOW
-// Original: : listValueConstructorByEnumeration
-: CONTROL_FLOWlistValueConstructorByEnumerationCONTROL_FLOW
-;
-
-// Original: recordLiteral
-CONTROL_FLOWrecordLiteralCONTROL_FLOW
-// Original: : recordConstructor
-: CONTROL_FLOWrecordConstructorCONTROL_FLOW
-;
-
-// Original: identifier
-CONTROL_FLOWidentifierCONTROL_FLOW
-// Original: : regularIdentifier
-: CONTROL_FLOWregularIdentifierCONTROL_FLOW
-// Original: // DELIMITED_IDENTIFIER
-// CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
-// Original: | DOUBLE_QUOTED_CHARACTER_SEQUENCE
-| CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
-| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: regularIdentifier
-CONTROL_FLOWregularIdentifierCONTROL_FLOW
-// Original: : REGULAR_IDENTIFIER
-: CONTROL_FLOWREGULAR_IDENTIFIERCONTROL_FLOW
-// Original: | nonReservedWords
-| CONTROL_FLOWnonReservedWordsCONTROL_FLOW
-;
-
-// Original: timeZoneString
-CONTROL_FLOWtimeZoneStringCONTROL_FLOW
-// Original: : characterStringLiteral
-: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
-;
-
-// Original: characterStringLiteral
-CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
-// Original: : SINGLE_QUOTED_CHARACTER_SEQUENCE
-: CONTROL_FLOWSINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: | DOUBLE_QUOTED_CHARACTER_SEQUENCE
-| CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: unsignedNumericLiteral
-CONTROL_FLOWunsignedNumericLiteralCONTROL_FLOW
-// Original: : exactNumericLiteral
-: CONTROL_FLOWexactNumericLiteralCONTROL_FLOW
-// Original: | approximateNumericLiteral
-| CONTROL_FLOWapproximateNumericLiteralCONTROL_FLOW
-;
-
-// Original: exactNumericLiteral
-CONTROL_FLOWexactNumericLiteralCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
-// Original: | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-| CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
-// Original: | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
-| CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
-// Original: | UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
-| CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
-// Original: | unsignedInteger
-| CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-;
-
-// Original: approximateNumericLiteral
-CONTROL_FLOWapproximateNumericLiteralCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-// Original: | UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
-| CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
-// Original: | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-| CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-// Original: | UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
-| CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-;
-
-// Original: unsignedInteger
-CONTROL_FLOWunsignedIntegerCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_INTEGER
-// Original: : DATA_TYPE
-: CONTROL_FLOWDATA_TYPECONTROL_FLOW
-// Original: | UNSIGNED_HEXADECIMAL_INTEGER
-| CONTROL_FLOWUNSIGNED_HEXADECIMAL_INTEGERCONTROL_FLOW
-// Original: | UNSIGNED_OCTAL_INTEGER
-// Original: | DATA_TYPE
-| CONTROL_FLOWDATA_TYPECONTROL_FLOW
-// Original: | UNSIGNED_BINARY_INTEGER
-| CONTROL_FLOWUNSIGNED_BINARY_INTEGERCONTROL_FLOW
-;
-
-// Original: unsignedDecimalInteger
-CONTROL_FLOWunsignedDecimalIntegerCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_INTEGER
-// Original: : DATA_TYPE
-: CONTROL_FLOWDATA_TYPECONTROL_FLOW
-;
-
-// Original: nullLiteral
-CONTROL_FLOWnullLiteralCONTROL_FLOW
-// Original: : NULL
-: CONTROL_FLOWNULLCONTROL_FLOW
-;
-
-// Original: dateString
-CONTROL_FLOWdateStringCONTROL_FLOW
-// Original: : characterStringLiteral
-: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
-;
-
-// Original: timeString
-CONTROL_FLOWtimeStringCONTROL_FLOW
-// Original: : characterStringLiteral
-: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
-;
-
-// Original: datetimeString
-CONTROL_FLOWdatetimeStringCONTROL_FLOW
-// Original: : characterStringLiteral
-: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
-;
-
-// Original: durationLiteral
-CONTROL_FLOWdurationLiteralCONTROL_FLOW
-// Original: : DURATION durationString
-: CONTROL_FLOWDURATIONCONTROL_FLOW CONTROL_FLOWdurationStringCONTROL_FLOW
-// Original: //    | sqlIntervalLiteral
-//    | CONTROL_FLOWsqlIntervalLiteralCONTROL_FLOW
-;
-
-// Original: durationString
-CONTROL_FLOWdurationStringCONTROL_FLOW
-// Original: : characterStringLiteral
-: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
-;
-
-// Original: nodeSynonym
-CONTROL_FLOWnodeSynonymCONTROL_FLOW
-// Original: : NODE
-: CONTROL_FLOWNODECONTROL_FLOW
-// Original: | VERTEX
-| CONTROL_FLOWVERTEXCONTROL_FLOW
-;
-
-// Original: edgesSynonym
-CONTROL_FLOWedgesSynonymCONTROL_FLOW
-// Original: : EDGES
-: CONTROL_FLOWEDGESCONTROL_FLOW
-// Original: | RELATIONSHIPS
-| CONTROL_FLOWRELATIONSHIPSCONTROL_FLOW
-;
-
-// Original: edgeSynonym
-CONTROL_FLOWedgeSynonymCONTROL_FLOW
-// Original: : EDGE
-: CONTROL_FLOWEDGECONTROL_FLOW
-// Original: | RELATIONSHIP
-| CONTROL_FLOWRELATIONSHIPCONTROL_FLOW
-;
-
-// Original: // 21.1 Names and Variables
-// CONTROL_FLOW21CONTROL_FLOW.CONTROL_FLOW1CONTROL_FLOW CONTROL_FLOWNamesCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWVariablesCONTROL_FLOW
-
-// Original: IMPLIES
-CONTROL_FLOWIMPLIESCONTROL_FLOW
-// Original: : RIGHT_DOUBLE_ARROW
-: CONTROL_FLOWRIGHT_DOUBLE_ARROWCONTROL_FLOW
-// Original: | 'IMPLIES'
-| 'CONTROL_FLOW'
-;
-
-// Original: fragment PARAMETER_NAME
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWPARAMETER_NAMECONTROL_FLOW
-// Original: : SEPARATED_IDENTIFIER
-: CONTROL_FLOWSEPARATED_IDENTIFIERCONTROL_FLOW
-;
-
-// 21.2 <literal>
-
-// Original: nonReservedWords
-CONTROL_FLOWnonReservedWordsCONTROL_FLOW
-// Original: : ACYCLIC
-: CONTROL_FLOWACYCLICCONTROL_FLOW
-// Original: | BINDING
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | BINDINGS
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | CONNECTING
-| CONTROL_FLOWCONNECTINGCONTROL_FLOW
-// Original: | DESTINATION
-| CONTROL_FLOWDESTINATIONCONTROL_FLOW
-// Original: | DIFFERENT
-| CONTROL_FLOWDIFFERENTCONTROL_FLOW
-// Original: | DIRECTED
-| CONTROL_FLOWDIRECTEDCONTROL_FLOW
-// Original: | EDGE
-| CONTROL_FLOWEDGECONTROL_FLOW
-// Original: | EDGES
-| CONTROL_FLOWEDGESCONTROL_FLOW
-// Original: | ELEMENT
-| CONTROL_FLOWELEMENTCONTROL_FLOW
-// Original: | ELEMENTS
-| CONTROL_FLOWELEMENTSCONTROL_FLOW
-// Original: | FIRST
-| CONTROL_FLOWFIRSTCONTROL_FLOW
-// Original: | GRAPH
-| CONTROL_FLOWGRAPHCONTROL_FLOW
-// Original: | GROUPS
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | KEEP
-| CONTROL_FLOWKEEPCONTROL_FLOW
-// Original: | LABEL
-| CONTROL_FLOWLABELCONTROL_FLOW
-// Original: | LABELED
-| CONTROL_FLOWLABELEDCONTROL_FLOW
-// Original: | LABELS
-| CONTROL_FLOWLABELSCONTROL_FLOW
-// Original: | LAST
-| CONTROL_FLOWLASTCONTROL_FLOW
-// Original: | NFC
-| CONTROL_FLOWNFCCONTROL_FLOW
-// Original: | NFD
-| CONTROL_FLOWNFDCONTROL_FLOW
-// Original: | NFKC
-| CONTROL_FLOWNFKCCONTROL_FLOW
-// Original: | NFKD
-| CONTROL_FLOWNFKDCONTROL_FLOW
-// Original: | NO
-| CONTROL_FLOWNOCONTROL_FLOW
-// Original: | NODE
-| CONTROL_FLOWNODECONTROL_FLOW
-// Original: | NORMALIZED
-| CONTROL_FLOWNORMALIZEDCONTROL_FLOW
-// Original: | ONLY
-| CONTROL_FLOWONLYCONTROL_FLOW
-// Original: | ORDINALITY
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | PROPERTY
-| CONTROL_FLOWPROPERTYCONTROL_FLOW
-// Original: | READ
-| CONTROL_FLOWREADCONTROL_FLOW
-// Original: | RELATIONSHIP
-| CONTROL_FLOWRELATIONSHIPCONTROL_FLOW
-// Original: | RELATIONSHIPS
-| CONTROL_FLOWRELATIONSHIPSCONTROL_FLOW
-// Original: | REPEATABLE
-| CONTROL_FLOWREPEATABLECONTROL_FLOW
-// Original: | SHORTEST
-| CONTROL_FLOWSHORTESTCONTROL_FLOW
-// Original: | SIMPLE
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | SOURCE
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | TABLE
-| CONTROL_FLOWTABLECONTROL_FLOW
-// Original: | TEMP
-| CONTROL_FLOWTEMPCONTROL_FLOW
-// Original: | TO
-// Original: | KEYWORD
-| CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: | TRAIL
-| CONTROL_FLOWTRAILCONTROL_FLOW
-// Original: | TRANSACTION
-| CONTROL_FLOWTRANSACTIONCONTROL_FLOW
-// Original: | TYPE
-| CONTROL_FLOWTYPECONTROL_FLOW
-// Original: | UNDIRECTED
-| CONTROL_FLOWUNDIRECTEDCONTROL_FLOW
-// Original: | VERTEX
-| CONTROL_FLOWVERTEXCONTROL_FLOW
-// Original: | WALK
-| CONTROL_FLOWWALKCONTROL_FLOW
-// Original: | WITHOUT
-| CONTROL_FLOWWITHOUTCONTROL_FLOW
-// Original: | WRITE
-| CONTROL_FLOWWRITECONTROL_FLOW
-// Original: | ZONE
-| CONTROL_FLOWZONECONTROL_FLOW
-;
-
-// Original: BOOLEAN_LITERAL
-CONTROL_FLOWBOOLEAN_LITERALCONTROL_FLOW
-// Original: : 'TRUE'
-: 'LITERAL'
-// Original: | 'FALSE'
-| 'LITERAL'
-| 'UNKNOWN'
-;
-
-// Original: SINGLE_QUOTED_CHARACTER_SEQUENCE
-CONTROL_FLOWSINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: : NO_ESCAPE? UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
-: CONTROL_FLOWNO_ESCAPECONTROL_FLOW? CONTROL_FLOWUNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: DOUBLE_QUOTED_CHARACTER_SEQUENCE
-CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: : NO_ESCAPE? UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
-: CONTROL_FLOWNO_ESCAPECONTROL_FLOW? CONTROL_FLOWUNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: ACCENT_QUOTED_CHARACTER_SEQUENCE
-CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: :NO_ESCAPE? UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
-:CONTROL_FLOWNO_ESCAPECONTROL_FLOW? CONTROL_FLOWUNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: NO_ESCAPE
-CONTROL_FLOWNO_ESCAPECONTROL_FLOW
-// Original: : COMMERCIAL_AT
-: CONTROL_FLOWCOMMERCIAL_ATCONTROL_FLOW
-;
-
-// Original: fragment UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: : QUOTE SINGLE_QUOTED_CHARACTER_REPRESENTATION* QUOTE
-: CONTROL_FLOWQUOTECONTROL_FLOW CONTROL_FLOWSINGLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW* CONTROL_FLOWQUOTECONTROL_FLOW
-;
-
-// Original: fragment UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: : DOUBLE_QUOTE DOUBLE_QUOTED_CHARACTER_REPRESENTATION* DOUBLE_QUOTE
-: CONTROL_FLOWDOUBLE_QUOTECONTROL_FLOW CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW* CONTROL_FLOWDOUBLE_QUOTECONTROL_FLOW
-;
-
-// Original: fragment UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: : GRAVE_ACCENT ACCENT_QUOTED_CHARACTER_REPRESENTATION* GRAVE_ACCENT
-: CONTROL_FLOWGRAVE_ACCENTCONTROL_FLOW CONTROL_FLOWACCENT_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW* CONTROL_FLOWGRAVE_ACCENTCONTROL_FLOW
-;
-
-// Original: fragment SINGLE_QUOTED_CHARACTER_REPRESENTATION:
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSINGLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW:
-(ESCAPED_CHARACTER | ~['\\\r\n])+
-;
-
-// Original: fragment DOUBLE_QUOTED_CHARACTER_REPRESENTATION:
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW:
-(ESCAPED_CHARACTER | ~["\\\r\n])+
-;
-
-// Original: fragment ACCENT_QUOTED_CHARACTER_REPRESENTATION:
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWACCENT_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW:
-(ESCAPED_CHARACTER | ~[`\\\r\n])+
-;
-
-// Original: fragment ESCAPED_CHARACTER
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_CHARACTERCONTROL_FLOW
-// Original: : ESCAPED_REVERSE_SOLIDUS
-: CONTROL_FLOWESCAPED_REVERSE_SOLIDUSCONTROL_FLOW
-// Original: | ESCAPED_QUOTE
-| CONTROL_FLOWESCAPED_QUOTECONTROL_FLOW
-// Original: | ESCAPED_DOUBLE_QUOTE
-| CONTROL_FLOWESCAPED_DOUBLE_QUOTECONTROL_FLOW
-// Original: | ESCAPED_GRAVE_ACCENT
-| CONTROL_FLOWESCAPED_GRAVE_ACCENTCONTROL_FLOW
-// Original: | ESCAPED_TAB
-| CONTROL_FLOWESCAPED_TABCONTROL_FLOW
-// Original: | ESCAPED_BACKSPACE
-| CONTROL_FLOWESCAPED_BACKSPACECONTROL_FLOW
-// Original: | ESCAPED_NEW_LINE
-| CONTROL_FLOWESCAPED_NEW_LINECONTROL_FLOW
-// Original: | ESCAPED_CARRIAGE_RETURN
-| CONTROL_FLOWESCAPED_CARRIAGE_RETURNCONTROL_FLOW
-// Original: | ESCAPED_FORM_FEED
-| CONTROL_FLOWESCAPED_FORM_FEEDCONTROL_FLOW
-// Original: | ESCAPED_UNICODE4_DIGIT_VALUE
-| CONTROL_FLOWESCAPED_UNICODE4_DIGIT_VALUECONTROL_FLOW
-// Original: | ESCAPED_UNICODE6_DIGIT_VALUE
-| CONTROL_FLOWESCAPED_UNICODE6_DIGIT_VALUECONTROL_FLOW
-;
-
-// Original: fragment ESCAPED_REVERSE_SOLIDUS: REVERSE_SOLIDUS REVERSE_SOLIDUS;
-// Original: fragment ESCAPED_REVERSE_SOLIDUS: PUNCTUATION_OPERATOR PUNCTUATION_OPERATOR;
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_REVERSE_SOLIDUSCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW;
-// Original: fragment ESCAPED_QUOTE: REVERSE_SOLIDUS QUOTE;
-// Original: fragment ESCAPED_QUOTE: PUNCTUATION_OPERATOR QUOTE;
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_QUOTECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWQUOTECONTROL_FLOW;
-// Original: fragment ESCAPED_DOUBLE_QUOTE: REVERSE_SOLIDUS DOUBLE_QUOTE;
-// Original: fragment ESCAPED_DOUBLE_QUOTE: PUNCTUATION_OPERATOR DOUBLE_QUOTE;
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_DOUBLE_QUOTECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWDOUBLE_QUOTECONTROL_FLOW;
-// Original: fragment ESCAPED_GRAVE_ACCENT: REVERSE_SOLIDUS GRAVE_ACCENT;
-// Original: fragment ESCAPED_GRAVE_ACCENT: PUNCTUATION_OPERATOR GRAVE_ACCENT;
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_GRAVE_ACCENTCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWGRAVE_ACCENTCONTROL_FLOW;
-// Original: fragment ESCAPED_TAB: REVERSE_SOLIDUS 't';
-// Original: fragment ESCAPED_TAB: PUNCTUATION_OPERATOR 't';
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_TABCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWtCONTROL_FLOW';
-// Original: fragment ESCAPED_BACKSPACE: REVERSE_SOLIDUS 'b';
-// Original: fragment ESCAPED_BACKSPACE: PUNCTUATION_OPERATOR 'b';
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_BACKSPACECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWbCONTROL_FLOW';
-// Original: fragment ESCAPED_NEW_LINE: REVERSE_SOLIDUS 'n';
-// Original: fragment ESCAPED_NEW_LINE: PUNCTUATION_OPERATOR 'n';
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_NEW_LINECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWnCONTROL_FLOW';
-// Original: fragment ESCAPED_CARRIAGE_RETURN: REVERSE_SOLIDUS 'r';
-// Original: fragment ESCAPED_CARRIAGE_RETURN: PUNCTUATION_OPERATOR 'r';
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_CARRIAGE_RETURNCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWrCONTROL_FLOW';
-// Original: fragment ESCAPED_FORM_FEED: REVERSE_SOLIDUS 'f';
-// Original: fragment ESCAPED_FORM_FEED: PUNCTUATION_OPERATOR 'f';
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_FORM_FEEDCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWfCONTROL_FLOW';
-// Original: fragment ESCAPED_UNICODE4_DIGIT_VALUE:
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_UNICODE4_DIGIT_VALUECONTROL_FLOW:
-// Original: REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-// Original: PUNCTUATION_OPERATOR 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWuCONTROL_FLOW' CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW;
-// Original: fragment ESCAPED_UNICODE6_DIGIT_VALUE:
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_UNICODE6_DIGIT_VALUECONTROL_FLOW:
-// Original: REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-// Original: PUNCTUATION_OPERATOR 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWuCONTROL_FLOW' CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW;
-
-// Todo: Finish this. It is tricky how it interacts with <separator>
-// Original: BYTE_STRING_LITERAL
-CONTROL_FLOWBYTE_STRING_LITERALCONTROL_FLOW
-// Original: : 'X' QUOTE SPACE* (HEX_DIGIT SPACE* HEX_DIGIT SPACE*)* QUOTE
-: 'CONTROL_FLOWXCONTROL_FLOW' CONTROL_FLOWQUOTECONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW* (CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW* CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW*)* CONTROL_FLOWQUOTECONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION EXACT_NUMBER_SUFFIX
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION APPROXIMATE_NUMBER_SUFFIX
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION EXACT_NUMBER_SUFFIX
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION APPROXIMATE_NUMBER_SUFFIX
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_INTEGER EXACT_NUMBER_SUFFIX
-// Original: : DATA_TYPE EXACT_NUMBER_SUFFIX
-: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
-CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_INTEGER APPROXIMATE_NUMBER_SUFFIX
-// Original: : DATA_TYPE APPROXIMATE_NUMBER_SUFFIX
-: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-;
-
-// Original: UNSIGNED_DECIMAL_INTEGER
-// Original: DATA_TYPE
-CONTROL_FLOWDATA_TYPECONTROL_FLOW
-// Original: : DIGIT (UNDERSCORE? DIGIT)*
-: DIGIT (PUNCTUATION_OPERATOR? DIGIT)*
-;
-
-// Original: fragment EXACT_NUMBER_SUFFIX
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
-: 'M'
-;
-
-// Original: fragment UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW
-// Original: : MANTISSA 'E' EXPONENT
-: CONTROL_FLOWMANTISSACONTROL_FLOW 'CONTROL_FLOWECONTROL_FLOW' CONTROL_FLOWEXPONENTCONTROL_FLOW
-;
-
-// Original: fragment MANTISSA
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWMANTISSACONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
-: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW
-// Original: | UNSIGNED_DECIMAL_INTEGER
-// Original: | DATA_TYPE
-| CONTROL_FLOWDATA_TYPECONTROL_FLOW
-;
-
-// Original: fragment EXPONENT
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWEXPONENTCONTROL_FLOW
-// Original: : SIGNED_DECIMAL_INTEGER
-: CONTROL_FLOWSIGNED_DECIMAL_INTEGERCONTROL_FLOW
-;
-
-// Original: fragment UNSIGNED_DECIMAL_IN_COMMON_NOTATION
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW
-// Original: : UNSIGNED_DECIMAL_INTEGER (PERIOD UNSIGNED_DECIMAL_INTEGER?)
-// Original: : DATA_TYPE (PERIOD DATA_TYPE?)
-: DATA_TYPE (PUNCTUATION_OPERATOR DATA_TYPE?)
-// Original: | PERIOD UNSIGNED_DECIMAL_INTEGER
-// Original: | PERIOD DATA_TYPE
-| CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWDATA_TYPECONTROL_FLOW
-;
-
-// Original: fragment SIGNED_DECIMAL_INTEGER
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSIGNED_DECIMAL_INTEGERCONTROL_FLOW
-// Original: : (PLUS_SIGN | MINUS_SIGN)? UNSIGNED_DECIMAL_INTEGER
-// Original: : (PLUS_SIGN | MINUS_SIGN)? DATA_TYPE
-: (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW)? CONTROL_FLOWDATA_TYPECONTROL_FLOW
-;
-
-// Original: UNSIGNED_HEXADECIMAL_INTEGER
-CONTROL_FLOWUNSIGNED_HEXADECIMAL_INTEGERCONTROL_FLOW
-: '0x' ('_'? HEX_DIGIT)+
-;
-
-// Original: UNSIGNED_OCTAL_INTEGER
-// Original: DATA_TYPE
-CONTROL_FLOWDATA_TYPECONTROL_FLOW
-: '0o' ('_'? OCTAL_DIGIT)+
-;
-
-// Original: UNSIGNED_BINARY_INTEGER
-CONTROL_FLOWUNSIGNED_BINARY_INTEGERCONTROL_FLOW
-: '0b' ('_'? BINARY_DIGIT)+
-;
-
-// Original: fragment APPROXIMATE_NUMBER_SUFFIX
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
-: 'F'
-| 'D'
-;
-
-// 21.3 <token>, <separator>, and <identifier>
-
-// Original: // Reserved words
-// CONTROL_FLOWReservedCONTROL_FLOW CONTROL_FLOWwordsCONTROL_FLOW
-ABS: 'ABS';
-ACOS: 'ACOS';
-ALL: 'ALL';
-ALL_DIFFERENT: 'ALL_DIFFERENT';
-AND: 'AND';
-ANY: 'ANY';
-ARRAY: 'ARRAY';
-AS: 'AS';
-ASC: 'ASC';
-ASCENDING: 'ASCENDING';
-ASIN: 'ASIN';
-AT: 'AT';
-ATAN: 'ATAN';
-AVG: 'AVG';
-BIG: 'BIG';
-BIGINT: 'BIGINT';
-BINARY: 'BINARY';
-BOOL: 'BOOL';
-BOOLEAN: 'BOOLEAN';
-BOTH: 'BOTH';
-BTRIM: 'BTRIM';
-BY: 'BY';
-BYTE_LENGTH: 'BYTE_LENGTH';
-BYTES: 'BYTES';
-CALL: 'CALL';
-CARDINALITY: 'CARDINALITY';
-CASE: 'CASE';
-CAST: 'CAST';
-CEIL: 'CEIL';
-CEILING: 'CEILING';
-CHAR: 'CHAR';
-CHAR_LENGTH: 'CHAR_LENGTH';
-CHARACTER_LENGTH: 'CHARACTER_LENGTH';
-CHARACTERISTICS: 'CHARACTERISTICS';
-CLOSE: 'CLOSE';
-COALESCE: 'COALESCE';
-COLLECT_LIST: 'COLLECT_LIST';
-COMMIT: 'COMMIT';
-COPY: 'COPY';
-COS: 'COS';
-COSH: 'COSH';
-COT: 'COT';
-COUNT: 'COUNT';
-CREATE: 'CREATE';
-CURRENT_DATE: 'CURRENT_DATE';
-CURRENT_GRAPH: 'CURRENT_GRAPH';
-CURRENT_PROPERTY_GRAPH: 'CURRENT_PROPERTY_GRAPH';
-CURRENT_SCHEMA: 'CURRENT_SCHEMA';
-CURRENT_TIME: 'CURRENT_TIME';
-CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
-DATE: 'DATE';
-DATETIME: 'DATETIME';
-DAY: 'DAY';
-DEC: 'DEC';
-DECIMAL: 'DECIMAL';
-DEGREES: 'DEGREES';
-DELETE: 'DELETE';
-DESC: 'DESC';
-DESCENDING: 'DESCENDING';
-DETACH: 'DETACH';
-DISTINCT: 'DISTINCT';
-DOUBLE: 'DOUBLE';
-DROP: 'DROP';
-DURATION: 'DURATION';
-DURATION_BETWEEN: 'DURATION_BETWEEN';
-ELEMENT_ID: 'ELEMENT_ID';
-ELSE: 'ELSE';
-END: 'END';
-EXCEPT: 'EXCEPT';
-EXISTS: 'EXISTS';
-EXP: 'EXP';
-FILTER: 'FILTER';
-FINISH: 'FINISH';
-FLOAT: 'FLOAT';
-FLOAT16: 'FLOAT16';
-FLOAT32: 'FLOAT32';
-FLOAT64: 'FLOAT64';
-FLOAT128: 'FLOAT128';
-FLOAT256: 'FLOAT256';
-FLOOR: 'FLOOR';
-FOR: 'FOR';
-FROM: 'FROM';
-GROUP: 'GROUP';
-HAVING: 'HAVING';
-HOME_GRAPH: 'HOME_GRAPH';
-HOME_PROPERTY_GRAPH: 'HOME_PROPERTY_GRAPH';
-HOME_SCHEMA: 'HOME_SCHEMA';
-HOUR: 'HOUR';
-IF: 'IF';
-IN: 'IN';
-INSERT: 'INSERT';
-INT: 'INT';
-INTEGER: 'INTEGER';
-INT8: 'INT8';
-INTEGER8: 'INTEGER8';
-INT16: 'INT16';
-INTEGER16: 'INTEGER16';
-INT32: 'INT32';
-INTEGER32: 'INTEGER32';
-INT64: 'INT64';
-INTEGER64: 'INTEGER64';
-INT128: 'INT128';
-INTEGER128: 'INTEGER128';
-INT256: 'INT256';
-INTEGER256: 'INTEGER256';
-INTERSECT: 'INTERSECT';
-INTERVAL: 'INTERVAL';
-IS: 'IS';
-LEADING: 'LEADING';
-LEFT: 'LEFT';
-LET: 'LET';
-LIKE: 'LIKE';
-LIMIT: 'LIMIT';
-LIST: 'LIST';
-LN: 'LN';
-LOCAL: 'LOCAL';
-LOCAL_DATETIME: 'LOCAL_DATETIME';
-LOCAL_TIME: 'LOCAL_TIME';
-LOCAL_TIMESTAMP: 'LOCAL_TIMESTAMP';
-LOG: 'LOG';
-LOG10: 'LOG10';
-LOWER: 'LOWER';
-LTRIM: 'LTRIM';
-MATCH: 'MATCH';
-MAX: 'MAX';
-MIN: 'MIN';
-MINUTE: 'MINUTE';
-MOD: 'MOD';
-MONTH: 'MONTH';
-NEXT: 'NEXT';
-NODETACH: 'NODETACH';
-NORMALIZE: 'NORMALIZE';
-NOT: 'NOT';
-NOTHING: 'NOTHING';
-NULL: 'NULL';
-NULLS: 'NULLS';
-NULLIF: 'NULLIF';
-OCTET_LENGTH: 'OCTET_LENGTH';
-OF: 'OF';
-OFFSET: 'OFFSET';
-OPTIONAL: 'OPTIONAL';
-OR: 'OR';
-ORDER: 'ORDER';
-OTHERWISE: 'OTHERWISE';
-PARAMETER: 'PARAMETER';
-PARAMETERS: 'PARAMETERS';
-PATH: 'PATH';
-PATH_LENGTH: 'PATH_LENGTH';
-PATHS: 'PATHS';
-PERCENTILE_CONT: 'PERCENTILE_CONT';
-PERCENTILE_DISC: 'PERCENTILE_DISC';
-POWER: 'POWER';
-PRECISION: 'PRECISION';
-PROPERTY_EXISTS: 'PROPERTY_EXISTS';
-RADIANS: 'RADIANS';
-REAL: 'REAL';
-RECORD: 'RECORD';
-REMOVE: 'REMOVE';
-REPLACE: 'REPLACE';
-RESET: 'RESET';
-RETURN: 'RETURN';
-RIGHT: 'RIGHT';
-ROLLBACK: 'ROLLBACK';
-RTRIM: 'RTRIM';
-SAME: 'SAME';
-SCHEMA: 'SCHEMA';
-SECOND: 'SECOND';
-SELECT: 'SELECT';
-SESSION: 'SESSION';
-SESSION_USER: 'SESSION_USER';
-SET: 'SET';
-SIGNED: 'SIGNED';
-SIN: 'SIN';
-SINH: 'SINH';
-SIZE: 'SIZE';
-SKIP_RESERVED_WORD: 'SKIP';
-SMALL: 'SMALL';
-SMALLINT: 'SMALLINT';
-SQRT: 'SQRT';
-START: 'START';
-STDDEV_POP: 'STDDEV_POP';
-STDDEV_SAMP: 'STDDEV_SAMP';
-STRING: 'STRING';
-SUM: 'SUM';
-TAN: 'TAN';
-TANH: 'TANH';
-THEN: 'THEN';
-TIME: 'TIME';
-TIMESTAMP: 'TIMESTAMP';
-TRAILING: 'TRAILING';
-TRIM: 'TRIM';
-TYPED: 'TYPED';
-UBIGINT: 'UBIGINT';
-UINT: 'UINT';
-UINT8: 'UINT8';
-UINT16: 'UINT16';
-UINT32: 'UINT32';
-UINT64: 'UINT64';
-UINT128: 'UINT128';
-UINT256: 'UINT256';
-UNION: 'UNION';
-UNSIGNED: 'UNSIGNED';
-UPPER: 'UPPER';
-USE: 'USE';
-USMALLINT: 'USMALLINT';
-VALUE: 'VALUE';
-VARBINARY: 'VARBINARY';
-VARCHAR: 'VARCHAR';
-VARIABLE: 'VARIABLE';
-WHEN: 'WHEN';
-WHERE: 'WHERE';
-WITH: 'WITH';
-XOR: 'XOR';
-YEAR: 'YEAR';
-YIELD: 'YIELD';
-ZONED: 'ZONED';
-ZONED_DATETIME: 'ZONED_DATETIME';
-ZONED_TIME: 'ZONED_TIME';
-
-// Original: // Prereserved words
-// CONTROL_FLOWPrereservedCONTROL_FLOW CONTROL_FLOWwordsCONTROL_FLOW
-ABSTRACT: 'ABSTRACT';
-AGGREGATE: 'AGGREGATE';
-AGGREGATES: 'AGGREGATES';
-ALTER: 'ALTER';
-CATALOG: 'CATALOG';
-CLEAR: 'CLEAR';
-CLONE: 'CLONE';
-CONSTRAINT: 'CONSTRAINT';
-CURRENT_ROLE: 'CURRENT_ROLE';
-CURRENT_USER: 'CURRENT_USER';
-DATA: 'DATA';
-DIRECTORY: 'DIRECTORY';
-DRYRUN: 'DRYRUN';
-EXACT: 'EXACT';
-EXISTING: 'EXISTING';
-FUNCTION: 'FUNCTION';
-GQLSTATUS: 'GQLSTATUS';
-GRANT: 'GRANT';
-INSTANT: 'INSTANT';
-INFINITY: 'INFINITY';
-NUMBER: 'NUMBER';
-NUMERIC: 'NUMERIC';
-ON: 'ON';
-OPEN: 'OPEN';
-PARTITION: 'PARTITION';
-PROCEDURE: 'PROCEDURE';
-PRODUCT: 'PRODUCT';
-PROJECT: 'PROJECT';
-QUERY: 'QUERY';
-RECORDS: 'RECORDS';
-REFERENCE: 'REFERENCE';
-RENAME: 'RENAME';
-REVOKE: 'REVOKE';
-SUBSTRING: 'SUBSTRING';
-SYSTEM_USER: 'SYSTEM_USER';
-TEMPORAL: 'TEMPORAL';
-UNIQUE: 'UNIQUE';
-UNIT: 'UNIT';
-VALUES: 'VALUES';
-
-// Original: // Nonreserved words
-// CONTROL_FLOWNonreservedCONTROL_FLOW CONTROL_FLOWwordsCONTROL_FLOW
-ACYCLIC: 'ACYCLIC';
-BINDING: 'BINDING';
-BINDINGS: 'BINDINGS';
-CONNECTING: 'CONNECTING';
-DESTINATION: 'DESTINATION';
-DIFFERENT: 'DIFFERENT';
-DIRECTED: 'DIRECTED';
-EDGE: 'EDGE';
-EDGES: 'EDGES';
-ELEMENT: 'ELEMENT';
-ELEMENTS: 'ELEMENTS';
-FIRST: 'FIRST';
-GRAPH: 'GRAPH';
-GROUPS: 'GROUPS';
-KEEP: 'KEEP';
-LABEL: 'LABEL';
-LABELED: 'LABELED';
-LABELS: 'LABELS';
-LAST: 'LAST';
-NFC: 'NFC';
-NFD: 'NFD';
-NFKC: 'NFKC';
-NFKD: 'NFKD';
-NO: 'NO';
-NODE: 'NODE';
-NORMALIZED: 'NORMALIZED';
-ONLY: 'ONLY';
-ORDINALITY: 'ORDINALITY';
-PROPERTY: 'PROPERTY';
-READ: 'READ';
-RELATIONSHIP: 'RELATIONSHIP';
-RELATIONSHIPS: 'RELATIONSHIPS';
-REPEATABLE: 'REPEATABLE';
-SHORTEST: 'SHORTEST';
-SIMPLE: 'SIMPLE';
-SOURCE: 'SOURCE';
-TABLE: 'TABLE';
-TEMP: 'TEMP';
-TO: 'TO';
-TRAIL: 'TRAIL';
-TRANSACTION: 'TRANSACTION';
-TYPE: 'TYPE';
-UNDIRECTED: 'UNDIRECTED';
-VERTEX: 'VERTEX';
-WALK: 'WALK';
-WITHOUT: 'WITHOUT';
-WRITE: 'WRITE';
-ZONE: 'ZONE';
-
-// Original: fragment SEPARATED_IDENTIFIER
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSEPARATED_IDENTIFIERCONTROL_FLOW
-// Original: : DELIMITED_IDENTIFIER
-: CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
-// Original: | EXTENDED_IDENTIFIER
-| CONTROL_FLOWEXTENDED_IDENTIFIERCONTROL_FLOW
-;
-
-// Original: REGULAR_IDENTIFIER
-CONTROL_FLOWREGULAR_IDENTIFIERCONTROL_FLOW
-: IDENTIFIER_START IDENTIFIER_EXTEND*
-;
-
-// Original: fragment EXTENDED_IDENTIFIER
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWEXTENDED_IDENTIFIERCONTROL_FLOW
-: IDENTIFIER_EXTEND+
-;
-
-// Original: fragment DELIMITED_IDENTIFIER
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
-// Original: : DOUBLE_QUOTED_CHARACTER_SEQUENCE
-: CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
-| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
-;
-
-// Original: SUBSTITUTED_PARAMETER_REFERENCE
-CONTROL_FLOWSUBSTITUTED_PARAMETER_REFERENCECONTROL_FLOW
-// Original: : DOUBLE_DOLLAR_SIGN PARAMETER_NAME
-// Original: : PUNCTUATION_OPERATOR PARAMETER_NAME
-: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWPARAMETER_NAMECONTROL_FLOW
-;
-
-// Original: GENERAL_PARAMETER_REFERENCE
-CONTROL_FLOWGENERAL_PARAMETER_REFERENCECONTROL_FLOW
-// Original: : DOLLAR_SIGN PARAMETER_NAME
-: CONTROL_FLOWDOLLAR_SIGNCONTROL_FLOW CONTROL_FLOWPARAMETER_NAMECONTROL_FLOW
-;
-
-// Original: fragment IDENTIFIER_START
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWIDENTIFIER_STARTCONTROL_FLOW
-// Original: : ID_Start
-: CONTROL_FLOWID_StartCONTROL_FLOW
-// Original: | Pc
-| CONTROL_FLOWPcCONTROL_FLOW
-;
-
-// Original: fragment IDENTIFIER_EXTEND
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWIDENTIFIER_EXTENDCONTROL_FLOW
-// Original: : ID_Continue
-: CONTROL_FLOWID_ContinueCONTROL_FLOW
-;
-
-// Original: fragment ID_Start
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWID_StartCONTROL_FLOW
-: [\p{ID_Start}]
-;
-
-// Original: fragment ID_Continue
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWID_ContinueCONTROL_FLOW
-: [\p{ID_Continue}]
-;
-
-MULTISET_ALTERNATION_OPERATOR: '|+|';
-
-BRACKET_RIGHT_ARROW: ']->';
-BRACKET_TILDE_RIGHT_ARROW: ']~>';
-CONCATENATION_OPERATOR: '||';
-DOUBLE_COLON: '::';
-DOUBLE_DOLLAR_SIGN: '$$';
-DOUBLE_PERIOD: '..';
-GREATER_THAN_OR_EQUALS_OPERATOR: '>=';
-LEFT_ARROW: '<-';
-LEFT_ARROW_TILDE: '<~';
-LEFT_ARROW_BRACKET: '<-[';
-LEFT_ARROW_TILDE_BRACKET: '<~[';
-LEFT_MINUS_RIGHT: '<->';
-LEFT_MINUS_SLASH: '<-/';
-LEFT_TILDE_SLASH: '<~/';
-LESS_THAN_OR_EQUALS_OPERATOR: '<=';
-MINUS_LEFT_BRACKET: '-[';
-MINUS_SLASH: '-/';
-NOT_EQUALS_OPERATOR: '<>';
-RIGHT_ARROW: '->';
-RIGHT_BRACKET_MINUS: ']-';
-RIGHT_BRACKET_TILDE: ']~';
-RIGHT_DOUBLE_ARROW: '=>';
-SLASH_MINUS: '/-';
-SLASH_MINUS_RIGHT: '/->';
-SLASH_TILDE: '/~';
-SLASH_TILDE_RIGHT: '/~>';
-TILDE_LEFT_BRACKET: '~[';
-TILDE_RIGHT_ARROW: '~>';
-TILDE_SLASH: '~/';
-
-// Original: // 21.4 GQL terminal characters
-// CONTROL_FLOW21CONTROL_FLOW.CONTROL_FLOW4CONTROL_FLOW CONTROL_FLOWGQLCONTROL_FLOW CONTROL_FLOWterminalCONTROL_FLOW CONTROL_FLOWcharactersCONTROL_FLOW
-
-AMPERSAND: '&';
-ASTERISK: '*';
-COLON: ':';
-COMMA: ',';
-COMMERCIAL_AT: '@';
-DOLLAR_SIGN: '$';
-DOUBLE_QUOTE: '"';
-EQUALS_OPERATOR: '=';
-EXCLAMATION_MARK: '!';
-RIGHT_ANGLE_BRACKET: '>';
-GRAVE_ACCENT: '`';
-LEFT_BRACE: '{';
-LEFT_BRACKET: '[';
-LEFT_PAREN: '(';
-LEFT_ANGLE_BRACKET: '<';
-MINUS_SIGN: '-';
-PERCENT: '%';
-PERIOD: '.';
-PLUS_SIGN: '+';
-QUESTION_MARK: '?';
-QUOTE: '\'';
-REVERSE_SOLIDUS: '\\';
-RIGHT_BRACE: '}';
-RIGHT_BRACKET: ']';
-RIGHT_PAREN: ')';
-SOLIDUS: '/';
-TILDE: '~';
-UNDERSCORE: '_';
-VERTICAL_BAR: '|';
-
-// Original: fragment HEX_DIGIT
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW
-: [0-9a-f]
-;
-
-// Original: fragment DIGIT
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWDIGITCONTROL_FLOW
-: [0-9]
-;
-
-// Original: fragment OCTAL_DIGIT
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWOCTAL_DIGITCONTROL_FLOW
-: [0-7]
-;
-
-// Original: fragment BINARY_DIGIT
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWBINARY_DIGITCONTROL_FLOW
-: [0-1]
-;
-
-// Original: SP
-// Original: KEYWORD
-CONTROL_FLOWKEYWORDCONTROL_FLOW
-// Original: : (WHITESPACE)+
-: (KEYWORD)+
--> channel(HIDDEN)
-;
-
-// Original: WHITESPACE
-CONTROL_FLOWWHITESPACECONTROL_FLOW
-// Original: : SPACE
-: CONTROL_FLOWSPACECONTROL_FLOW
-// Original: | TAB
-| CONTROL_FLOWTABCONTROL_FLOW
-// Original: | LF
-| CONTROL_FLOWLFCONTROL_FLOW
-// Original: | VT
-| CONTROL_FLOWVTCONTROL_FLOW
-// Original: | FF
-| CONTROL_FLOWFFCONTROL_FLOW
-// Original: | CR
-| CONTROL_FLOWCRCONTROL_FLOW
-// Original: | FS
-| CONTROL_FLOWFSCONTROL_FLOW
-// Original: | GS
-| CONTROL_FLOWGSCONTROL_FLOW
-// Original: | RS
-| CONTROL_FLOWRSCONTROL_FLOW
-// Original: | US
-| CONTROL_FLOWUSCONTROL_FLOW
-| '\u1680'
-| '\u180e'
-| '\u2000'
-| '\u2001'
-| '\u2002'
-| '\u2003'
-| '\u2004'
-| '\u2005'
-| '\u2006'
-| '\u2008'
-| '\u2009'
-| '\u200a'
-| '\u2028'
-| '\u2029'
-| '\u205f'
-| '\u3000'
-| '\u00a0'
-| '\u2007'
-| '\u202f'
-;
-
-BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
-
-SIMPLE_COMMENT_SOLIDUS: '//' ~[\r\n]* -> channel(HIDDEN);
-
-SIMPLE_COMMENT_MINUS: '--' ~[\r\n]* -> channel(HIDDEN);
-
-// Original: fragment GS : [\u001D];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWGSCONTROL_FLOW : [\CONTROL_FLOWu001DCONTROL_FLOW];
-
-// Original: fragment FS : [\u001C];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWFSCONTROL_FLOW : [\CONTROL_FLOWu001CCONTROL_FLOW];
-
-// Original: fragment CR : [\r];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWCRCONTROL_FLOW : [\CONTROL_FLOWrCONTROL_FLOW];
-
-// Original: fragment Sc : [\p{Sc}];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWScCONTROL_FLOW : [\CONTROL_FLOWpCONTROL_FLOW{CONTROL_FLOWScCONTROL_FLOW}];
-
-// Original: fragment SPACE : [ ];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW : [ ];
-
-// Original: fragment Pc : [\p{Pc}];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWPcCONTROL_FLOW : [\CONTROL_FLOWpCONTROL_FLOW{CONTROL_FLOWPcCONTROL_FLOW}];
-
-// Original: fragment TAB : [\t];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWTABCONTROL_FLOW : [\CONTROL_FLOWtCONTROL_FLOW];
-
-// Original: fragment LF : [\n];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWLFCONTROL_FLOW : [\CONTROL_FLOWnCONTROL_FLOW];
-
-// Original: fragment VT : [\u000B];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWVTCONTROL_FLOW : [\CONTROL_FLOWu000BCONTROL_FLOW];
-
-// Original: fragment US : [\u001F];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUSCONTROL_FLOW : [\CONTROL_FLOWu001FCONTROL_FLOW];
-
-// Original: fragment FF: [\f];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWFFCONTROL_FLOW: [\CONTROL_FLOWfCONTROL_FLOW];
-
-// Original: fragment RS: [\u001E];
-CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWRSCONTROL_FLOW: [\CONTROL_FLOWu001ECONTROL_FLOW];
diff --git a/developer/ANTLR/LexBasic.g4 b/developer/ANTLR/LexBasic.g4
deleted file mode 100644 (file)
index 761e3db..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * [The "BSD license"]
- *  Copyright (c) 2014-2015 Gerald Rosenberg
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
- *  are met:
- *
- *  1. Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *  2. Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *  3. The name of the author may not be used to endorse or promote products
- *     derived from this software without specific prior written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * A generally reusable set of fragments for import in to Lexer grammars.
- *
- *     Modified 2015.06.16 gbr -
- *     -- generalized for inclusion into the ANTLRv4 grammar distribution
- *
- */
-
-// $antlr-format alignTrailingComments on, columnLimit 130, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments off
-// $antlr-format useTab off, allowShortRulesOnASingleLine off, allowShortBlocksOnASingleLine on, alignSemicolons hanging
-// $antlr-format alignColons hanging
-
-lexer grammar LexBasic;
-
-// ======================================================
-// Lexer fragments
-//
-// -----------------------------------
-// Whitespace & Comments
-
-fragment Ws
-    : Hws
-    | Vws
-    ;
-
-fragment Hws
-    : [ \t]
-    ;
-
-fragment Vws
-    : [\r\n\f]
-    ;
-
-fragment BlockComment
-    : '/*' .*? ('*/' | EOF)
-    ;
-
-fragment DocComment
-    : '/**' .*? ('*/' | EOF)
-    ;
-
-fragment LineComment
-    : '//' ~ [\r\n]*
-    ;
-
-// -----------------------------------
-// Escapes
-// Any kind of escaped character that we can embed within ANTLR literal strings.
-
-fragment EscSeq
-    : Esc ([btnfr"'\\] | UnicodeEsc | . | EOF)
-    ;
-
-fragment EscAny
-    : Esc .
-    ;
-
-fragment UnicodeEsc
-    : 'u' (HexDigit (HexDigit (HexDigit HexDigit?)?)?)?
-    ;
-
-// -----------------------------------
-// Numerals
-
-fragment DecimalNumeral
-    : '0'
-    | [1-9] DecDigit*
-    ;
-
-// -----------------------------------
-// Digits
-
-fragment HexDigit
-    : [0-9a-fA-F]
-    ;
-
-fragment DecDigit
-    : [0-9]
-    ;
-
-// -----------------------------------
-// Literals
-
-fragment BoolLiteral
-    : 'true'
-    | 'false'
-    ;
-
-fragment CharLiteral
-    : SQuote (EscSeq | ~ ['\r\n\\]) SQuote
-    ;
-
-fragment SQuoteLiteral
-    : SQuote (EscSeq | ~ ['\r\n\\])* SQuote
-    ;
-
-fragment DQuoteLiteral
-    : DQuote (EscSeq | ~ ["\r\n\\])* DQuote
-    ;
-
-fragment USQuoteLiteral
-    : SQuote (EscSeq | ~ ['\r\n\\])*
-    ;
-
-// -----------------------------------
-// Character ranges
-
-fragment NameChar
-    : NameStartChar
-    | '0' .. '9'
-    | Underscore
-    | '\u00B7'
-    | '\u0300' .. '\u036F'
-    | '\u203F' .. '\u2040'
-    ;
-
-fragment NameStartChar
-    : 'A' .. 'Z'
-    | 'a' .. 'z'
-    | '\u00C0' .. '\u00D6'
-    | '\u00D8' .. '\u00F6'
-    | '\u00F8' .. '\u02FF'
-    | '\u0370' .. '\u037D'
-    | '\u037F' .. '\u1FFF'
-    | '\u200C' .. '\u200D'
-    | '\u2070' .. '\u218F'
-    | '\u2C00' .. '\u2FEF'
-    | '\u3001' .. '\uD7FF'
-    | '\uF900' .. '\uFDCF'
-    | '\uFDF0' .. '\uFFFD'
-    // ignores | ['\u10000-'\uEFFFF]
-    ;
-
-// -----------------------------------
-// Types
-
-fragment Int
-    : 'int'
-    ;
-
-// -----------------------------------
-// Symbols
-
-fragment Esc
-    : '\\'
-    ;
-
-fragment Colon
-    : ':'
-    ;
-
-fragment DColon
-    : '::'
-    ;
-
-fragment SQuote
-    : '\''
-    ;
-
-fragment DQuote
-    : '"'
-    ;
-
-fragment LParen
-    : '('
-    ;
-
-fragment RParen
-    : ')'
-    ;
-
-fragment LBrace
-    : '{'
-    ;
-
-fragment RBrace
-    : '}'
-    ;
-
-fragment LBrack
-    : '['
-    ;
-
-fragment RBrack
-    : ']'
-    ;
-
-fragment RArrow
-    : '->'
-    ;
-
-fragment Lt
-    : '<'
-    ;
-
-fragment Gt
-    : '>'
-    ;
-
-fragment Equal
-    : '='
-    ;
-
-fragment Question
-    : '?'
-    ;
-
-fragment Star
-    : '*'
-    ;
-
-fragment Plus
-    : '+'
-    ;
-
-fragment PlusAssign
-    : '+='
-    ;
-
-fragment Underscore
-    : '_'
-    ;
-
-fragment Pipe
-    : '|'
-    ;
-
-fragment Dollar
-    : '$'
-    ;
-
-fragment Comma
-    : ','
-    ;
-
-fragment Semi
-    : ';'
-    ;
-
-fragment Dot
-    : '.'
-    ;
-
-fragment Range
-    : '..'
-    ;
-
-fragment At
-    : '@'
-    ;
-
-fragment Pound
-    : '#'
-    ;
-
-fragment Tilde
-    : '~'
-    ;
\ No newline at end of file
diff --git a/developer/ANTLR/LexerAdaptor.java b/developer/ANTLR/LexerAdaptor.java
deleted file mode 100644 (file)
index 338000e..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- [The "BSD licence"]
- Copyright (c) 2005-2007 Terence Parr
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-//package org.antlr.parser.antlr4;
-
-import org.antlr.v4.runtime.CharStream;
-import org.antlr.v4.runtime.Lexer;
-import org.antlr.v4.runtime.Token;
-import org.antlr.v4.runtime.misc.Interval;
-
-public abstract class LexerAdaptor extends Lexer {
-
-    /**
-     *  Generic type for OPTIONS, TOKENS and CHANNELS
-     */
-    private static final int PREQUEL_CONSTRUCT = -10;
-    private static final int OPTIONS_CONSTRUCT = -11;
-
-    public LexerAdaptor(CharStream input) {
-        super(input);
-    }
-
-    /**
-     * Track whether we are inside of a rule and whether it is lexical parser. _currentRuleType==Token.INVALID_TYPE
-     * means that we are outside of a rule. At the first sign of a rule name reference and _currentRuleType==invalid, we
-     * can assume that we are starting a parser rule. Similarly, seeing a token reference when not already in rule means
-     * starting a token rule. The terminating ';' of a rule, flips this back to invalid type.
-     *
-     * This is not perfect logic but works. For example, "grammar T;" means that we start and stop a lexical rule for
-     * the "T;". Dangerous but works.
-     *
-     * The whole point of this state information is to distinguish between [..arg actions..] and [charsets]. Char sets
-     * can only occur in lexical rules and arg actions cannot occur.
-     */
-    private int _currentRuleType = Token.INVALID_TYPE;
-
-    private boolean insideOptionsBlock = false;
-
-    public int getCurrentRuleType() {
-        return _currentRuleType;
-    }
-
-    public void setCurrentRuleType(int ruleType) {
-        this._currentRuleType = ruleType;
-    }
-
-    protected void handleBeginArgument() {
-        if (inLexerRule()) {
-            pushMode(ANTLRv4Lexer.LexerCharSet);
-            more();
-        } else {
-            pushMode(ANTLRv4Lexer.Argument);
-        }
-    }
-
-    protected void handleEndArgument() {
-        popMode();
-        if (_modeStack.size() > 0) {
-            setType(ANTLRv4Lexer.ARGUMENT_CONTENT);
-        }
-    }
-
-    protected void handleEndAction() {
-        int oldMode = _mode;
-        int newMode = popMode();
-        boolean isActionWithinAction = _modeStack.size() > 0
-            && newMode == ANTLRv4Lexer.TargetLanguageAction
-            && oldMode == newMode;
-
-        if (isActionWithinAction) {
-            setType(ANTLRv4Lexer.ACTION_CONTENT);
-        }
-    }
-
-    @Override
-    public Token emit() {
-        if ((_type == ANTLRv4Lexer.OPTIONS || _type == ANTLRv4Lexer.TOKENS || _type == ANTLRv4Lexer.CHANNELS)
-                && getCurrentRuleType() == Token.INVALID_TYPE) { // enter prequel construct ending with an RBRACE
-            setCurrentRuleType(PREQUEL_CONSTRUCT);
-        } else if (_type == ANTLRv4Lexer.OPTIONS && getCurrentRuleType() == ANTLRv4Lexer.TOKEN_REF)
-        {
-            setCurrentRuleType(OPTIONS_CONSTRUCT);
-        } else if (_type == ANTLRv4Lexer.RBRACE && getCurrentRuleType() == PREQUEL_CONSTRUCT) { // exit prequel construct
-            setCurrentRuleType(Token.INVALID_TYPE);
-        } else if (_type == ANTLRv4Lexer.RBRACE && getCurrentRuleType() == OPTIONS_CONSTRUCT)
-        { // exit options
-            setCurrentRuleType(ANTLRv4Lexer.TOKEN_REF);
-        } else if (_type == ANTLRv4Lexer.AT && getCurrentRuleType() == Token.INVALID_TYPE) { // enter action
-            setCurrentRuleType(ANTLRv4Lexer.AT);
-        } else if (_type == ANTLRv4Lexer.SEMI && getCurrentRuleType() == OPTIONS_CONSTRUCT)
-        { // ';' in options { .... }. Don't change anything.
-        } else if (_type == ANTLRv4Lexer.END_ACTION && getCurrentRuleType() == ANTLRv4Lexer.AT) { // exit action
-            setCurrentRuleType(Token.INVALID_TYPE);
-        } else if (_type == ANTLRv4Lexer.ID) {
-            String firstChar = _input.getText(Interval.of(_tokenStartCharIndex, _tokenStartCharIndex));
-            if (Character.isUpperCase(firstChar.charAt(0))) {
-                _type = ANTLRv4Lexer.TOKEN_REF;
-            } else {
-                _type = ANTLRv4Lexer.RULE_REF;
-            }
-
-            if (getCurrentRuleType() == Token.INVALID_TYPE) { // if outside of rule def
-                setCurrentRuleType(_type); // set to inside lexer or parser rule
-            }
-        } else if (_type == ANTLRv4Lexer.SEMI) { // exit rule def
-            setCurrentRuleType(Token.INVALID_TYPE);
-        }
-
-        return super.emit();
-    }
-
-    private boolean inLexerRule() {
-        return getCurrentRuleType() == ANTLRv4Lexer.TOKEN_REF;
-    }
-
-    @SuppressWarnings("unused")
-    private boolean inParserRule() { // not used, but added for clarity
-        return getCurrentRuleType() == ANTLRv4Lexer.RULE_REF;
-    }
-
-    @Override
-    public void reset() {
-        setCurrentRuleType(Token.INVALID_TYPE);
-        insideOptionsBlock = false;
-        super.reset();
-    }   
-}
diff --git a/developer/ANTLR/lexer_rules.g4 b/developer/ANTLR/lexer_rules.g4
deleted file mode 100644 (file)
index a9925cd..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-fragment SINGLE_QUOTED_CHARACTER_REPRESENTATION:
-(ESCAPED_CHARACTER | ~['\\\r\n])+
-;
-fragment DOUBLE_QUOTED_CHARACTER_REPRESENTATION:
-(ESCAPED_CHARACTER | ~["\\\r\n])+
-;
-fragment ACCENT_QUOTED_CHARACTER_REPRESENTATION:
-(ESCAPED_CHARACTER | ~[`\\\r\n])+
-;
-fragment ESCAPED_REVERSE_SOLIDUS: REVERSE_SOLIDUS REVERSE_SOLIDUS;
-fragment ESCAPED_QUOTE: REVERSE_SOLIDUS QUOTE;
-fragment ESCAPED_DOUBLE_QUOTE: REVERSE_SOLIDUS DOUBLE_QUOTE;
-fragment ESCAPED_GRAVE_ACCENT: REVERSE_SOLIDUS GRAVE_ACCENT;
-fragment ESCAPED_TAB: REVERSE_SOLIDUS 't';
-fragment ESCAPED_BACKSPACE: REVERSE_SOLIDUS 'b';
-fragment ESCAPED_NEW_LINE: REVERSE_SOLIDUS 'n';
-fragment ESCAPED_CARRIAGE_RETURN: REVERSE_SOLIDUS 'r';
-fragment ESCAPED_FORM_FEED: REVERSE_SOLIDUS 'f';
-fragment ESCAPED_UNICODE4_DIGIT_VALUE:
-REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-fragment ESCAPED_UNICODE6_DIGIT_VALUE:
-REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
-: 'X' QUOTE SPACE* (HEX_DIGIT SPACE* HEX_DIGIT SPACE*)* QUOTE
-;
-: DIGIT (UNDERSCORE? DIGIT)*
-;
-: '0x' ('_'? HEX_DIGIT)+
-;
-ABS: 'ABS';
-ACOS: 'ACOS';
-ALL: 'ALL';
-ALL_DIFFERENT: 'ALL_DIFFERENT';
-AND: 'AND';
-ANY: 'ANY';
-ARRAY: 'ARRAY';
-AS: 'AS';
-ASC: 'ASC';
-ASCENDING: 'ASCENDING';
-ASIN: 'ASIN';
-AT: 'AT';
-ATAN: 'ATAN';
-AVG: 'AVG';
-BIG: 'BIG';
-BIGINT: 'BIGINT';
-BINARY: 'BINARY';
-BOOL: 'BOOL';
-BOOLEAN: 'BOOLEAN';
-BOTH: 'BOTH';
-BTRIM: 'BTRIM';
-BY: 'BY';
-BYTE_LENGTH: 'BYTE_LENGTH';
-BYTES: 'BYTES';
-CALL: 'CALL';
-CARDINALITY: 'CARDINALITY';
-CASE: 'CASE';
-CAST: 'CAST';
-CEIL: 'CEIL';
-CEILING: 'CEILING';
-CHAR: 'CHAR';
-CHAR_LENGTH: 'CHAR_LENGTH';
-CHARACTER_LENGTH: 'CHARACTER_LENGTH';
-CHARACTERISTICS: 'CHARACTERISTICS';
-CLOSE: 'CLOSE';
-COALESCE: 'COALESCE';
-COLLECT_LIST: 'COLLECT_LIST';
-COMMIT: 'COMMIT';
-COPY: 'COPY';
-COS: 'COS';
-COSH: 'COSH';
-COT: 'COT';
-COUNT: 'COUNT';
-CREATE: 'CREATE';
-CURRENT_DATE: 'CURRENT_DATE';
-CURRENT_GRAPH: 'CURRENT_GRAPH';
-CURRENT_PROPERTY_GRAPH: 'CURRENT_PROPERTY_GRAPH';
-CURRENT_SCHEMA: 'CURRENT_SCHEMA';
-CURRENT_TIME: 'CURRENT_TIME';
-CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
-DATE: 'DATE';
-DATETIME: 'DATETIME';
-DAY: 'DAY';
-DEC: 'DEC';
-DECIMAL: 'DECIMAL';
-DEGREES: 'DEGREES';
-DELETE: 'DELETE';
-DESC: 'DESC';
-DESCENDING: 'DESCENDING';
-DETACH: 'DETACH';
-DISTINCT: 'DISTINCT';
-DOUBLE: 'DOUBLE';
-DROP: 'DROP';
-DURATION: 'DURATION';
-DURATION_BETWEEN: 'DURATION_BETWEEN';
-ELEMENT_ID: 'ELEMENT_ID';
-ELSE: 'ELSE';
-END: 'END';
-EXCEPT: 'EXCEPT';
-EXISTS: 'EXISTS';
-EXP: 'EXP';
-FILTER: 'FILTER';
-FINISH: 'FINISH';
-FLOAT: 'FLOAT';
-FLOAT16: 'FLOAT16';
-FLOAT32: 'FLOAT32';
-FLOAT64: 'FLOAT64';
-FLOAT128: 'FLOAT128';
-FLOAT256: 'FLOAT256';
-FLOOR: 'FLOOR';
-FOR: 'FOR';
-FROM: 'FROM';
-GROUP: 'GROUP';
-HAVING: 'HAVING';
-HOME_GRAPH: 'HOME_GRAPH';
-HOME_PROPERTY_GRAPH: 'HOME_PROPERTY_GRAPH';
-HOME_SCHEMA: 'HOME_SCHEMA';
-HOUR: 'HOUR';
-IF: 'IF';
-IN: 'IN';
-INSERT: 'INSERT';
-INT: 'INT';
-INTEGER: 'INTEGER';
-INT8: 'INT8';
-INTEGER8: 'INTEGER8';
-INT16: 'INT16';
-INTEGER16: 'INTEGER16';
-INT32: 'INT32';
-INTEGER32: 'INTEGER32';
-INT64: 'INT64';
-INTEGER64: 'INTEGER64';
-INT128: 'INT128';
-INTEGER128: 'INTEGER128';
-INT256: 'INT256';
-INTEGER256: 'INTEGER256';
-INTERSECT: 'INTERSECT';
-INTERVAL: 'INTERVAL';
-IS: 'IS';
-LEADING: 'LEADING';
-LEFT: 'LEFT';
-LET: 'LET';
-LIKE: 'LIKE';
-LIMIT: 'LIMIT';
-LIST: 'LIST';
-LN: 'LN';
-LOCAL: 'LOCAL';
-LOCAL_DATETIME: 'LOCAL_DATETIME';
-LOCAL_TIME: 'LOCAL_TIME';
-LOCAL_TIMESTAMP: 'LOCAL_TIMESTAMP';
-LOG: 'LOG';
-LOG10: 'LOG10';
-LOWER: 'LOWER';
-LTRIM: 'LTRIM';
-MATCH: 'MATCH';
-MAX: 'MAX';
-MIN: 'MIN';
-MINUTE: 'MINUTE';
-MOD: 'MOD';
-MONTH: 'MONTH';
-NEXT: 'NEXT';
-NODETACH: 'NODETACH';
-NORMALIZE: 'NORMALIZE';
-NOT: 'NOT';
-NOTHING: 'NOTHING';
-NULL: 'NULL';
-NULLS: 'NULLS';
-NULLIF: 'NULLIF';
-OCTET_LENGTH: 'OCTET_LENGTH';
-OF: 'OF';
-OFFSET: 'OFFSET';
-OPTIONAL: 'OPTIONAL';
-OR: 'OR';
-ORDER: 'ORDER';
-OTHERWISE: 'OTHERWISE';
-PARAMETER: 'PARAMETER';
-PARAMETERS: 'PARAMETERS';
-PATH: 'PATH';
-PATH_LENGTH: 'PATH_LENGTH';
-PATHS: 'PATHS';
-PERCENTILE_CONT: 'PERCENTILE_CONT';
-PERCENTILE_DISC: 'PERCENTILE_DISC';
-POWER: 'POWER';
-PRECISION: 'PRECISION';
-PROPERTY_EXISTS: 'PROPERTY_EXISTS';
-RADIANS: 'RADIANS';
-REAL: 'REAL';
-RECORD: 'RECORD';
-REMOVE: 'REMOVE';
-REPLACE: 'REPLACE';
-RESET: 'RESET';
-RETURN: 'RETURN';
-RIGHT: 'RIGHT';
-ROLLBACK: 'ROLLBACK';
-RTRIM: 'RTRIM';
-SAME: 'SAME';
-SCHEMA: 'SCHEMA';
-SECOND: 'SECOND';
-SELECT: 'SELECT';
-SESSION: 'SESSION';
-SESSION_USER: 'SESSION_USER';
-SET: 'SET';
-SIGNED: 'SIGNED';
-SIN: 'SIN';
-SINH: 'SINH';
-SIZE: 'SIZE';
-SKIP_RESERVED_WORD: 'SKIP';
-SMALL: 'SMALL';
-SMALLINT: 'SMALLINT';
-SQRT: 'SQRT';
-START: 'START';
-STDDEV_POP: 'STDDEV_POP';
-STDDEV_SAMP: 'STDDEV_SAMP';
-STRING: 'STRING';
-SUM: 'SUM';
-TAN: 'TAN';
-TANH: 'TANH';
-THEN: 'THEN';
-TIME: 'TIME';
-TIMESTAMP: 'TIMESTAMP';
-TRAILING: 'TRAILING';
-TRIM: 'TRIM';
-TYPED: 'TYPED';
-UBIGINT: 'UBIGINT';
-UINT: 'UINT';
-UINT8: 'UINT8';
-UINT16: 'UINT16';
-UINT32: 'UINT32';
-UINT64: 'UINT64';
-UINT128: 'UINT128';
-UINT256: 'UINT256';
-UNION: 'UNION';
-UNSIGNED: 'UNSIGNED';
-UPPER: 'UPPER';
-USE: 'USE';
-USMALLINT: 'USMALLINT';
-VALUE: 'VALUE';
-VARBINARY: 'VARBINARY';
-VARCHAR: 'VARCHAR';
-VARIABLE: 'VARIABLE';
-WHEN: 'WHEN';
-WHERE: 'WHERE';
-WITH: 'WITH';
-XOR: 'XOR';
-YEAR: 'YEAR';
-YIELD: 'YIELD';
-ZONED: 'ZONED';
-ZONED_DATETIME: 'ZONED_DATETIME';
-ZONED_TIME: 'ZONED_TIME';
-ABSTRACT: 'ABSTRACT';
-AGGREGATE: 'AGGREGATE';
-AGGREGATES: 'AGGREGATES';
-ALTER: 'ALTER';
-CATALOG: 'CATALOG';
-CLEAR: 'CLEAR';
-CLONE: 'CLONE';
-CONSTRAINT: 'CONSTRAINT';
-CURRENT_ROLE: 'CURRENT_ROLE';
-CURRENT_USER: 'CURRENT_USER';
-DATA: 'DATA';
-DIRECTORY: 'DIRECTORY';
-DRYRUN: 'DRYRUN';
-EXACT: 'EXACT';
-EXISTING: 'EXISTING';
-FUNCTION: 'FUNCTION';
-GQLSTATUS: 'GQLSTATUS';
-GRANT: 'GRANT';
-INSTANT: 'INSTANT';
-INFINITY: 'INFINITY';
-NUMBER: 'NUMBER';
-NUMERIC: 'NUMERIC';
-ON: 'ON';
-OPEN: 'OPEN';
-PARTITION: 'PARTITION';
-PROCEDURE: 'PROCEDURE';
-PRODUCT: 'PRODUCT';
-PROJECT: 'PROJECT';
-QUERY: 'QUERY';
-RECORDS: 'RECORDS';
-REFERENCE: 'REFERENCE';
-RENAME: 'RENAME';
-REVOKE: 'REVOKE';
-SUBSTRING: 'SUBSTRING';
-SYSTEM_USER: 'SYSTEM_USER';
-TEMPORAL: 'TEMPORAL';
-UNIQUE: 'UNIQUE';
-UNIT: 'UNIT';
-VALUES: 'VALUES';
-ACYCLIC: 'ACYCLIC';
-BINDING: 'BINDING';
-BINDINGS: 'BINDINGS';
-CONNECTING: 'CONNECTING';
-DESTINATION: 'DESTINATION';
-DIFFERENT: 'DIFFERENT';
-DIRECTED: 'DIRECTED';
-EDGE: 'EDGE';
-EDGES: 'EDGES';
-ELEMENT: 'ELEMENT';
-ELEMENTS: 'ELEMENTS';
-FIRST: 'FIRST';
-GRAPH: 'GRAPH';
-GROUPS: 'GROUPS';
-KEEP: 'KEEP';
-LABEL: 'LABEL';
-LABELED: 'LABELED';
-LABELS: 'LABELS';
-LAST: 'LAST';
-NFC: 'NFC';
-NFD: 'NFD';
-NFKC: 'NFKC';
-NFKD: 'NFKD';
-NO: 'NO';
-NODE: 'NODE';
-NORMALIZED: 'NORMALIZED';
-ONLY: 'ONLY';
-ORDINALITY: 'ORDINALITY';
-PROPERTY: 'PROPERTY';
-READ: 'READ';
-RELATIONSHIP: 'RELATIONSHIP';
-RELATIONSHIPS: 'RELATIONSHIPS';
-REPEATABLE: 'REPEATABLE';
-SHORTEST: 'SHORTEST';
-SIMPLE: 'SIMPLE';
-SOURCE: 'SOURCE';
-TABLE: 'TABLE';
-TEMP: 'TEMP';
-TO: 'TO';
-TRAIL: 'TRAIL';
-TRANSACTION: 'TRANSACTION';
-TYPE: 'TYPE';
-UNDIRECTED: 'UNDIRECTED';
-VERTEX: 'VERTEX';
-WALK: 'WALK';
-WITHOUT: 'WITHOUT';
-WRITE: 'WRITE';
-ZONE: 'ZONE';
-MULTISET_ALTERNATION_OPERATOR: '|+|';
-BRACKET_RIGHT_ARROW: ']->';
-BRACKET_TILDE_RIGHT_ARROW: ']~>';
-CONCATENATION_OPERATOR: '||';
-DOUBLE_COLON: '::';
-DOUBLE_DOLLAR_SIGN: '$$';
-DOUBLE_PERIOD: '..';
-GREATER_THAN_OR_EQUALS_OPERATOR: '>=';
-LEFT_ARROW: '<-';
-LEFT_ARROW_TILDE: '<~';
-LEFT_ARROW_BRACKET: '<-[';
-LEFT_ARROW_TILDE_BRACKET: '<~[';
-LEFT_MINUS_RIGHT: '<->';
-LEFT_MINUS_SLASH: '<-/';
-LEFT_TILDE_SLASH: '<~/';
-LESS_THAN_OR_EQUALS_OPERATOR: '<=';
-MINUS_LEFT_BRACKET: '-[';
-MINUS_SLASH: '-/';
-NOT_EQUALS_OPERATOR: '<>';
-RIGHT_ARROW: '->';
-RIGHT_BRACKET_MINUS: ']-';
-RIGHT_BRACKET_TILDE: ']~';
-RIGHT_DOUBLE_ARROW: '=>';
-SLASH_MINUS: '/-';
-SLASH_MINUS_RIGHT: '/->';
-SLASH_TILDE: '/~';
-SLASH_TILDE_RIGHT: '/~>';
-TILDE_LEFT_BRACKET: '~[';
-TILDE_RIGHT_ARROW: '~>';
-TILDE_SLASH: '~/';
-AMPERSAND: '&';
-ASTERISK: '*';
-COLON: ':';
-COMMA: ',';
-COMMERCIAL_AT: '@';
-DOLLAR_SIGN: '$';
-DOUBLE_QUOTE: '"';
-EQUALS_OPERATOR: '=';
-EXCLAMATION_MARK: '!';
-RIGHT_ANGLE_BRACKET: '>';
-GRAVE_ACCENT: '`';
-LEFT_BRACE: '{';
-LEFT_BRACKET: '[';
-LEFT_PAREN: '(';
-LEFT_ANGLE_BRACKET: '<';
-MINUS_SIGN: '-';
-PERCENT: '%';
-PERIOD: '.';
-PLUS_SIGN: '+';
-QUESTION_MARK: '?';
-QUOTE: '\'';
-REVERSE_SOLIDUS: '\\';
-RIGHT_BRACE: '}';
-RIGHT_BRACKET: ']';
-RIGHT_PAREN: ')';
-SOLIDUS: '/';
-TILDE: '~';
-UNDERSCORE: '_';
-VERTICAL_BAR: '|';
-fragment HEX_DIGIT
-: [0-9a-f]
-;
-fragment DIGIT
-: [0-9]
-;
-SP
-: (WHITESPACE)+
--> channel(HIDDEN)
-;
-WHITESPACE
-: SPACE
-| TAB
-| LF
-| VT
-| FF
-| CR
-| FS
-| GS
-| RS
-| US
-| '\u1680'
-| '\u180e'
-| '\u2000'
-| '\u2001'
-| '\u2002'
-| '\u2003'
-| '\u2004'
-| '\u2005'
-| '\u2006'
-| '\u2008'
-| '\u2009'
-| '\u200a'
-| '\u2028'
-| '\u2029'
-| '\u205f'
-| '\u3000'
-| '\u00a0'
-| '\u2007'
-| '\u202f'
-;
-BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
-SIMPLE_COMMENT_SOLIDUS: '//' ~[\r\n]* -> channel(HIDDEN);
-SIMPLE_COMMENT_MINUS: '--' ~[\r\n]* -> channel(HIDDEN);
-fragment GS : [\u001D];
-fragment FS : [\u001C];
-fragment CR : [\r];
-fragment Sc : [\p{Sc}];
-fragment SPACE : [ ];
-fragment Pc : [\p{Pc}];
-fragment TAB : [\t];
-fragment LF : [\n];
-fragment VT : [\u000B];
-fragment US : [\u001F];
-fragment FF: [\f];
-fragment RS: [\u001E];
diff --git a/developer/Erebus/.gitignore b/developer/Erebus/.gitignore
deleted file mode 100644 (file)
index 2db43ed..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-*
-!/.gitignore
-
diff --git a/developer/Lethe/.githolder b/developer/Lethe/.githolder
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/developer/Lethe/Hibou_build.gradle b/developer/Lethe/Hibou_build.gradle
deleted file mode 100644 (file)
index ca38ddd..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-task setup {
-  doLast {
-    def dirs = [
-      "$(ANTLR_IN_PRIMARY_DIR)",
-      "$(JAVA_COMP_IN_DIR)",
-      "$(JAVA_COMP_IN_PRIMARY_DIR)",
-      "$(JAVA_COMP_IN_ANTLR_DIR)",
-      "$(JAVA_COMP_IN_SYN_DIR)",
-      "$(JVM_IN_DIR)",
-      "$(EXECUTOR_IN_DIR)",
-      "test",
-      "deprecated",
-      "experiment",
-      "ologist",
-      "temporary"
-    ]
-    dirs.each { dir ->
-      if (!file(dir).exists()) {
-        mkdir dir
-      }
-    }
-  }
-}
-
-def compileJava(source, target) {
-  tasks.create(name: "compile${source}", type: Exec) {
-    commandLine '$(JAVA_COMP)', '-d', '$(JAVA_COMP_OUT_DIR)', '-sourcepath', '$(JAVA_COMP_IN_DL)', source
-    doLast {
-      println "Compiled ${source} to ${target}"
-    }
-  }
-}
-
-def createJar(source, target) {
-  tasks.create(name: "jar${source}", type: Exec) {
-    commandLine '$(JAVA_ARCHIVE)', 'cf', target, '-C', '$(JAVA_COMP_OUT_DIR)', source
-    doLast {
-      println "Created ${target}"
-    }
-  }
-}
-
-def createWrapper(source, target) {
-  tasks.create(name: "wrapper${source}", type: Exec) {
-    doLast {
-      def script = new File(target)
-      script.text = "#!/usr/bin/env bash\n$(JAVA_INTERP) -cp ${CLASSPATH}:${JVM_IN_DP}:${JVM_IN_DP}/${source}.jar ${source} \$@"
-      script.setExecutable(true)
-      println "Created program ${target}"
-    }
-  }
-}
-
-task ANTLR_OUT_FL {
-  dependsOn setup
-  doLast {
-    println "Building ANTLR_OUT_FL..."
-    // Add specific build steps for ANTLR_OUT_FL here
-  }
-}
-
-task all {
-  dependsOn ANTLR_OUT_FL
-  doLast {
-    println "Building all targets..."
-  }
-}
-
-task clean {
-  doLast {
-    println "Use the command `clean <option>` instead of make."
-  }
-}
-
-task version {
-  doLast {
-    println "ANTLR_JAR is '${notdir(ANTLR_JAR)}'"
-    exec {
-      commandLine '$(JAVA_COMP)', '--version'
-    }
-    exec {
-      commandLine '$(JAVA_ARCHIVE)', '--version'
-    }
-    exec {
-      commandLine 'make', '-v'
-    }
-    println "makefile 0.4"
-  }
-}
-
-task nothing {
-  doLast {
-    // useful for distinguishing between make syntax errors and build errors
-  }
-}
-
-tasks.withType(Exec) {
-  doFirst {
-    println "Executing $name"
-  }
-}
-
-// Example usage
-compileJava('$(JAVA_COMP_IN_PRIMARY_DIR)/Example.java', '$(JAVA_COMP_OUT_DIR)/Example.class')
-createJar('Example.class', '$(JAVA_COMP_OUT_DIR)/Example.jar')
-createWrapper('Example', '$(EXECUTOR_IN_DIR)/Example')
diff --git a/developer/Lethe/buid_from_leaf.gradle b/developer/Lethe/buid_from_leaf.gradle
deleted file mode 100644 (file)
index c23a159..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*--------------------------------------------------------------------------------
- build_from_leaf
-
- Accepts `build_result_fpl` and `leaf_dependency_fpl` (fpl = file path list). 
- Typically, `build_result_fpl` will hold a single item, representing the target 
- to be built, and `leaf_dependency_fpl` contains the leaf dependencies for that 
- target.
-
- This function checks the build status of the target relative to its dependencies.
-
- It returns a dictionary with the following fields based on the result of the check:
-
-     type   -> A string indicating the result type:
-               'no_build_target_specified', 'non_existent_build_target',
-               'up_to_date', or 'need_to_build'.
-
-     message -> A string message describing the result (optional).
-
-     missing -> If type is 'non_existent_build_target', this field contains the 
-                list of missing build targets.
-
-     build_result -> If type is 'need_to_build', this field contains the list 
-                     of build result filenames that need to be rebuilt.
-*/
-
-def build_from_leaf(build_result_fpl ,leaf_dependency_fpl) {
-
-  if( !build_result_fpl || build_result_fpl.isEmpty() ){
-    return [
-      type: "no_build_target_specified"
-      ,message: "No build target specified"
-    ]
-  }
-
-  // Check if any build result file does not exist
-  def missing_build_fpl = build_result_fpl.findAll{ file_path ->
-    !new File(file_path).exists()
-  }
-  
-  if( !missing_build_fpl.isEmpty() ){
-    return [
-      type: "non_existent_build_target"
-      ,message: "Missing build targets"
-      ,missing: missing_build_fpl
-    ]
-  }
-
-  // Check if any dependency is newer than the build result files
-  def all_up_to_date_bool = build_result_fpl.every{ result_file_path ->
-    def result_file = new File(result_file_path)
-    !leaf_dependency_fpl.any{ dep_path ->
-      new File(dep_path).lastModified() > result_file.lastModified()
-    }
-  }
-
-  if( all_up_to_date_bool ){
-    return [
-      type: "up_to_date"
-      ,message: "Build result is up to date"
-    ]
-  }else{
-    return [
-      type: "need_to_build"
-      ,message: "Build result needs to be rebuilt"
-      ,build_result: build_result_fpl
-    ]
-  }
-}
diff --git a/developer/Lethe/build.gradle b/developer/Lethe/build.gradle
deleted file mode 100644 (file)
index e53add0..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-task setup {
-  doLast {
-    def dirs = [
-      "$(ANTLR_IN_PRIMARY_DIR)"
-      ,"$(JAVA_COMP_IN_DIR)"
-      ,"$(JAVA_COMP_IN_PRIMARY_DIR)"
-      ,"$(JAVA_COMP_IN_ANTLR_DIR)"
-      ,"$(JAVA_COMP_IN_SYN_DIR)"
-      ,"$(JVM_IN_DIR)"
-      ,"$(EXECUTOR_IN_DIR)"
-      ,"test"
-      ,"deprecated"
-      ,"experiment"
-      ,"ologist"
-      ,"temporary"
-    ]
-    dirs.each { dir ->
-      if (!file(dir).exists()) {
-        mkdir dir
-      }
-    }
-  }
-}
-
-task tool(type: Exec) {
-  dependsOn setup
-  commandLine '$(BIN_MAKE)', '-f', '$(EXECUTOR_IN_DIR)/makefile-tool.mk', '-$(MAKEFLAGS)', 'all'
-}
-
-task project(type: Exec) {
-  dependsOn tool
-  commandLine '$(BIN_MAKE)', '-f', '$(EXECUTOR_IN_DIR)/makefile-project.mk', '-$(MAKEFLAGS)', 'all'
-}
-
-task clean {
-  doLast {
-    println "Use the command `clean <option>` instead of make."
-  }
-}
-
-task version {
-  doLast {
-    println "ANTLR_JAR is '${notdir(ANTLR_JAR)}'"
-    exec {
-      commandLine '$(JAVA_COMP)', '--version'
-    }
-    exec {
-      commandLine '$(JAVA_ARCHIVE)', '--version'
-    }
-    exec {
-      commandLine 'make', '-v'
-    }
-    println "makefile 0.4"
-  }
-}
-
-task all {
-  dependsOn project
-}
-
-task nothing {
-  doLast {
-    // useful for distinguishing between make syntax errors and build errors
-  }
-}
-
-tasks.withType(Exec) {
-  doFirst {
-    println "Executing $name"
-  }
-}
diff --git a/developer/Lethe/build.html b/developer/Lethe/build.html
deleted file mode 100644 (file)
index ac24ab4..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>Building the Project: A Developer's Guide</title>
-</head>
-<body>
-
-  <h1>Building the Project: A Developer’s Guide</h1>
-
-  <p>This document is intended to guide developers on how to build existing programs and extend the build environment when needed.</p>
-
-  <h2>Section 1: Building Existing Programs</h2>
-
-  <h3>1.1 Prerequisites</h3>
-  <ul>
-    <li><strong>Setting Up Your Environment:</strong> 
-      Ensure that <code>make</code> is available in your system’s <code>PATH</code>.
-      Make sure necessary environment variables such as <code>DEVELOPER_HOME</code> and <code>EXECUTOR_IN_DIR</code> are set.
-      Source the <code>env_build</code> script to configure the environment:
-      <pre><code>source /path/to/env_build</code></pre>
-    </li>
-  </ul>
-
-  <h3>1.2 Basic Build Process</h3>
-  <ul>
-    <li><strong>How to Use Make:</strong> 
-      Developers can use the <code>make</code> command to build specific programs. 
-      For example:
-      <pre><code>make X</code></pre>
-      Here, <code>X</code> is the name of the program you wish to build. 
-      If you do not specify any program, <code>make</code> will build the entire project:
-      <pre><code>make</code></pre>
-    </li>
-    <li><strong>Sample Commands:</strong>
-      <pre><code>make Arithmetic_Echo</code></pre>
-      <pre><code>make Arithmetic_Syntax</code></pre>
-    </li>
-  </ul>
-
-  <h3>1.3 Understanding the Output</h3>
-  <ul>
-    <li>After a successful build, executables will be created in the <code>executor</code> directory.
-      <br>The <code>makefile-top.mk</code> file will be the top-level control file for managing the build process.
-    </li>
-  </ul>
-
-  <h2>Section 2: Advanced Usage for Developers</h2>
-
-  <h3>2.1 Adding New Programs</h3>
-  <ul>
-    <li><strong>Steps to Add a New Program:</strong>
-      <ul>
-        <li>Modify <code>makefile-project.mk</code> and <code>makefile-tool.mk</code> to include the new program.</li>
-        <li>Add the program name to the <code>EXECUTOR_IN_FL</code> list in <code>env_build</code>.</li>
-        <li>Ensure that source files (e.g., <code>.java</code> or ANTLR grammar files) are properly placed in the relevant directories.</li>
-      </ul>
-    </li>
-  </ul>
-
-  <h3>2.2 Advanced Make Commands</h3>
-  <ul>
-    <li><strong>Using <code>project-X</code> and <code>tool-Y</code>:</strong>
-      Developers can use advanced make commands to build only specific components.
-      For example:
-      <pre><code>make project-Arithmetic_Syntax</code></pre>
-      This command builds the <code>Arithmetic_Syntax</code> component only.
-      Similarly, use <code>make tool-X</code> to build a specific tool:
-      <pre><code>make tool-Y</code></pre>
-    </li>
-  </ul>
-
-  <h3>2.3 Debugging and Extending the Build Environment</h3>
-  <ul>
-    <li><strong>Environment Variables:</strong>
-      Developers can modify environment variables in the <code>env_build</code> script to add or remove programs, directories, or paths.
-      <br>Common variables include:
-      <ul>
-        <li><code>EXECUTOR_IN_FL</code>: The list of programs to build.</li>
-        <li><code>ANTLR_OUT_DIR</code>: Directory for ANTLR-generated files.</li>
-        <li><code>JAVA_COMP_IN_FPL</code>: File list for Java compilation.</li>
-      </ul>
-    </li>
-  </ul>
-
-</body>
-</html>
-
-
diff --git a/developer/Lethe/make b/developer/Lethe/make
deleted file mode 100755 (executable)
index 714a070..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-if [[ -z "${DEVELOPER_HOME}" || -z "${EXECUTOR_IN_DIR}" ]]; then
-  echo "required variables not set. As seen by:"
-  echo "  DEVELOPER_HOME: $DEVELOPER_HOME"
-  echo "  EXECUTOR_IN_DIR: $EXECUTOR_IN_DIR"
-  exit 1
-fi
-
-cd "$DEVELOPER_HOME"
-
-# in case there have been edits to the environment
-source "${EXECUTOR_IN_DIR}"/env_build
-
-${BIN_MAKE} --no-print-directory -f "${EXECUTOR_IN_DIR}"/makefile-top.mk $@
diff --git a/developer/Lethe/makefile-project.mk b/developer/Lethe/makefile-project.mk
deleted file mode 100644 (file)
index 7f8d6ef..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-#--------------------------------------------------------------------------------
-# Project build
-#
-# GNU makefile
-
-# turn off implicit rules, because they can do unexpected things.
-.SUFFIXES:
-MAKEFLAGS += -r
-
-# `make` considers that PHONY targets do not correspond to files (other
-# targets do and the files have their dates checked). This declaration renders
-# innocuous the "feature" where `make` always tries to make its own
-# makefiles. There is no command line switch to turn this "feature" off.
-.PHONY: $(MAKEFILE_LIST)
-
-# 'make' has a "feature" where it deletes what it determines to be intermediate
-# files. There is no command line switch to turn this "feature" off. Combine
-# this "feature" with implicit rules and have loads of fun.
-.PRECIOUS: $(MAKEFILE_LIST)
-
-#$(info makefile: $(MAKEFILE_LIST))
-#$(info project_MAKECMDGOALS: $(MAKECMDGOALS))
-
-# for recursive make without leaving this makefile
-REMAKE = $(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE_LIST)
-
-#================================================================================
-# Custom make targets
-#
-
-all: $(EXECUTOR_IN_FPL)
-
-
-#-----------------------------------------------
-# These do not require antlr generated java files
-
-RuleNameListRegx: $(EXECUTOR_IN_DIR)/RuleNameListRegx
-RuleNameList: $(EXECUTOR_IN_DIR)/RuleNameList
-
-Synthesize_SyntaxAnnotate_PrintVisitorMethod:\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/StringUtils.java\
-  $(EXECUTOR_IN_DIR)/Synthesize_SyntaxAnnotate_PrintVisitorMethod
-Synthesize_SyntaxAnnotate_PrintVisitor:\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/StringUtils.java\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java\
-  $(EXECUTOR_IN_DIR)/Synthesize_SyntaxAnnotate_PrintVisitor
-
-Synthesize_SyntaxAnnotate:\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/StringUtils.java\https://github.com/Thomas-Walker-Lynch/GQL_to_Cypher
-  $(EXECUTOR_IN_DIR)/Synthesize_SyntaxAnnotate
-
-#-----------------------------------------------
-# Arithmetic
-
-ANTLR_OUT_Arithmetic_FPL:= $(shell ANTLR_OUT_FL Arithmetic -path $(ANTLR_OUT_DIR))
-#$(info ANTLR_OUT_Arithmetic_FPL: $(ANTLR_OUT_Arithmetic_FPL))
-Arithmetic_Echo:\
-  $(ANTLR_OUT_Arithmetic_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic_Echo_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_Arithmetic_FPL)" ]; then \
-         echo "variable ANTLR_OUT_Arithmetic_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/Arithmetic_Echo
-
-Arithmetic_Echo__Test:\
-  $(ANTLR_OUT_Arithmetic_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic_Echo_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_Arithmetic_FPL)" ]; then \
-         echo "variable ANTLR_OUT_Arithmetic_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/Arithmetic_Echo__Test
-
-Arithmetic_SyntaxAnnotate:\
-  $(ANTLR_OUT_Arithmetic_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic_SyntaxAnnotate_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_Arithmetic_FPL)" ]; then \
-         echo "variable ANTLR_OUT_Arithmetic_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/Arithmetic_SyntaxAnnotate
-
-Arithmetic_SyntaxAnnotate__Test:\
-  $(ANTLR_OUT_Arithmetic_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic_SyntaxAnnotate_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_Arithmetic_FPL)" ]; then \
-         echo "variable ANTLR_OUT_Arithmetic_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/Arithmetic_SyntaxAnnotate__Test
-
-Arithmetic_Swap:\
-  $(ANTLR_OUT_Arithmetic_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic_SwapVisitor.java\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic_Echo_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_Arithmetic_FPL)" ]; then \
-         echo "variable ANTLR_OUT_Arithmetic_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/Arithmetic_Swap
-
-#-----------------------------------------------
-# Arithmetic2
-# 
-
-ANTLR_OUT_Arithmetic2_FPL:= $(shell ANTLR_OUT_FL Arithmetic2 -path $(ANTLR_OUT_DIR))
-Arithmetic2_SyntaxAnnotate:\
-  $(ANTLR_OUT_Arithmetic2_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic2_SyntaxAnnotate_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_Arithmetic2_FPL)" ]; then \
-         echo "variable ANTLR_OUT_Arithmetic2_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/Arithmetic2_SyntaxAnnotate
-
-Arithmetic2_SyntaxAnnotate__Test:\
-  $(ANTLR_OUT_Arithmetic2_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/Arithmetic2_SyntaxAnnotate_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_Arithmetic2_FPL)" ]; then \
-         echo "variable ANTLR_OUT_Arithmetic2_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/Arithmetic2_SyntaxAnnotate__Test
-
-#-----------------------------------------------
-# Parsing/Analyzing ANTLR grammars
-#
-
-ANTLR_OUT_ANTLRv4_FPL:= $(shell ANTLR_OUT_FL ANTLRv4 -path $(ANTLR_OUT_DIR))
-ANTLRv4_SyntaxAnnotate:\
-  $(ANTLR_OUT_ANTLRv4_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/ANTLRv4_SyntaxAnnotate_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_ANTLRv4_FPL)" ]; then \
-         echo "variable ANTLR_OUT_ANTLRv4_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/ANTLRv4_SyntaxAnnotate
-
-
-#-----------------------------------------------
-#  GQL_20240412
-
-ANTLR_OUT_GQL_20240412_FPL := $(shell ANTLR_OUT_FL GQL_20240412 -path $(ANTLR_OUT_DIR))
-GQL_20240412_SyntaxAnnotate:\
-  $(ANTLR_OUT_GQL_20240412_FPL)\
-  $(JAVA_COMP_IN_PRIMARY_DIR)/GQL_20240412_SyntaxAnnotate_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_GQL_20240412_FPL)" ]; then \
-         echo "variable ANTLR_OUT_GQL_20240412_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/GQL_20240412_SyntaxAnnotate
-
-GQL_20240412_SyntaxAnnotate__Test: \
-  $(ANTLR_OUT_GQL_20240412_FPL) \
-  $(JAVA_COMP_IN_PRIMARY_DIR)/GQL_20240412_SyntaxAnnotate_PrintVisitor.java
-       @if [ -z "$(ANTLR_OUT_GQL_20240412_FPL)" ]; then \
-         echo "variable ANTLR_OUT_GQL_20240412_FPL empty."; \
-         exit 1; \
-       fi
-       $(REMAKE) $(EXECUTOR_IN_DIR)/GQL_20240412_SyntaxAnnotate__Test
-
-
-TerminalToCategory: 
-       $(REMAKE) $(EXECUTOR_IN_DIR)/TerminalToCategory
-
-GrammarSplitter: 
-       $(REMAKE) $(EXECUTOR_IN_DIR)/GrammarSplitter
-
-#-----------------------------------------------
-# Compile all the .java files.
-
-java: $(JAVA_COMP_OUT_FPL)
-
-
-#================================================================================
-# generic targets, aka recipes
-#
-
-# this section is not parallel make friendly
-# $(ANTLR_OUT_DIR)/%Lexer.java: $(ANTLR_IN_PRIMARY_DIR)/%.g4
-#      $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-# $(ANTLR_OUT_DIR)/%Parser.java: $(ANTLR_IN_PRIMARY_DIR)/%.g4
-#      $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-# $(ANTLR_OUT_DIR)/%BaseListener.java: $(ANTLR_IN_PRIMARY_DIR)/%.g4
-#      $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-# $(ANTLR_OUT_DIR)/%Listener.java: $(ANTLR_IN_PRIMARY_DIR)/%.g4
-#      $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-# $(ANTLR_OUT_DIR)/%BaseVisitor.java: $(ANTLR_IN_PRIMARY_DIR)/%.g4
-#      $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-# $(ANTLR_OUT_DIR)/%Visitor.java: $(ANTLR_IN_PRIMARY_DIR)/%.g4
-#      $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-
-#--------------------
-# for a single `<name>.g4` grammar file
-
-$(ANTLR_OUT_DIR)/%Lexer.java \
-$(ANTLR_OUT_DIR)/%Parser.java \
-$(ANTLR_OUT_DIR)/%BaseListener.java \
-$(ANTLR_OUT_DIR)/%Listener.java \
-$(ANTLR_OUT_DIR)/%BaseVisitor.java \
-$(ANTLR_OUT_DIR)/%Visitor.java: $(ANTLR_IN_PRIMARY_DIR)/%.g4
-       @echo "copiling grammar from:" $<
-       $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-
-#--------------------
-# For separate `<mame>Lexer.g4` and `<name>Parser.g4` files.
-# `make` prefers shorter pattern matches, so this should work.
-#
-
-$(ANTLR_OUT_DIR)/LexerAdaptor.java: $(ANTLR_IN_PRIMARY_DIR)/LexerAdaptor.java
-       cp $(ANTLR_IN_PRIMARY_DIR)/LexerAdaptor.java $(ANTLR_OUT_DIR)
-
-$(ANTLR_OUT_DIR)/%Lexer.java: $(ANTLR_IN_PRIMARY_DIR)/%Lexer.g4 $(ANTLR_OUT_DIR)/LexerAdaptor.java
-       @echo "making lexer grammar from:" $<
-       $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -o $(ANTLR_OUT_DIR_PARENT) $<
-
-# Rule for all generated files from Parser.g4
-$(ANTLR_OUT_DIR)/%Parser.java \
-$(ANTLR_OUT_DIR)/%BaseListener.java \
-$(ANTLR_OUT_DIR)/%Listener.java \
-$(ANTLR_OUT_DIR)/%BaseVisitor.java \
-$(ANTLR_OUT_DIR)/%Visitor.java: $(ANTLR_IN_PRIMARY_DIR)/%Parser.g4
-       @echo "making other grammar files from:" $<
-       $(JAVA_INTERP) -jar $(ANTLR_JAR) -Dlanguage=Java -visitor -lib $(ANTLR_OUT_DIR) -o $(ANTLR_OUT_DIR_PARENT) $<
-
-#---------------------
-
-# make .class file from .java file
-$(JAVA_COMP_OUT_DIR)/%.class: $(JAVA_COMP_IN_PRIMARY_DIR)/%.java
-       @echo "Compiling $<..."
-       $(JAVA_COMP) -d $(JAVA_COMP_OUT_DIR) -sourcepath $(JAVA_COMP_IN_DL) $<
-       @echo "Created $@"
-
-# Without this, `make` sees .jar files as intermediate and deletes them.
-.PRECIOUS: $(JAVA_COMP_OUT_DIR)/%.jar
-
-# make .jar from .class file
-$(JAVA_COMP_OUT_DIR)/%.class: $(JAVA_COMP_IN_PRIMARY_DIR)/%.java
-$(JAVA_COMP_OUT_DIR)/%.jar: $(JAVA_COMP_OUT_DIR)/%.class
-       @echo "Building $*..."
-       $(JAVA_ARCHIVE) cf $@ -C $(JAVA_COMP_OUT_DIR) $*.class
-       @echo "Created $@"
-
-#make the wrapper script from the .jar file
-$(EXECUTOR_IN_DIR)/%: $(JVM_IN_DIR)/%.jar
-       @echo "Creating program for $*..."
-       @echo "#!/usr/bin/env bash" > $(EXECUTOR_IN_DIR)/$*
-       @echo "$(JAVA_INTERP) -cp ${CLASSPATH}:${JVM_IN_DP}:$(JVM_IN_DP)/$*.jar $*" \$$\@ >> $(EXECUTOR_IN_DIR)/$*
-       chmod +x $(EXECUTOR_IN_DIR)/$*
-       @echo "Created program $(EXECUTOR_IN_DIR)/$*"
diff --git a/developer/Lethe/makefile-tool.mk b/developer/Lethe/makefile-tool.mk
deleted file mode 100644 (file)
index e43278b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#================================================================================
-# Build the tools that are needed for building the project.
-#
-# GNU makefile
-
-# turn off implicit rules, because they can do unexpected things.
-.SUFFIXES:
-MAKEFLAGS += -r
-
-# `make` considers that PHONY targets do not correspond to files (other
-# targets do and the files have their dates checked). This declaration renders
-# innocuous the "feature" where `make` always tries to make its own
-# makefiles. There is no command line switch to turn this "feature" off.
-.PHONY: $(MAKEFILE_LIST)
-
-# 'make' has a "feature" where it deletes what it determines to be intermediate
-# files. There is no command line switch to turn this "feature" off. Combine
-# this "feature" with implicit rules and have loads of fun.
-.PRECIOUS: $(MAKEFILE_LIST)
-
-#$(info makefile: $(MAKEFILE_LIST))
-#$(info project_MAKECMDGOALS: $(MAKECMDGOALS))
-
-# for recursive make without leaving this makefile
-REMAKE = $(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE_LIST)
-
-#================================================================================
-# Custom make targets
-#
-.PHONY: all ANTLR_OUT_FL
-
-all: ANTLR_OUT_FL
-
-ANTLR_OUT_FL: $(EXECUTOR_IN_DIR)/ANTLR_OUT_FL
-
-#================================================================================
-# generic targets, aka recipes
-#
-
-# Without this, `make` sees .jar files as intermediate and deletes them.
-.PRECIOUS: $(JAVA_COMP_OUT_DIR)/%.jar
-
-# make .class file from .java file
-$(JAVA_COMP_OUT_DIR)/%.class: $(JAVA_COMP_IN_PRIMARY_DIR)/%.java
-       @echo "Compiling $<..."
-       $(JAVA_COMP) -d $(JAVA_COMP_OUT_DIR) -sourcepath $(JAVA_COMP_IN_DL) $<
-       @echo "Created $@"
-
-# make .jar from .class file
-$(JAVA_COMP_OUT_DIR)/%.jar: $(JAVA_COMP_OUT_DIR)/%.class
-       @echo "Building $*..."
-       $(JAVA_ARCHIVE) cf $@ -C $(JAVA_COMP_OUT_DIR) $*.class
-       @echo "Created $@"
-
-#make the wrapper script from the .jar file
-$(EXECUTOR_IN_DIR)/%: $(JVM_IN_DIR)/%.jar
-       @echo "Creating program for $*..."
-       @echo "#!/usr/bin/env bash" > $(EXECUTOR_IN_DIR)/$*
-       @echo "$(JAVA_INTERP) -cp ${CLASSPATH}:${JVM_IN_DP}:$(JVM_IN_DP)/$*.jar $*" \$$\@ >> $(EXECUTOR_IN_DIR)/$*
-       chmod +x $(EXECUTOR_IN_DIR)/$*
-       @echo "Created program $(EXECUTOR_IN_DIR)/$*"
diff --git a/developer/Lethe/makefile-top.mk b/developer/Lethe/makefile-top.mk
deleted file mode 100644 (file)
index 0642609..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#================================================================================
-# top level makefile calls makefile-tool and makefile-project
-#
-# GNU makefile
-
-# turn off implicit rules, because they can do unexpected things.
-.SUFFIXES:
-MAKEFLAGS += -r
-
-# `make` considers that PHONY targets do not correspond to files (other
-# targets do and the files have their dates checked). This declaration renders
-# innocuous the "feature" where `make` always tries to make its own
-# makefiles. There is no command line switch to turn this "feature" off.
-.PHONY: $(MAKEFILE_LIST)
-
-# 'make' has a "feature" where it deletes what it determines to be intermediate
-# files. There is no command line switch to turn this "feature" off. Combine
-# this "feature" with implicit rules and have loads of fun.
-.PRECIOUS: $(MAKEFILE_LIST)
-
-#$(info makefile: $(MAKEFILE_LIST))
-#$(info project_MAKECMDGOALS: $(MAKECMDGOALS))
-
-# for recursive make without leaving this makefile
-REMAKE = $(MAKE) -$(MAKEFLAGS) -f $(MAKEFILE_LIST)
-
-#================================================================================
-# Custom make targets
-#
-.PHONY: all nothing version clean setup
-
-all: project-all
-
-# useful for distinguishing between make syntax errors and build errors
-nothing:
-       @:
-
-version:
-       $(info ANTLR_JAR is '$(notdir $(ANTLR_JAR))')
-       @ $(JAVA_COMP) --version
-       @ $(JAVA_ARCHIVE) --version
-       @ make -v | head -n 1
-       @ echo "makefile 0.4"
-
-# `clean` is program independent of `make`
-clean:
-       @echo "Use the command `clean <option>` instead of make.`"
-
-setup:
-       mkdir -p $(ANTLR_IN_PRIMARY_DIR) $(JAVA_COMP_IN_PRIMARY_DIR) $(JVM_IN_DIR) $(EXECUTOR_IN_DIR) test deprecated experiment ologist temporary
-
-# Ensure tools are built before building the project programs
-tool-%: setup
-       $(BIN_MAKE) -f $(EXECUTOR_IN_DIR)/makefile-tool.mk -$(MAKEFLAGS) $*
-
-project-%: tool-all
-       $(BIN_MAKE) -f $(EXECUTOR_IN_DIR)/makefile-project.mk -$(MAKEFLAGS) $*
-
-# delegate other targets to the project
-%: project-%
-       @:
-
diff --git a/developer/build.gradle b/developer/build.gradle
deleted file mode 100644 (file)
index 1bdbd5d..0000000
+++ /dev/null
@@ -1,1011 +0,0 @@
-//---------------------------------------------------------------------------------
-// globals
-
-// string comprehension includes for regular expressions
-def base = "[a-zA-Z0-9_-]+"
-def ext = "[a-zA-Z0-9_-]+$"
-def name = "${base}\\.${ext}"
-def path = ".+/${name}"
-
-//--------------------------------------------------------------------------------
-// Import variables from the environment
-//
-
-def env = [:]
-
-// Required shell environment variables
-def varName_List = [
-  'REPO_HOME',
-  'PROJECT',
-  'ENV_BUILD_VERSION',
-  'DEVELOPER_HOME'
-]
-varName_List.each { varName ->
-  def value = System.getenv(varName) ?: ""
-  env[varName] = value
-}
-
-// Optional shell environment variables
-def varNameOptional_List = [
-  'CLASSPATH'
-]
-varNameOptional_List.each { varName ->
-  def value = System.getenv(varName) ?: ""
-  env[varName] = value
-}
-
-env.CLASSPATH += ":${env.ANTLR_JAR}"
-
-//--------------------------------------------------------------------------------
-// PM installed tools to be used
-//    these should be added to the project object by the installer ,and taken
-//    from the project object here.
-//
-// Tools used (set by project manager: JAVA_HOME ,ANTLR_JAR ,DEVELOPER_HOME)
-def JAVA_COMP_FP = "${env.JAVA_HOME}/bin/javac"   // Java compiler path
-def JAVA_INTERP_FP = "${env.JAVA_HOME}/bin/java"  // Java interpreter path
-def JAVA_ARCHIVE_FP = "${env.JAVA_HOME}/bin/jar"  // Java archive tool path
-
-
-//--------------------------------------------------------------------------------
-// Directory structure
-//
-
-def dir_map = [
-  ,'EXECUTOR_IN'         : 'executor/'
-  ,'ANTLR_IN_LEAF'       : 'ANTLR/'
-  ,'ANTLR_OUT'           : 'javac/ANTLR/'
-  ,'ANTLR_OUT_PARENT'    : 'javac/'
-  ,'JAVA_COMP_IN'        : 'javac/'
-  ,'JAVA_COMP_IN_LEAF': 'javac/leaf/'
-  ,'JAVA_COMP_IN_ANTLR'  : 'javac/ANTLR/'
-  ,'JAVA_COMP_IN_SYN'    : 'javac/synthesized/'
-  ,'JAVA_COMP_OUT'       : 'jvm/'
-  ,'JVM_IN'              : 'jvm/'
-  ,'TEMP'                : 'Erebus/'
-]
-
-// Update CLASSPATH
-env.CLASSPATH += ":${dir_map.JVM_IN}"
-
-// Construct JAVA_COMP_IN_LIST dynamically and add to dp map
-dir_map.JAVA_COMP_IN_LIST = 
-  "${dir_map.JAVA_COMP_IN_LEAF}" +
-  ":${dir_map.JAVA_COMP_IN_ANTLR}" +
-  ":${dir_map.JAVA_COMP_IN_SYN}"
-
-println "CLASSPATH: ${env.CLASSPATH}"
-println "JAVA_COMP_IN_LIST: ${dir_map.JAVA_COMP_IN_LIST}"
-
-
-// Subroutine to print missing environment variables list message
-def printMissingVars(missingVars) {
-  if (missingVars.isEmpty()) {
-    // Print nothing if the list is empty
-    return
-  } else if (missingVars.size() == 1) {
-    println "This environment variable was not set: ${missingVars[0]}"
-  } else {
-    println "These environment variables were not set: ${missingVars.join(' ,')}"
-  }
-}
-
-task preface {
-  dependsOn ':installTools'
-  doFirst {
-    
-    // Environment variable checks
-    def error_missing = false
-    def error_project = false
-    def missingVars = [] // To collect missing environment variables
-    varName_List.each { varName ->
-      if (!env[varName]) {
-        error_missing = true
-        missingVars << varName
-      }
-    }
-    printMissingVars(missingVars)
-    if (env.PROJECT != "GQL_to_Cypher") {
-      error_project = true
-      println "Expected project 'GQL_to_Cypher' ,but found '${env.PROJECT}'."
-    }
-    if (error_missing || error_project) {
-      throw new GradleException("Bailing due to missing environment variables.")
-    }
-  }
-  doLast {
-    println "================================================================================"
-    println "Building project .."
-  }
-}
-
-/*--------------------------------------------------------------------------------
- Some dependency graph features
-*/
-
-def all_node_type_set = ['symbol' ,'path' ,'leaf'] as Set
-
-def persistent_node_mark_set = ['cycle_member' ,'wellformed' ,'build_failed'] as Set
-
-def leaf_q = { node -> node.type && node.type == 'leaf' }
-def marked_q = { node -> node.mark && !node.mark.isEmpty() }
-
-// 'wellformed' and `cycle_member` marks set by `well_formed_q` function
-// 'build_failed' set by `run_build_scripts_f`
-def marked_good_q(node){
-  return (
-    node 
-    && node.mark 
-    && ('wellformed' in node.mark) 
-    && !('cycle_member' in node.mark)
-    && !('build_failed' in node.mark)
-  )
-}
-
-def set_mark(node ,mark){
-  node.mark = node.mark ?: [] as Set
-  node.mark << mark
-}
-
-def clear_mark(node ,mark){
-  if( node.mark ) node.mark.remove(mark)
-}
-
-def file_exists_q(node_label) {
-  def node_path = Paths.get(node_label)
-  return Files.exists(node_path)
-}
-
-
-/*--------------------------------------------------------------------------------
- Well formed dependency graph node checker.
-
-*/
-def all_form_error_set = [
-  'no_node_label'
-  ,'no_such_node_type'
-  ,'neighbor_property_value_not_a_list'
-  ,'unregistered_mark'
-  ,'symbol_has_build_code'
-  ,'symbol_has_no_dependencies'
-  ,'missing_required_build_code'
-  ,'build_target_has_no_dependencies'
-  ,'leaf_has_neighbor_property'
-  ,'leaf_has_neighbor'
-]
-def wellformed_q = { node -> 
-  def form_error_set = [] as Set
-
-  if( 
-    !node.label || node.label.length() == 0 
-  ) 
-    form_error_set << 'no_node_label'
-
-  if( 
-    !node.type || !(node.type in all_node_type_set) 
-  ) 
-    form_error_set << 'no_such_node_type'
-
-  if(
-    node.neighbor 
-    && !(node.neighbor instanceof List)
-  )
-    form_error_set << 'neighbor_property_value_not_a_list'
-
-  if( 
-    node.mark
-    && (node.mark instance of Set)
-    && ! (node.mark.every {it in persistent_node_mark_set})
-  ) 
-    form_error_set << 'unregistered_mark'
-
-  if( 
-    node.type == "symbol" 
-    && node.build
-  )
-    form_error_set << 'symbol_has_build_code'
-
-  if( 
-    node.type == "symbol" 
-    && ( !node.neighbor || node.neighbor.isEmpty() )
-  )
-    form_error_set << 'symbol_has_no_dependencies'
-
-  if( 
-    node.type == "path" 
-    && (!node.build || !(node.build instanceof Closure))
-  )
-    form_error_set << 'missing_required_build_code'
-
-  if( 
-    node.type == "path" 
-    && ( !node.neighbor || node.neighbor.isEmpty() )
-  )
-    form_error_set << 'build_target_has_no_dependencies'
-
-  if( 
-    node.type == "symbol" 
-    && ( node.neighbor || node.neighbor.isEmpty() )
-  )
-    form_error_set << 'symbol_has_no_dependencies'
-
-  if( 
-    node.type == "leaf" 
-    && node.neighbor
-  ){
-    form_error_set << 'leaf_has_neighbor_property'
-    if( !node.neighbor.isEmpty()  )
-      form_error_set << 'leaf_has_neighbor'
-  }
-
-  return form_error_set
-}
-
-
-/*--------------------------------------------------------------------------------
- Dependency DAG definition.
-
- Programmers will add new entries here when adding new programs to be built.
-
- 'node': a dictionary of properties.
- 'file node': a path or leaf type node.
- 'node file': the label of a path or leaf type node ,relative to the developer's directory.
-
- Node Properties:
- - type: The type of the node: 'leaf' ,'symbol' ,or 'path'.
- - label: Unique label. AKA ,the 'node file'.
- - neighbor: List of labels for the node's dependencies.
- - must_have: Files that should not be removed if the given node file is not removed.
- - build: For path type nodes ,code that builds the node.
- - mark: a set of 'mark' tokens optionally placed on a node
-
- DAG is defined through the 'lookup' function ,which when given a label ,returns
- a dictionary. Lookup uses a combination of a map keyed on the label ,and a list
- of label recognizer functions that each return a dictionary when a match is
- found. 
-
-*/
-
-def node_map = [
-
-  "all" : [
-    ,type: "symbol"
-    ,neighbor: [
-      "ANTLR_OUT_FL"
-      ,"RuleNameList"
-      ,"RuleNameListRegx"
-      ,"Synthesize_SyntaxAnnotate"
-      ,"Synthesize_SyntaxAnnotate_PrintVisitor"
-      ,"Synthesize_SyntaxAnnotate_PrintVisitorMethod"
-    ]
-  ]
-
-  "ANTLR_OUT_FL" : [
-    ,type: "symbol"
-    ,neighbor: ["${dir_map.EXECUTOR_IN}/ANTLR_OUT_FL"]
-  ]
-
-  ,"RuleNameList" : [
-    ,type: "symbol"
-    ,neighbor: ["${dir_map.EXECUTOR_IN}/RuleNameList"]
-  ]
-
-  ,"RuleNameListRegx" : [
-    ,type: "symbol"
-    ,neighbor: ["${dir_map.EXECUTOR_IN}/RuleNameListRegx"]
-  ]
-
-  ,"Synthesize_SyntaxAnnotate" : [
-    ,type: "symbol"
-    ,neighbor: [
-      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"
-      ,"${dir_map.EXECUTOR_IN}/Synthesize_SyntaxAnnotate"
-    ]
-  ]
-
-  "Synthesize_SyntaxAnnotate.class" : [
-    type: 'path',  // It's a path type node
-    neighbor: [
-      "${dir_map.JAVA_COMP_IN_LEAF}/Synthesize_SyntaxAnnotate.java",  // Dependency
-      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"  // Dependency
-    ],
-    build: { node, neighbor ->
-      def javac_cmd = "${JAVA_COMP_FP} -d ${dir_map.JAVA_COMP_OUT} ${neighbor.join(' ')}"
-      javac_cmd.execute().waitFor()
-    }
-  ]
-
-
-  "Synthesize_SyntaxAnnotate.class" : [
-    type: "path",
-    neighbor: [
-      "${dir_map.JAVA_COMP_IN_SYN}/Synthesize_SyntaxAnnotate.java"
-    ],
-    build: { node ->
-      def src = "${dir_map.JAVA_COMP_IN_SYN}/Synthesize_SyntaxAnnotate.java"
-      def dest = "${dir_map.JAVA_COMP_IN_SYN}/Synthesize_SyntaxAnnotate.class"
-      exec {
-        commandLine = [JAVA_COMP_FP, '-d', dir_map.JAVA_COMP_OUT, src]
-      }
-      if (!file_exists_q(dest)) {
-        throw new GradleException("Failed to compile Synthesize_SyntaxAnnotate.java")
-      }
-    }
-  ]
-
-
-
-  ,"Synthesize_SyntaxAnnotate_PrintVisitor" : [
-    ,type: "symbol"
-    ,neighbor: [
-      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"
-      ,"${dir_map.JAVA_COMP_IN_LEAF}/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java"
-      ,"${dir_map.EXECUTOR_IN}/Synthesize_SyntaxAnnotate_PrintVisitor"
-    ]
-  ]
-
-  ,"Synthesize_SyntaxAnnotate_PrintVisitorMethod" : [
-    ,type: "symbol"
-    ,neighbor: [
-      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"
-      ,"${dir_map.EXECUTOR_IN}/Synthesize_SyntaxAnnotate_PrintVisitorMethod"
-    ]
-  ]
-]
-
-// start of node_label recognizer functions list
-
-// recognizes any leaf node due to being located in javac/leaf
-def node_leaf_f(node_label) {
-  def leafNodePattern = ~/${dir_map['JAVA_COMP_IN_LEAF']}(.*)/
-  def match = node_label =~ leafNodePattern
-  if (!match) {
-    return [status: "no_match"]
-  }
-  def baseName = match[0][1]
-
-  def leafFilePath = "${dir_map['JAVA_COMP_IN_LEAF']}${baseName}"
-  def leafFile = new File(leafFilePath)
-  if (!leafFile.exists()) {
-    return [status: "no_match"]
-  }
-
-  return [
-    status: "matched"
-    ,label: node_label
-    ,type: "leaf"
-    ,neighbor: []
-  ]
-}
-
-// any shell wrapper (for wrapping a name corresponding .jar file)
-def node_executor_f(node) {
-
-  def match = node =~ /^(executor\/)(${base})$/
-  if (!match) {
-    return [status: "no_match"]
-  }
-  def baseName = match[0][2]
-
-  def jarFilePath = "${dir_map['JVM_IN']}${baseName}.jar"
-  def wrapperFilePath = "${dir_map['EXECUTOR_IN']}${baseName}"
-
-  def jarFile = new File(jarFilePath)
-  if (!jarFile.exists()) {
-    return [status: "no_match"]
-  }
-
-  return [
-    status: "matched"
-    ,label: node
-    ,type: "path"
-    ,neighbor: [jarFilePath]
-    ,must_have: [jarFilePath]
-    ,build: { node ,neighbor -> 
-
-      // The script for wrapping the jar file:
-      def wrapper =
-      """
-      #!/usr/bin/env bash
-      ${dir_map['JAVA_INTERP']} -cp \${CLASSPATH}:${dir_map['JVM_IN']}:${dir_map['JVM_IN']}/${baseName}.jar ${baseName} \\\$\\@
-      """
-      
-      new File(wrapperFilePath).withWriter('UTF-8') { writer ->
-        writer.write(wrapper)
-      }
-
-      println "Creating executable wrapper script for ${baseName} in executor directory."
-      "chmod +x ${wrapperFilePath}".execute().text
-    }
-  ]
-}
-
-// any antlr output java file
-def node_grammar_f(node) {
-
-  def match = node =~ /^(${dir_map['ANTLR_OUT']})(${base})(Lexer|Parser|BaseListener|Listener|BaseVisitor|Visitor)\.java$/
-  if( !match ){
-    return [status: "no_match"]
-  }
-
-  def grammarName = match[0][2]
-  def outputType = match[0][3]
-
-  def grammarFilePath = "${dir_map['ANTLR_IN_LEAF']}${grammarName}.g4"
-  def grammarFile = new File(grammarFilePath)
-
-  if( !grammarFile.exists() ){
-    return [status: "no_match"]
-  }
-
-  return [
-    status: "matched"
-    ,label: node
-    ,type: "path"
-    ,neighbor: [grammarFilePath]
-  ]
-}
-
-// Recognizes any class file (built from a corresponding .java file of the same name)
-def node_class_f(node) {
-
-  def match = node =~ /^(${dir_map['JAVA_COMP_OUT']})(${base})\.class$/
-  if( !match ){
-    return [status: "no_match"]
-  }
-
-  def baseName = match[0][2]
-  def javaFilePath = "${dir_map['JAVA_COMP_IN_PRIMARY_DIR']}/${baseName}.java"
-  def javaFile = new File(javaFilePath)
-
-  if( !javaFile.exists() ){
-    return [status: "no_match"]
-  }
-
-  return [
-    status: "matched",
-    label: node,
-    type: "path",  // It's a path node since we're building the .class file
-    neighbor: [javaFilePath],  // The corresponding .java file
-    build: { node, neighbor ->
-        def javac_cmd = "${JAVA_COMP_FP} -d ${dir_map.JAVA_COMP_OUT} -sourcepath ${dir_map.JAVA_COMP_IN_DL} ${neighbor[0]}"
-        javac_cmd.execute().waitFor()
-    }
-  ]
-}
-
-// any jar file (built from a corresponding class file)
-def node_jar_f(node) {
-
-  // Use the symbolic name and base patterns
-  def match = node =~ /^(${dir_map['JAVA_COMP_OUT']})(${base})\.jar$/
-
-  if( !match ){
-    return [status: "no_match"]
-  }
-
-  def baseName = match[0][2]
-  def classFilePath = "${dir_map['JAVA_COMP_OUT']}${baseName}.class"
-  def classFile = new File(classFilePath)
-
-  if( !classFile.exists() ){
-    return [status: "no_match"]
-  }
-
-  return [
-    status: "matched"
-    ,label: node
-    ,type: "path"
-    ,neighbor: [classFilePath]
-    ,build: { node ,neighbor ->
-      println "Building jar for ${baseName}"
-      def command = "${ext.javaHome}/bin/jar cf ${baseName}.jar -C ${dir_map['JAVA_COMP_OUT']} ${baseName}.class"
-      return command.execute().text;
-    }
-  ]
-}
-
-// list of the recognizer functions
-def node_f_list = [
-  node_leaf_f
-  ,node_executor_f
-  ,node_grammar_f
-  ,node_class_f
-  ,node_jar_f
-]
-
-// end of DAG definition
-
-/*--------------------------------------------------------------------------------
- Given a node_label ,returns the node or null.
-
-*/
-def lookup(node_label ,verbose = false){
-  def lookup_node = node_map[node_label]
-  if( lookup_node ){
-    lookup_node.label = node_label
-  } else {
-    def match_result
-    for(func in node_f_list){
-      match_result = func(node_label)
-      if(match_result.status == "matched"){
-        lookup_node = match_result
-        break
-      }
-    }
-  }
-  if( !lookup_node ){
-    if( verbose ) println "lookup:: Node ${node_label} could not be found."
-    return null
-  }
-  return lookup_node
-}
-
-// mark aware lookup function
-def lookup_marked_good(node_label ,verbose = false){
-  def node = lookup(node_label ,verbose)
-  if( node && marked_good_q(node) ) return node;
-  return null;
-}
-
-/*--------------------------------------------------------------------------------
- A well formed graph checker.  Traverses entire graph and marks nodes
- that are not well formed or that are part of a cycle.
-
- This must be run on the graph for `lookup_marked_good` to work.
-*/
-
-/*
- Given a node label list. Applies well_formed_q to each node and marks the
- node accordingly. Returns 'all_wellformed' or 'exists_malformed'.
-*/
-def mark_the_wellformed_f(node_label_list ,boolean verbose = true){
-  def all_wellformed = true
-
-  def neighbors = node_label_list.collect{ neighbor_label ->
-    def neighbor_node = lookup(neighbor_label)
-    def form_errors = wellformed_q(neighbor_node)
-    if(form_errors.isEmpty()){
-      neighbor_node.mark = neighbor_node.mark ?: [] as Set
-      neighbor_node.mark << 'wellformed'
-    } else {
-      all_wellformed = false
-      if(verbose){
-        if(neighbor_node.label && neighbor_node.label.length() > 0){
-          print("node ${neighbor_node.label} is malformed due to:")
-        } else {
-          print("anonymous node is malformed due to:")
-        }
-        form_errors.each { error -> print(" ${error}") }
-        println("")
-      }
-    }
-    neighbor_label
-  }
-
-  return all_wellformed ? 'all_wellformed' : 'exists_malformed'
-}
-
-/*
- Given a path stack initialized with the path root ,descends to a leaf node
- while looking for cycles. Marks nodes as 'cycle_member' if a cycle is
- detected. Marks nodes as `wellformed` if `wellformed_q`.  Returns a set of
- tokens indicating the status: 'cycle_found' ,'defacto_leaf_node' ,and
- 'exists_malformed'.
-*/
-def markup_graph_f_descend(path_stack ,boolean verbose = true){
-  def ret_value = [] as Set
-  def local_path = path_stack.collect{ it[0] }
-  def local_node_label = local_path[-1]
-  def cycle_start_index
-
-  do{
-    // Check for a cycle in the local path
-    cycle_start_index = local_path[0..-2].findIndexOf{ it == local_node_label }
-    if(cycle_start_index != -1){ // Cycle detected
-      ret_value << 'cycle_found'
-      if(verbose) print "markup_graph_f_descend:: dependency cycle found:"
-      local_path[cycle_start_index..-1].each{ cycle_node_label ->
-        def cycle_node = lookup(cycle_node_label)
-        if(verbose) print " ${cycle_node.label}"
-        cycle_node.mark = cycle_node.mark ?: [] as Set // Initialize mark set if needed
-        cycle_node.mark << 'cycle_member'
-      }
-      if(verbose) println ""
-      // we can not continue searching after the loop so ,we pop back to treat
-      // the first node in the loop as though a leaf node.
-      path_stack = path_stack[0..cycle_start_index]
-      return ret_value
-    }
-
-    // a 'de-facto' leaf node test subtleties here because we have not yet
-    // determined if the nodes we are wellformed. This is purposeful ,as
-    // this function does not know about the relationships between the 
-    // possible error marks.
-    def local_node = lookup(local_node_label)
-    if(local_node.neighbor.isEmpty()){
-      ret_value << 'defacto_leaf_node'
-      return ret_value
-    }
-
-    // Mark the wellformed nodes and get the result
-    def result = mark_the_wellformed_f(local_node.neighbor ,verbose)
-    if(result == 'exists_malformed'){
-      ret_value << 'exists_malformed'
-    }
-    
-    // Descend further into the tree.
-    path_stack << local_node.neighbor.clone()
-    local_node_label = local_node.neighbor[0]
-    local_path << local_node_label
-  }while(true)
-}
-
-/*
- Given root_node_labels ,marks up the graph and returns a set possibly
- containing 'all_wellformed' and 'cycles_exist'.
-
- Marks potentially added to each node include  'cycle_member' ,'wellformed'.
- Note that these marks are independent.
-*/
-def wellformed_graph_q(root_node_labels ,boolean verbose = true){
-  def ret_value = [] as Set
-  def exists_malformed = false;
-
-  // check the root nodes
-  def result = mark_the_wellformed_f(root_node_labels ,verbose)
-  if(result == 'exists_malformed'){
-    ret_value << 'exists_malformed'
-  }
-
-  // Initialize the DFS tree iterator.
-  def path_stack = []
-  path_stack << root_node_labels.clone()
-
-  // iterate over left side tree descent ,not ideal as it starts at the
-  // root each time ,but avoids complexity in the cycle detection logic.
-  do{
-    def result = markup_graph_f_descend(path_stack ,verbose)
-    if('cycle_found' in result) ret_value << 'cycle_exists'
-    if('exists_malformed' in result) exists_malformed = true;
-
-    // increment the iterator to the next leftmost path
-    def top_list = path_stack[-1]
-    top_list.remove(0)
-    if(top_list.isEmpty()) path_stack.pop()
-
-  }while(!path_stack.isEmpty())
-
-  if(!exists_malformed) ret_value << 'all_wellformed'
-  if( verbose ){
-    if(exists_malformed) println("one or more malformed nodes were found")
-    def exists_cycle = 'cycle_found' in ret_value
-    if(exists_cycle) println("one or more cyclic dependency loop found")
-    if( exists_malformed || exists_cycle ) println("will attempt to build unaffected nodes")
-  }
-
-  return ret_value
-}
-
-
-/*
- Given `root_node_labels` of a DAG. Applies `node_function` to each node in a
- depth-first traversal order.  Returns a set of error tokens encountered
- during traversal.
-
- `wellformed_graph_q` must be run on the DAG before this function is called ,or
- `lookup_marked_good` will not function correctly.
-*/
-def all_DAG_DF(root_node_labels ,node_function ,boolean verbose = true) {
-  def error_token_set = [] as Set
-
-  if (root_node_labels.isEmpty()) return error_token_set
-
-  def visited = [] as Set
-  def in_traversal_order = []
-  def stack = []
-
-  root_node_labels.each { root_label ->
-    stack << root_label
-  }
-
-  do {
-    def node_label = stack.pop()
-    
-    def node = lookup_marked_good(node_label ,verbose)
-    if (!node) {
-      error_token_set << 'lookup_fail'
-      continue
-    }
-
-    if (node.label in visited) continue
-    visited << node.label
-
-    in_traversal_order << node
-
-    node.neighbor.each { neighbor_label ->
-      stack << neighbor_label
-    }
-  } while (!stack.isEmpty())
-
-  in_traversal_order.reverse().each { node ->
-    node_function(node ,error_token_set ,verbose)
-  }
-
-  return error_token_set
-}
-
-
-/*--------------------------------------------------------------------------------
- run the build scripts
-   depends upon is_acyclic having already marked up the graph.
-*/
-
-import java.nio.file.Files
-import java.nio.file.Paths
-
-// a symbol dependency is good ,as long as it is built before the node in question
-def good_dependency_q(node_labels) {
-  return node_labels.every { node_label ->
-    def node = lookup_marked_good(node_label)
-    if (!node) return false
-    if (node.type in ['path' ,'leaf'] && !file_exists_q(node.label)) return false
-    return true
-  }
-}
-
-/* 
- Given a node label and a list of node labels ,returns true if the file at the
- node label in the first argument is newer than all the files at the
- corresponding node labels in the second list.
-*/
-def newer_than_all(node_label ,node_label_list) {
-  def node_path = Paths.get(node_label)
-  if (!Files.exists(node_path)) return false
-
-  def node_last_modified = Files.getLastModifiedTime(node_path).toMillis()
-
-  return node_label_list.every { label ->
-    def path = Paths.get(label)
-    if (!Files.exists(path)) return false
-    def last_modified = Files.getLastModifiedTime(path).toMillis()
-    return node_last_modified > last_modified
-  }
-}
-
-def can_be_built_q(node){
-  if( !marked_good_q(node) ) return false;
-  if( 
-    (node.type == 'symbol' || type == 'path')
-    && !good_dependency_q( node.neighbor )
-  ){
-    return false
-  }
-  if(
-    node.type == 'leaf'
-    && !file_exists_q(node.label)
-  ){ 
-    return false;
-  }
-  return true
-}
-
-// `can_be_build_q` must be true for this to be meaningful:
-def should_be_built_q(node ,verbose = true) {
-  if(node.type == 'leaf') return false
-  if(node.type == 'symbol') return true
-  if( node.type == 'path') return !newer_than_all(node.label ,node.neighbor)
-  println("should_be_build_q:: unrecognized node type ,so assuming it should not be built.")
-  return false
-}
-
-/*
- Runs build scripts for the given root_node_labels in a depth-first traversal order.
- Uses `all_DAG_DF` to traverse the graph and applies the build function to each node.
-
- Be sure that `wellformed_graph_q` has been run on DAG.
-
- Be sure that the 'build_failed' marks have been cleared if this is not the
- first build attempt.
-*/
-def run_build_scripts_f(root_node_labels ,boolean verbose = true){
-  if( root_node_labels.isEmpty() ) return
-
-  // Define the function to be applied to each node
-  def node_function = { node ,error_token_set ->
-
-    if( !can_be_built_q(node) ){
-      println("Skipping build for ${node.label} due to dependency problems or found leaf is missing")
-      return
-    }
-
-    if( !should_be_built_q(node) ){
-      if(verbose) println("${node.label} already up to date")
-      return
-    }
-
-    // if we get here, node can and should be built
-
-    println("Running build script for ${node.label}")
-    node.build(node ,node.neighbor)
-
-    // Check if the build updated the target file
-    if( should_be_built_q(node) ){
-      println("Build failed for ${node.label}")
-      set_mark(node ,'build_failed')
-    }
-
-  }
-
-  // Apply the function to all nodes in a depth-first manner
-  all_DAG_DF(root_node_labels ,node_function ,verbose)
-}
-
-
-------------------------------------
-
-def run_build_scripts_f( root_node_labels ,boolean verbose = true ){
-  if( root_node_labels.isEmpty() ) return
-
-  def visited = [] as Set
-  def build_order = []
-  def stack = []
-
-  root_node_labels.each{ root_label ->
-    stack << root_label
-  }
-
-  do{
-    def node_label = stack.pop()
-    def node = lookup( node_label ,verbose )
-    if( !node ) continue
-
-    if( node.label in visited ) continue
-    visited << node.label
-
-    if( !marked_good_q( node ) ){
-      if( verbose ) println( "Skipping malformed node ${node.label}" )
-      continue
-    }
-
-    // Clear the build_failed mark
-    node.mark.remove( 'build_failed' )
-
-    // reverse to be consistent in using the left subtree first
-    node.neighbor.reverse().each{ neighbor_label ->
-      stack << neighbor_label
-    }
-
-    build_order << node
-  }while( !stack.isEmpty() )
-
-  build_order.reverse().each{ node ->
-    def build_status = build_status_q( node ,verbose )
-    if( build_status == 'should_build' ){
-      println( "Running build script for ${node.label}" )
-      node.build( node ,node.neighbor )
-
-      // Check if the build updated the target file
-      if( build_status_q( node ,verbose ) == 'should_build' ){
-        println( "Build failed for ${node.label}" )
-        node.mark = node.mark ?: [] as Set
-        node.mark << 'build_failed'
-      }
-    } else if( build_status == 'dependency_problem' ){
-      println( "Skipping build for ${node.label} due to dependency problems" )
-    } else if( build_status == 'leaf' ){
-      println( "Skipping build for leaf node ${node.label}" )
-    }
-  }
-}
-
-
---------------------------------------------------------------------------------
-def clean(nodes_to_clean) {
-  def all_dependencies = node_map["all"].neighbor.clone()
-  nodes_to_clean.each { node ->
-    all_dependencies.remove(node)
-  }
-
-  def must_have_nodes = []
-  all_dependencies.each { node ->
-    def node_info = node_map[node]
-    if (node_info.must_have) {
-      must_have_nodes += node_info.must_have
-    }
-  }
-
-  def to_clean_list = []
-  nodes_to_clean.each { node ->
-    if (!must_have_nodes.contains(node) && node_map[node].type == "path") {
-      to_clean_list += node
-    }
-  }
-
-  to_clean_list.each { node ->
-    def file_path = node_map[node].label
-    def file = new File(file_path)
-    if (file.exists()) {
-      file.delete()
-      println "Deleted file: ${file_path}"
-    }
-  }
-}
-
-
---------------------------------------------------------------------------------
-def mark_for_clean_q( node ){
-  if( node.type == 'leaf' ) return false
-
-  if( node.type == 'symbol' || node.type == 'path' ){
-    def dependencies = node.neighbor.findAll{ neighbor_label ->
-      def neighbor_node = lookup( neighbor_label )
-      return good_dependency_q( neighbor_node )
-    }
-    return dependencies.size() == node.neighbor.size()
-  }
-
-  return false
-}
-
-def clean_nodes(root_node_labels ,boolean verbose = true){
-  if( root_node_labels.isEmpty() ) return
-
-  def visited = [] as Set
-  def clean_order = []
-  def stack = []
-
-  root_node_labels.each{ root_label ->
-    stack << root_label
-  }
-
-  do{
-    def node_label = stack.pop()
-    def node = lookup( node_label ,verbose )
-    if( !node ) continue
-
-    if( node.label in visited ) continue
-    visited << node.label
-
-    if( !marked_good_q( node ) ){
-      if( verbose ) println( "Skipping malformed node ${node.label}" )
-      continue
-    }
-
-    // reverse to be consistent in using the left subtree first
-    node.neighbor.reverse().each{ neighbor_label ->
-      stack << neighbor_label
-    }
-
-    clean_order << node
-  }while( !stack.isEmpty() )
-
-  clean_order.reverse().each{ node ->
-    if( mark_for_clean_q( node ) ){
-      def can_clean = true
-      node.uses?.each{ used_label ->
-        def used_node = lookup( used_label )
-        if( used_node && !mark_for_clean_q( used_node ) ){
-          can_clean = false
-          if( verbose ) println( "Cannot clean ${node.label} because it uses ${used_node.label}" )
-        }
-      }
-      if( can_clean ){
-        println( "Cleaning node ${node.label}" )
-        node.clean( node ,node.neighbor )
-      } else {
-        if( verbose ) println( "Skipping node ${node.label} due to dependency problems" )
-      }
-    } else if( node.type == 'leaf' ){
-      if( verbose ) println( "Skipping leaf node ${node.label}" )
-    } else {
-      if( verbose ) println( "Skipping node ${node.label} due to dependency problems" )
-    }
-  }
-}
-
-
-// LocalWords:  FN FPL DN DNL RuleNameListRegx RuleNameList PrintVisitorMethod
-// LocalWords:  PrintVisitor SyntaxAnnotate wellformed defacto acyclic
diff --git a/developer/executor/ANTLR_OUT_FL b/developer/executor/ANTLR_OUT_FL
deleted file mode 100755 (executable)
index c1ba0df..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env bash
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -cp :/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:jvm:jvm/ANTLR_OUT_FL.jar ANTLR_OUT_FL $@
diff --git a/developer/executor/cat_w_names b/developer/executor/cat_w_names
deleted file mode 100755 (executable)
index 5a3d173..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-
-# Check if any arguments are provided (input files or directories)
-if [ $# -eq 0 ]; then
-  echo "Usage: $0 <file1> [file2 ...]"
-  exit 1
-fi
-
-# Loop through all provided arguments (files or directories)
-for file in "$@"; do
-  if [ -f "$file" ]; then
-    echo "#--------------------------------------------------------------------------------"
-    echo "# Filename: ${file}"
-    echo "#"
-    cat "$file"
-  fi
-done
diff --git a/developer/executor/clean b/developer/executor/clean
deleted file mode 100755 (executable)
index c8c3091..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/env bash
-
-# Clean targets:
-#
-# 1. > clean temp[orary] - removes files from ./temporary except for .githolder
-#
-# 2. General clean targets:
-#
-#    > clean all # removes all things make built, and thus can be replaced by running make again.
-#    > clean program # removes all built ${EXECUTOR_IN_DIR} scripts and corresponding jar files
-#    > clean class # removes the class files
-#    > clean grammar # removes the generated java grammar files
-#
-# 3. Specific clean targets:
-#
-#    > clean all <program_name> # cleans all files built while building the program
-#    > clean program <program_name> # removes the script and jar file for the given program
-#    > clean grammar <grammar_name> - similar to clean:grammar, but only for the named grammar
-
-# Function to display usage message
-display_usage() {
-  echo "Usage: clean <all [<program_name>] | program [<program_name>] | grammar [<name>] | class | temp[orary]>"
-}
-
-# Function to check if a program is in EXECUTOR_IN_FPL
-is_program_in_fpl() {
-  local program="$1"
-  for prog in $EXECUTOR_IN_FPL; do
-    if [[ "$prog" == *"$program"* ]]; then
-      return 0
-    fi
-  done
-  return 1
-}
-
-# Function to delete a program
-delete_program() {
-  local program="$1"
-  if is_program_in_fpl "$program"; then
-    echo "Deleting program files for '$program'"
-    rm -f "${EXECUTOR_IN_DIR}/$program" "$JAVA_COMP_OUT_DIR/$program.jar" "$JAVA_COMP_OUT_DIR/$program.class"
-  else
-    echo "Error: Program '$program' is not recognized or is not listed in EXECUTOR_IN_FPL."
-    return 1
-  fi
-}
-
-# Command parser
-clean_command_parser() {
-  local token_list=($@)
-  local token_count=${#token_list[@]}
-  local command=${token_list[0]}
-  local arg=${token_list[1]}
-
-  if [ "$token_count" -eq 0 ]; then
-    display_usage
-  elif [ "$token_count" -eq 1 ]; then
-    case "$command" in
-      "temporary" | "temp")
-        ${EXECUTOR_IN_DIR}/clean_directory "$TEMP_DIR"
-        ;;
-      "all")
-        ${EXECUTOR_IN_DIR}/clean_directory "$TEMP_DIR"
-        ${EXECUTOR_IN_DIR}/clean_grammar
-        ${EXECUTOR_IN_DIR}/clean_file_list "JAVA_COMP_OUT_FPL"
-        ${EXECUTOR_IN_DIR}/clean_file_list "JAR_OUT_FPL"
-        ${EXECUTOR_IN_DIR}/clean_file_list "EXECUTOR_IN_FPL"
-        ;;
-      "program")
-        ${EXECUTOR_IN_DIR}/clean_file_list "JAR_OUT_FPL"
-        ${EXECUTOR_IN_DIR}/clean_file_list "EXECUTOR_IN_FPL"
-        ;;
-      "class")
-        ${EXECUTOR_IN_DIR}/clean_file_list "JAVA_COMP_OUT_FPL"
-        ;;
-      "grammar")
-        ${EXECUTOR_IN_DIR}/clean_grammar
-        ;;
-      *)
-        echo "Unknown clean option: $command"
-        ;;
-    esac
-  elif [ "$token_count" -eq 2 ]; then
-    case "$command" in
-      "all")
-        # Program name is $arg.
-        delete_program "$arg"
-        # Custom cleaning for each program.
-        case "$arg" in
-          "Tree_Test")
-            ${EXECUTOR_IN_DIR}/clean_grammar "GQL_Test"
-            ;;
-          "Tree_20240412")
-            ${EXECUTOR_IN_DIR}/clean_grammar "GQL_20240412"
-            ;;
-          "PrintRuleNameList")
-            : 
-            ;;
-          *)
-            echo "Unknown program: $arg"
-            ;;
-        esac
-        ;;
-      "program")
-        # Program name is $arg.
-        delete_program "$arg"
-        ;;
-      "grammar")
-        # Grammar name is $arg.
-        ${EXECUTOR_IN_DIR}/clean_grammar "$arg"
-        ;;
-      *)
-        echo "Unknown clean command: $command"
-        ;;
-    esac
-  else
-    echo "Clean commands are at most two tokens, but we found: $token_count"
-  fi
-}
-
-cd "$DEVELOPER_HOME" || { echo "Failed to change directory to" "$DEVELOPER_HOME"; exit 1; }
-source ${EXECUTOR_IN_DIR}/env_build
-clean_command_parser $@
diff --git a/developer/executor/clean_directory b/developer/executor/clean_directory
deleted file mode 100755 (executable)
index 873d400..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-# helper function for `clean`, though can be called directly
-
-if [ -z "$1" ]; then
-  echo "Error: Directory argument is empty"
-elif [ ! -d "$1" ]; then
-  echo "Error: Directory $1 does not exist"
-else
-  echo "Cleaning directory: $1"
-  find "$1" -mindepth 1 -maxdepth 1 ! -name '.githolder' -exec rm -rf {} +
-  touch "$1/.githolder"
-fi
diff --git a/developer/executor/clean_file_list b/developer/executor/clean_file_list
deleted file mode 100755 (executable)
index d9af5d9..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env bash
-# helper function for `clean`, though can be called directly
-
-if [ -z "$1" ]; then
-  exit 0
-fi
-
-# Determine the directory where the script is located
-script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-
-# Use `env -i` to clear the environment and then source `env_build` from the script's directory
-env -i bash -c "
-
-source '${script_dir}/env_build'
-
-var_name='$1'
-#echo 'var_name is: ' \$var_name
-if [ -z \"\$var_name\" ]; then
-  echo 'USAGE: clean_file_list <env_variable_name>'
-  exit 1
-fi
-
-# Check if the variable is defined in the current environment
-if [ -z \"\$(eval echo \\$\$var_name)\" ]; then
-  echo 'Error: Environment variable \"\$var_name\" is not defined in env_build.'
-  exit 1
-fi
-
-# Check if the variable name contains 'PRIMARY' (case insensitive)
-if [[ \"\$var_name\" =~ [Pp][Rr][Ii][Mm][Aa][Rr][Yy] ]]; then
-  echo 'Error: Environment variable \"\$var_name\" contains \"PRIMARY\" so listed files were not deleted.'
-  exit 1
-fi
-
-# Check if the variable name ends with '_FPL'
-if [[ ! \"\$var_name\" =~ _FPL$ ]]; then
-  echo 'Error: Environment variable \"\$var_name\" must end with \"_FPL\".'
-  exit 1
-fi
-
-# Get the file list from the environment variable
-file_list=\$(eval echo \\$\$var_name)
-echo \$var_name \"=\" \$file_list
-
-if [ -z \"\$file_list\" ]; then
-  exit 0
-fi
-
-for file in \$file_list; do
-  if [ -e \"\$file\" ]; then
-    echo rm -f \"\$file\"
-    rm -f \"\$file\"
-  fi
-done
-" "$1"
diff --git a/developer/executor/clean_grammar b/developer/executor/clean_grammar
deleted file mode 100755 (executable)
index 9e90319..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-# helper function for `clean`, though can be called directly
-
-# Check if required variables are set
-if [ -z "$ANTLR_GRAMMAR_LIST" ] || [ -z "$ANTLR_OUT_DIR" ]; then
-  echo "Error: Required environment variables ANTLR_GRAMMAR_LIST and ANTLR_OUT_DIR are not set."
-  exit 1
-fi
-
-# Function to delete a specific grammar
-delete_grammar() {
-  local grammar=$1
-  # echo "Attempting to delete grammar: $grammar"
-  if [ -z "$grammar" ]; then
-    echo "Error: Grammar name is empty"
-  elif echo "$ANTLR_GRAMMAR_LIST" | grep -qw "$grammar"; then
-    rm -f "$ANTLR_OUT_DIR/$grammar"*
-    echo "Deleted files starting with $grammar in $ANTLR_OUT_DIR"
-  else
-    echo "Invalid grammar name: $grammar"
-  fi
-}
-
-# If no argument is given, delete all grammars
-if [ -z "$1" ]; then
-  echo "Cleaning all grammar builds."
-  for grammar in $ANTLR_GRAMMAR_LIST; do
-    delete_grammar "$grammar"
-  done
-else
-  echo "Argument provided: $1"
-  delete_grammar "$1"
-fi
diff --git a/developer/executor/clean_program b/developer/executor/clean_program
deleted file mode 100755 (executable)
index b2ca550..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-# helper function for `clean`, though can be called directly
-
-# Check if required variables are set
-if [ -z "${EXECUTOR_IN_FPL}" ] || [ -z "${EXECUTOR_IN_DIR}" ]; then
-  echo "Error: Required environment variables EXECUTOR_IN_FPL and EXECUTOR_IN_DIR are not set."
-  exit 1
-fi
-
-# Function to delete a specific program
-delete_program() {
-  local program=$1
-  # echo "Attempting to delete program: $program"
-  if [ -z "$program" ]; then
-    echo "Error: Program name is empty"
-  elif echo "$ANTLR_PROGRAM_LIST" | grep -qw "$program"; then
-    rm -f "$ANTLR_OUT_DIR/$program"*
-    echo "Deleted files starting with $program in $ANTLR_OUT_DIR"
-  else
-    echo "Invalid program name: $program"
-  fi
-}
-
-# If no argument is given, delete all programs
-if [ -z "$1" ]; then
-  echo "removing all program and their jars."
-  for program in ${EXECUTOR_IN_FPL}; do
-    delete_program "$program"
-  done
-else
-  echo "rmoving program $1 and its jar."
-  delete_program "$1"
-fi
diff --git a/developer/executor/env_build b/developer/executor/env_build
deleted file mode 100755 (executable)
index 036961a..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/env bash
-
-# The build environment. 
-#
-# Hopefully no edits are required here to build this project's programs.
-#
-# The most common edit here is to add the name of a new program to the EXECUTOR_IN_FL.
-# That variable is found in the next section.
-#
-# The `env_dev` script should have been sourced already. (env_dev is analogous
-# to the Python virutal environment `activate`.)  `env_dev` will set `developer/executor/`
-# first in the search PATH.  In that directory there is a script called `make` which
-# is a wrapper to `/bin/make`.  That script sources this file.  Hence, this file
-# is the environment for make, aka the build environment.
-#
-# Note these suffixes found on variable names:
-# _FL  = File List
-# _FP  = File Path
-# _FPL = File Path List 
-# _DL  = Directory List
-# _DP  = Directory path
-# _DPL = Directory path list
-#
-# _PRIMARY = stuff not built
-# _IN  things input to some program
-# _OUT things output by some program
-#
-# Relative paths values are relative to the $REPO_HOME/developer directory, unless
-# for good reason which is obvious or stated in a comment adjacent to the variable.
-#
-# This has not yet been split into 'tools'  and 'project'. The redundant build targets
-# should discovered to have already been built.
-
-# Ensure the script is sourced rather than run directly
-if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
-  echo "This script must be sourced, not executed. Exiting."
-  return 1
-fi
-export ENV_BUILD_VERSION="0.2"
-
-#--------------------------------------------------------------------------------
-# programs to be built by make project-all (or more simply `make`)
-#
-
-export EXECUTOR_IN_FL="\
-  RuleNameListRegx\
-  RuleNameList\
-  Synthesize_SyntaxAnnotate_PrintVisitorMethod\
-  Synthesize_SyntaxAnnotate_PrintVisitor\
-  Synthesize_SyntaxAnnotate\
-  ANTLRv4_RuleNameList\
-  Arithmetic_Echo\
-  Arithmetic_Echo__Test\
-  Arithmetic_SyntaxAnnotate\
-  Arithmetic_SyntaxAnnotate__Test\
-  Arithmetic2_SyntaxAnnotate\
-  Arithmetic2_SyntaxAnnotate__Test\
-  ANTLRv4_SyntaxAnnotate\
-  Arithmetic_Swap\
-  "
-
-# where make will put the programs
-export EXECUTOR_IN_DIR="executor"
-
-# Generate the EXECUTOR_IN_FPL list
-export EXECUTOR_IN_FPL=$(for program in $EXECUTOR_IN_FL; do echo "${EXECUTOR_IN_DIR}/${program}"; done | tr '\n' ' ')
-
-#--------------------------------------------------------------------------------
-# developer build directories
-#
-
-# ANTLR directories
-export ANTLR_IN_PRIMARY_DIR="ANTLR"
-export ANTLR_OUT_DIR="javac/ANTLR"
-export ANTLR_OUT_DIR_PARENT="javac"
-
-# JAVA directories
-export JAVA_COMP_IN_DIR="javac"
-export JAVA_COMP_IN_PRIMARY_DIR="javac/primary"
-export JAVA_COMP_IN_ANTLR_DIR="${ANTLR_OUT_DIR}"
-export JAVA_COMP_IN_SYN_DIR="javac/synthesized"
-export JAVA_COMP_IN_DL="${JAVA_COMP_IN_PRIMARY_DIR}:${JAVA_COMP_IN_ANTLR_DIR}"
-export JAVA_COMP_OUT_DIR="jvm"
-
-# JVM
-export JVM_IN_DIR="${JAVA_COMP_OUT_DIR}"
-
-# The generated build scripts might need arguments that are fully specified paths.
-export DEVELOPER_HOME_DP="/var/user_data/Thomas-developer/GQL_to_Cypher/developer"
-export JVM_IN_DP="$DEVELOPER_HOME_DP/jvm"
-export EXECUTOR_IN_DP="$DEVELOPER_HOME_DP/executor"
-export CLASSPATH="${CLASSPATH}:${JVM_IN_DP}"
-
-#--------------------------------------------------------------------------------
-# tools used
-#
-#  set by project manager: JAVA_HOME, ANTLR_JAR, DEVELOPER_HOME
-#
-export BIN_MAKE=/bin/make
-export JAVA_COMP="${JAVA_HOME}/bin/javac"
-export JAVA_INTERP="${JAVA_HOME}/bin/java"
-export JAVA_ARCHIVE="${JAVA_HOME}/bin/jar"
-export CLASSPATH="${CLASSPATH}:$ANTLR_JAR"
-
-#--------------------------------------------------------------------------------
-# misc
-#
-export TEMP_DIR="$DEVELOPER_HOME"/Erebus
-
-#--------------------------------------------------------------------------------
-# ANTLR files
-#
-export ANTLR_IN_PRIMARY_FPL=$(ls ${ANTLR_IN_PRIMARY_DIR}/*.g4 2>/dev/null | tr '\n' ' ')
-export ANTLR_GRAMMAR_LIST=$(basename -s .g4 ${ANTLR_IN_PRIMARY_FPL})
-if [ -z "${ANTLR_IN_PRIMARY_FPL}" ]; then
-  echo "No ANTLR input grammar files found"
-fi
-
-#--------------------------------------------------------------------------------
-# Java files 
-#
-
-# JAVA input files
-export JAVA_COMP_IN_PRIMARY_FPL=$(ls ${JAVA_COMP_IN_PRIMARY_DIR}/*.java 2>/dev/null | tr '\n' ' ')
-export JAVA_COMP_IN_ANTLR_FPL=${ANTLR_OUT_FPL}
-export JAVA_COMP_IN_FPL="${JAVA_COMP_IN_PRIMARY_FPL} ${JAVA_COMP_IN_ANTLR_FPL}"
-
-# JAVA will produce these output files
-export JAVA_COMP_OUT_PRIMARY_FPL=$(echo ${JAVA_COMP_IN_PRIMARY_FPL} | sed "s|${JAVA_COMP_IN_PRIMARY_DIR}/|${JAVA_COMP_OUT_DIR}/|g" | sed "s|.java|.class|g")
-export JAVA_COMP_OUT_ANTLR_FPL=$(echo ${JAVA_COMP_IN_ANTLR_FPL} | sed "s|${JAVA_COMP_IN_ANTLR_DIR}/|${JAVA_COMP_OUT_DIR}/|g" | sed "s|.java|.class|g")
-export JAVA_COMP_OUT_FPL="${JAVA_COMP_OUT_PRIMARY_FPL} ${JAVA_COMP_OUT_ANTLR_FPL}"
-#--------------------------------------------------------------------------------
-# JAR files
-#
-
-# List of JAR files to be built
-JAR_OUT_FPL=""
-for program_path in ${EXECUTOR_IN_FPL}; do
-  program_name=$(basename ${program_path})
-  class_file="${JAVA_COMP_OUT_DIR}/${program_name}.class"
-  # Check if the .class file is in JAVA_COMP_OUT_FPL
-  for item in ${JAVA_COMP_OUT_FPL}; do
-    # if so add it to the JAR_OUT_FPL
-    if [[ "${item}" == "${class_file}" ]]; then
-      jar_file="${JAVA_COMP_OUT_DIR}/${program_name}.jar"
-      JAR_OUT_FPL="${JAR_OUT_FPL} ${jar_file}"
-      break
-    fi
-  done
-done
-export JAR_OUT_FPL
-
-
-#  LocalWords:  ANTLRv PrintRuleNameListRegx RuleNameListRegx RuleNameList
-#  LocalWords:  PrintVisitorMethod PrintVisitor SyntaxAnnotate
diff --git a/developer/executor/gradle b/developer/executor/gradle
deleted file mode 100755 (executable)
index 60ca7d7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-if [[ -z "${DEVELOPER_HOME}" || -z "${EXECUTOR_IN_DIR}" ]]; then
-  echo "required variables not set. As seen by:"
-  echo "  DEVELOPER_HOME: $DEVELOPER_HOME"
-  echo "  EXECUTOR_IN_DIR: $EXECUTOR_IN_DIR"
-  exit 1
-fi
-
-cd "$DEVELOPER_HOME"
-
-# in case there have been edits to the environment
-source "${EXECUTOR_IN_DIR}"/env_build
-
-"${GRADLE_HOME}"/bin/gradle --project-dir ${REPO_HOME} "$@"
diff --git a/developer/experiment/.githolder b/developer/experiment/.githolder
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/developer/experiment/script2.sh b/developer/experiment/script2.sh
deleted file mode 100644 (file)
index 68b62b2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# Create the env_GP file in the executor directory
-cat << 'EOF' > ../executor/env_GP
-#!/bin/bash
-# Environment setup for GP
-export GP_PROMPT="GP> "
-export PS1="\[$(tput setaf 2)\]\u@\h:\w$GP_PROMPT\[$(tput sgr0)\] "
-EOF
-
-# Make sure the file is executable
-chmod +x ../executor/env_GP
-
-# Source the env_GP file to set up the environment
-source ../executor/env_GP
-
-# Now let's see the current directory contents
-ls -l
diff --git a/developer/javac/ANTLR/.gitignore b/developer/javac/ANTLR/.gitignore
deleted file mode 100644 (file)
index 2db43ed..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-*
-!/.gitignore
-
diff --git a/developer/javac/leaf/ANTLR_OUT_FL.java b/developer/javac/leaf/ANTLR_OUT_FL.java
deleted file mode 100644 (file)
index f852af5..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
-  Run the command with no arguments for a usage message.
-
-  Accepts an antlr grammar file name of the form: [path/]<name>[Lexer/Parser][.g4]
-
-  Prints a space-separated list of files antlr4 would output.
-
-  The <name>Lexer or <name>Parser suffix, or absence thereof, tell this program if
-  antlr would create lexer and parser files, or both.
-
-
-*/
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ANTLR_OUT_FL {
-
-  private static final String USAGE_MESSAGE = 
-    "Usage: ANTLR_OUT_FL <grammar-name> "
-    +" [-visitor (default)] [-no-visitor] "
-    +" [-listener] [-no-listener (default)] "
-    +" [-tokens] [-no-tokens (default)] "
-    +" [-path <path>]"
-    ;
-
-  public static void main(String[] args) {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    boolean visitor = true;
-    boolean noListener = true;
-    boolean noTokens = true;
-    String outputPath = "";
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        case "-visitor":
-          visitor = true;
-          break;
-        case "-no-visitor":
-          visitor = false;
-          break;
-        case "-listener":
-          noListener = false;
-          break;
-        case "-no-listener":
-          noListener = true;
-          break;
-        case "-tokens":
-          noTokens = false;
-          break;
-        case "-no-tokens":
-          noTokens = true;
-          break;
-        case "-path":
-          // Ensure the next argument exists and isn't another option
-          if (i + 1 < args.length && !args[i + 1].startsWith("-")) {
-            outputPath = args[++i];  // Get the next argument as the path
-            if (!outputPath.endsWith("/")) {
-              outputPath += "/";  // Ensure the path ends with a slash
-            }
-          } else {
-            System.err.println("expected argument after option: " + args[i]);
-            error = true;
-          }
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      System.exit(error ? 1 : 0);
-    }
-    if (argList.size() != 1) {
-      System.err.println("Expected exactly one non-option argument.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String grammarName = argList.get(0);
-
-    List<String> generatedFiles = generateFileList(grammarName, visitor, noListener, noTokens, outputPath);
-
-    // Print the files in a space-separated format on a single line
-    if (!generatedFiles.isEmpty()) {
-      System.out.print(generatedFiles.get(0)); // Print the first file
-      for (int i = 1; i < generatedFiles.size(); i++) {
-        System.out.print(" " + generatedFiles.get(i)); // Print space and each subsequent file
-      }
-    }
-    System.out.println(); // Print a newline at the end
-  }
-
-  public static List<String> generateFileList(String grammarName, boolean visitor, boolean noListener, boolean noTokens, String outputPath) {
-    String baseName = new File(grammarName).getName().replace(".g4", "");
-    List<String> fileList = new ArrayList<>();
-
-    // Determine if this is a lexer, parser, or both
-    boolean isLexer = baseName.endsWith("Lexer");
-    boolean isParser = baseName.endsWith("Parser");
-    boolean isCombined = !isLexer && !isParser;
-
-    if (isLexer || isCombined) {
-      // Lexer files
-      fileList.add(outputPath + baseName + "Lexer.java");
-      if (!noTokens) fileList.add(outputPath + baseName + "Lexer.tokens");
-    }
-
-    if (isParser || isCombined) {
-      // Parser files
-      fileList.add(outputPath + baseName + "Parser.java");
-      if (!noTokens) fileList.add(outputPath + baseName + ".tokens");
-
-      // Listener-related files
-      if (!noListener) {
-        fileList.add(outputPath + baseName + "Listener.java");
-        fileList.add(outputPath + baseName + "BaseListener.java");
-      }
-
-      // Visitor-related files
-      if (visitor) {
-        fileList.add(outputPath + baseName + "Visitor.java");
-        fileList.add(outputPath + baseName + "BaseVisitor.java");
-      }
-    }
-
-    return fileList;
-  }
-}
diff --git a/developer/javac/leaf/Arithmetic_Echo.java b/developer/javac/leaf/Arithmetic_Echo.java
deleted file mode 100644 (file)
index 8fadf28..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-Takes an 'Ariethemetic' grammar source file.  Parses it. Runs through the parse tree
-and recreates the source file.
-
-*/
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Arithmetic_Echo {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE =
-    "Usage: Arithmetic_Echo [-version] <source-file-path>";
-
-  public static void main(String[] args) throws IOException {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }        
-    }
-    if (argList.size() != 1) {
-      System.err.println("Expected exactly one non-option argument.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String inputFile = argList.get(0);
-    String input = Files.readString(Paths.get(inputFile));
-
-    try {
-      // Direct instantiation without reflection
-      ArithmeticLexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
-      CommonTokenStream tokens = new CommonTokenStream(lexer);
-      ArithmeticParser parser = new ArithmeticParser(tokens);
-
-      // Directly calling the start rule method
-      ParseTree tree = parser.program(); // Assuming 'program' is the start rule
-
-      Arithmetic_Echo_PrintVisitor visitor = new Arithmetic_Echo_PrintVisitor(parser.getRuleNames());
-      String output = visitor.visit(tree);
-      System.out.println(output);
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/developer/javac/leaf/Arithmetic_Echo_PrintVisitor.java b/developer/javac/leaf/Arithmetic_Echo_PrintVisitor.java
deleted file mode 100644 (file)
index 488d54a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
-
-public class Arithmetic_Echo_PrintVisitor extends ArithmeticBaseVisitor<String> {
-  private final String[] ruleNames;
-
-  public Arithmetic_Echo_PrintVisitor(String[] ruleNames) {
-    this.ruleNames = ruleNames;
-  }
-
-  @Override
-  public String visitProgram(ArithmeticParser.ProgramContext ctx) {
-    return visit(ctx.expression());
-  }
-
-  @Override
-  public String visitExpression(ArithmeticParser.ExpressionContext ctx) {
-    if (ctx.INT() != null) {
-      return ctx.INT().getText();
-    } else if (ctx.getChildCount() == 3 && ctx.getChild(0).getText().equals("(")) {
-      // Handle parentheses
-      return visit(ctx.expression(0));  // Remove the extra parentheses
-    } else {
-      String left = visit(ctx.expression(0));
-      String right = visit(ctx.expression(1));
-      String operator = ctx.getChild(1).getText();
-      return "(" + left + " " + operator + " " + right + ")";
-    }
-  }
-
-}
-
diff --git a/developer/javac/leaf/Arithmetic_Echo__Test.java b/developer/javac/leaf/Arithmetic_Echo__Test.java
deleted file mode 100644 (file)
index 8e670b1..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Arithmetic_Echo__Test {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE =
-    "Usage: Arithmetic_Echo__Test [-version]";
-
-  public static void main(String[] args) {
-    // if (args.length == 0) {
-    //   System.err.println(USAGE_MESSAGE);
-    //   System.exit(1);
-    // }
-    boolean error = false;
-    boolean version = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }        
-    }
-    if (argList.size() != 0) {
-      System.err.println("This program takes no arguments.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    Map<String, Boolean> tests = new HashMap<>();
-    tests.put("Arithmetic_Echo_0", Arithmetic_Echo_0());
-    tests.put("Arithmetic_Echo_1", Arithmetic_Echo_1());
-    tests.put("Arithmetic_Echo_2", Arithmetic_Echo_2());
-    tests.put("Arithmetic_Echo_3", Arithmetic_Echo_3());
-    tests.put("Arithmetic_Echo_4", Arithmetic_Echo_4());
-
-    TestBench.runTests(tests);
-  }
-
-  public static boolean Arithmetic_Echo_0() {
-    // Simple smoke test
-    try {
-      String input = "3 + 5";
-      String expectedOutput = "(3 + 5)";
-      String actualOutput = runSyntax(input);
-      return expectedOutput.equals(actualOutput);
-    } catch (Exception e) {
-      return false;
-    }
-  }
-
-  public static boolean Arithmetic_Echo_1() {
-    // Test with multiplication
-    try {
-      String input = "2 * 3";
-      String expectedOutput = "(2 * 3)";
-      String actualOutput = runSyntax(input);
-      return expectedOutput.equals(actualOutput);
-    } catch (Exception e) {
-      return false;
-    }
-  }
-
-  public static boolean Arithmetic_Echo_2() {
-    // Test with parentheses
-    try {
-      String input = "2 * (3 + 4)";
-      String expectedOutput = "(2 * (3 + 4))";
-      String actualOutput = runSyntax(input);
-      return expectedOutput.equals(actualOutput);
-    } catch (Exception e) {
-      return false;
-    }
-  }
-
-  public static boolean Arithmetic_Echo_3() {
-    // Test with division
-    try {
-      String input = "10 / 2";
-      String expectedOutput = "(10 / 2)";
-      String actualOutput = runSyntax(input);
-      return expectedOutput.equals(actualOutput);
-    } catch (Exception e) {
-      return false;
-    }
-  }
-
-  public static boolean Arithmetic_Echo_4() {
-    // Test with complex expression
-    try {
-      String input = "3 + 5 * (10 - 4)";
-      String expectedOutput = "(3 + (5 * (10 - 4)))";
-      String actualOutput = runSyntax(input);
-      return expectedOutput.equals(actualOutput);
-    } catch (Exception e) {
-      return false;
-    }
-  }
-
-  private static String runSyntax(String input) throws Exception {
-    Lexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
-    CommonTokenStream tokens = new CommonTokenStream(lexer);
-    ArithmeticParser parser = new ArithmeticParser(tokens);
-    Method startRule = parser.getClass().getMethod("program");
-    ParseTree tree = (ParseTree) startRule.invoke(parser);
-
-    Arithmetic_Echo_PrintVisitor visitor = new Arithmetic_Echo_PrintVisitor(parser.getRuleNames());
-    return visitor.visit(tree);
-  }
-}
diff --git a/developer/javac/leaf/Arithmetic_Swap.java b/developer/javac/leaf/Arithmetic_Swap.java
deleted file mode 100644 (file)
index 58e1caf..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Arithmetic_Swap {
-  private static final String USAGE_MESSAGE =
-    "Usage: Arithmetic_Swap [-version] <source-file-path>";
-
-  public static void main(String[] args) throws IOException {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    List<String> argList = new ArrayList<>();
-    for (String arg : args) {
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if (version) {
-      System.out.println("version 0.1");
-      System.exit(error ? 1 : 0);
-    }
-    if (argList.size() != 1) {
-      System.err.println("Expected exactly one non-option argument.");
-      error = true;
-    }
-    if (error) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String inputFile = argList.get(0);
-    String input = Files.readString(Paths.get(inputFile));
-
-    try {
-      ArithmeticLexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
-      CommonTokenStream tokens = new CommonTokenStream(lexer);
-      ArithmeticParser parser = new ArithmeticParser(tokens);
-      
-      ParseTree tree = parser.program();
-
-      Arithmetic_SwapVisitor swapVisitor = new Arithmetic_SwapVisitor();
-      ParseTree transformedTree = swapVisitor.visit(tree);
-
-      Arithmetic_Echo_PrintVisitor printVisitor = new Arithmetic_Echo_PrintVisitor(parser.getRuleNames());
-      String output = printVisitor.visit(transformedTree);
-
-      System.out.println(output);
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/developer/javac/leaf/Arithmetic_SwapVisitor.java b/developer/javac/leaf/Arithmetic_SwapVisitor.java
deleted file mode 100644 (file)
index f108735..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-import org.antlr.v4.runtime.tree.*;
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.misc.*;
-
-public class Arithmetic_SwapVisitor extends AbstractParseTreeVisitor<ParseTree> {
-
-    @Override
-    public ParseTree visit(ParseTree tree) {
-        if (tree instanceof ParserRuleContext) {
-            ParserRuleContext ctx = (ParserRuleContext) tree;
-            ParserRuleContext newCtx = new ParserRuleContext();
-
-            // Recursively visit all children and add them to the new context
-            for (int i = 0; i < ctx.getChildCount(); i++) {
-                ParseTree child = ctx.getChild(i);
-                ParseTree visitedChild = this.visit(child);
-                
-                // Add child if it's a valid type
-                if (visitedChild instanceof ParserRuleContext) {
-                    newCtx.addChild((ParserRuleContext) visitedChild);
-                } else if (visitedChild instanceof TerminalNode) {
-                    newCtx.addChild((TerminalNode) visitedChild);
-                }
-            }
-            return newCtx;
-        } else if (tree instanceof TerminalNode) {
-            TerminalNode node = (TerminalNode) tree;
-            // Swap operators based on text
-            switch (node.getText()) {
-                case "+":
-                    return createTerminalNode(node, ArithmeticParser.MINUS); // Swap + with -
-                case "-":
-                    return createTerminalNode(node, ArithmeticParser.PLUS);  // Swap - with +
-                case "*":
-                    return createTerminalNode(node, ArithmeticParser.DIVIDE); // Swap * with /
-                case "/":
-                    return createTerminalNode(node, ArithmeticParser.MULTIPLY); // Swap / with *
-                default:
-                    return node; // Return node as is for non-operator tokens
-            }
-        }
-        return null;
-    }
-
-    // Helper method to create a new TerminalNode with the swapped token
-    private TerminalNode createTerminalNode(TerminalNode oldNode, int newTokenType) {
-        Token newToken = new CommonToken(newTokenType, oldNode.getText());
-        return new TerminalNodeImpl(newToken);
-    }
-}
diff --git a/developer/javac/leaf/Arithmetic_SyntaxAnnotate.java b/developer/javac/leaf/Arithmetic_SyntaxAnnotate.java
deleted file mode 100644 (file)
index 0516db6..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-Takes an 'Ariethemetic' grammar source file.  Parses it. Outputs an annotated
-version of the source file while labeling what parts of the grammar the syntax
-objects belong to.  Note the -pp option.
-
-*/
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Arithmetic_SyntaxAnnotate {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE = 
-    "Usage: Arithmetic_SyntaxAnnotate [-version] [-pp] <source-file>";
-
-  public static void main(String[] args) throws IOException {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    boolean pretty_print = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        case "-pp":
-          pretty_print = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }
-    }
-    if (argList.size() != 1) {
-      System.err.println("Expected exactly one non-option argument.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String input_file = argList.get(0);
-    String input = Files.readString(Paths.get(input_file));
-
-    try {
-      ArithmeticLexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
-      CommonTokenStream tokens = new CommonTokenStream(lexer);
-      ArithmeticParser parser = new ArithmeticParser(tokens);
-      ParseTree tree = parser.program();
-
-      Arithmetic_SyntaxAnnotate_PrintVisitor visitor = 
-        new Arithmetic_SyntaxAnnotate_PrintVisitor(parser.getRuleNames(), pretty_print);
-      String output = visitor.visit(tree);
-      System.out.println(output);
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/developer/javac/leaf/Arithmetic_SyntaxAnnotate_PrintVisitor.java b/developer/javac/leaf/Arithmetic_SyntaxAnnotate_PrintVisitor.java
deleted file mode 100644 (file)
index 9831e54..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
-
-public class Arithmetic_SyntaxAnnotate_PrintVisitor extends ArithmeticBaseVisitor<String>{
-  private final String[] rule_names;
-  private final boolean pretty_print;
-
-  public Arithmetic_SyntaxAnnotate_PrintVisitor(String[] rule_names, boolean pretty_print){
-    this.rule_names = rule_names;
-    this.pretty_print = pretty_print;
-  }
-
-  private String indent(int level){
-    return "  ".repeat(level);
-  }
-
-  @Override
-  public String visitProgram(ArithmeticParser.ProgramContext ctx){
-    if(pretty_print){
-      StringBuilder result = new StringBuilder();
-      result.append("program\n").append(visitExpression(ctx.expression(), 1));
-      return result.toString();
-    }else{
-      return "program(" + visit(ctx.expression()) + ")";
-    }
-  }
-
-  @Override
-  public String visitExpression(ArithmeticParser.ExpressionContext ctx){
-    return visitExpression(ctx, 0);
-  }
-
-  private String visitExpression(ArithmeticParser.ExpressionContext ctx, int indent_level){
-    StringBuilder result = new StringBuilder();
-    if(pretty_print){
-      result.append(indent(indent_level)).append("expression(\n");
-      if( ctx.INT() != null ){
-        result.append(indent(indent_level + 1)).append("INT(").append(ctx.INT().getText()).append(")\n");
-      }else if( ctx.getChildCount() == 3 && ctx.getChild(0).getText().equals("(") ){
-        result.append(indent(indent_level + 1)).append("(\n");
-        result.append(visitExpression(ctx.expression(0), indent_level + 2));
-        result.append(indent(indent_level + 1)).append(")\n");
-      }else{
-        result.append(visitExpression(ctx.expression(0), indent_level + 1));
-        result.append(indent(indent_level + 1)).append("operator(").append(ctx.getChild(1).getText()).append(")\n");
-        result.append(visitExpression(ctx.expression(1), indent_level + 1));
-      }
-      result.append(indent(indent_level)).append(")\n");
-    }else{
-      if( ctx.INT() != null ){
-        result.append("INT(").append(ctx.INT().getText()).append(")");
-      }else if( ctx.getChildCount() == 3 && ctx.getChild(0).getText().equals("(") ){
-        result.append("(").append(visit(ctx.expression(0))).append(")");
-      }else{
-        String left = visit(ctx.expression(0));
-        String right = visit(ctx.expression(1));
-        String operator = "operator(" + ctx.getChild(1).getText() + ")";
-        result.append("expression(").append(left).append(" ").append(operator).append(" ").append(right).append(")");
-      }
-    }
-    return result.toString();
-  }
-}
diff --git a/developer/javac/leaf/Arithmetic_SyntaxAnnotate__Test.java b/developer/javac/leaf/Arithmetic_SyntaxAnnotate__Test.java
deleted file mode 100644 (file)
index a80b690..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Arithmetic_SyntaxAnnotate__Test {
-
-  public static boolean Arithmetic_SyntaxAnnotate_0() {
-    return runTest(
-      "Arithmetic_SyntaxAnnotate__Test_0.txt"
-     ,"program(expression(INT(3) operator(+) INT(5)))"
-     );
-  }
-
-  public static boolean Arithmetic_SyntaxAnnotate_1() {
-    return runTest(
-      "Arithmetic_SyntaxAnnotate__Test_1.txt"
-      ,"program(expression(INT(3) operator(+) INT(5)))"
-   );
-  }
-
-  public static boolean Arithmetic_SyntaxAnnotate_2() {
-    return runTest(
-      "Arithmetic_SyntaxAnnotate__Test_2.txt" 
-      ,"program(expression(INT(2) operator(*) (expression(INT(3) operator(+) INT(4)))))"
-      );
-  }
-
-  public static boolean Arithmetic_SyntaxAnnotate_3() {
-    return runTest(
-      "Arithmetic_SyntaxAnnotate__Test_3.txt" 
-      ,"program(expression(INT(10) operator(/) INT(2)))"
-      );
-  }
-
-  public static boolean Arithmetic_SyntaxAnnotate_4() {
-    return runTest(
-      "Arithmetic_SyntaxAnnotate__Test_4.txt" 
-      ,"program(expression(INT(3) operator(+) expression(INT(5) operator(*) (expression(INT(10) operator(-) INT(4))))))"
-      );
-  }
-
-  private static boolean runTest(String filename ,String expectedOutput) {
-    try {
-      String input = Files.readString(Paths.get(filename));
-      String actualOutput = runSyntaxAnnotate(input);
-      return expectedOutput.equals(actualOutput);
-    } catch (Exception e) {
-      e.printStackTrace();
-      return false;
-    }
-  }
-
-  private static String runSyntaxAnnotate(String input) throws Exception {
-    Lexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
-    CommonTokenStream tokens = new CommonTokenStream(lexer);
-    ArithmeticParser parser = new ArithmeticParser(tokens);
-    ParseTree tree = parser.program(); // Directly calling the start rule method
-
-    Arithmetic_SyntaxAnnotate_PrintVisitor visitor = new Arithmetic_SyntaxAnnotate_PrintVisitor(parser.getRuleNames() ,false);
-    return visitor.visit(tree);
-  }
-
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE = 
-    "Usage: Arithmetic_SyntaxAnnotate__Test [-version]";
-
-  public static void main(String[] args) {
-    // if (args.length == 0) {
-    //   System.err.println(USAGE_MESSAGE);
-    //   System.exit(1);
-    // }
-    boolean error = false;
-    boolean version = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }        
-    }
-    if (argList.size() != 0) {
-      System.err.println("This program takes no arguments.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    // Use LinkedHashMap to maintain order of test results
-    Map<String, Boolean> tests = new LinkedHashMap<>();
-    tests.put("Arithmetic_SyntaxAnnotate_0", Arithmetic_SyntaxAnnotate_0());
-    tests.put("Arithmetic_SyntaxAnnotate_1", Arithmetic_SyntaxAnnotate_1());
-    tests.put("Arithmetic_SyntaxAnnotate_2", Arithmetic_SyntaxAnnotate_2());
-    tests.put("Arithmetic_SyntaxAnnotate_3", Arithmetic_SyntaxAnnotate_3());
-    tests.put("Arithmetic_SyntaxAnnotate_4", Arithmetic_SyntaxAnnotate_4());
-
-    TestBench.runTests(tests);
-  }
-
-}
-
diff --git a/developer/javac/leaf/RuleNameList.java b/developer/javac/leaf/RuleNameList.java
deleted file mode 100644 (file)
index c9b727c..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-  Accepts an grammar name (not a file path or file name) and outputs the rule
-  names found in the grammar.  
-
-  RuleNameList does not run antlr to build the grammar files, that must have
-  been done separately before this program is run.
-
-  RuleNameList produces a more reliable list than does RuleNameListRegx.
-
-  RuleNameList does not output terminal symbols (the lexer tokens).
-
-  Usage: ANTLRv4_RuleNames <input-file>
-*/
-
-import org.antlr.v4.runtime.*;
-import java.util.ArrayList;
-import java.util.List;
-
-public class RuleNameList {
-
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE =
-    "Usage: RuleNameList"
-    +" [-version]"
-    +" [-rule (default)] [-no-rule]"
-    +" [-token] [-no-token (default)]"
-    +" <grammar-name>"
-    ;
-
-  public static void main(String[] args) {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    boolean printRules = true;
-    boolean printTokens = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        case "-rule":
-          printRules = true;
-          break;
-        case "-no-rule":
-          printRules = false;
-          break;
-        case "-token":
-          printTokens = true;
-          break;
-        case "-no-token":
-          printTokens = false;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }        
-    }
-    if (argList.size() != 1) {
-      System.err.println("Expected exactly one non-option argument.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String grammarName = argList.get(0);
-    // in case the user provided a path instead of a name:
-    grammarName = Paths.get(grammarName).getFileName().toString().replace(".g4", "");
-
-    try {
-      // Dynamically load the appropriate lexer and parser
-      Class<?> lexerClass = Class.forName(grammarName + "Lexer");
-      Class<?> parserClass = Class.forName(grammarName + "Parser");
-
-      // Create instances of the lexer and parser
-      Lexer lexer = (Lexer) lexerClass.getConstructor(CharStream.class).newInstance(CharStreams.fromString(""));
-      CommonTokenStream tokens = new CommonTokenStream(lexer);
-      Parser parser = (Parser) parserClass.getConstructor(TokenStream.class).newInstance(tokens);
-
-      // Get the rule names from the parser
-      List<String> ruleNames = List.of(parser.getRuleNames());
-
-      // Get the token names from the lexer
-      List<String> tokenNames = List.of(lexer.getTokenNames());
-
-      // Print the rule names if requested
-      if (printRules) {
-        if (printTokens) {
-          System.out.println("#----------------------------------------");
-          System.out.println("# Rule names found in the grammar:");
-        }
-        for (String ruleName : ruleNames) {
-          System.out.println(ruleName);
-        }
-      }
-
-      // Print the token names if requested
-      if (printTokens) {
-        if (printRules) {
-          System.out.println("#----------------------------------------");
-          System.out.println("# Token names found in the grammar:");
-        }
-        for (String tokenName : tokenNames) {
-          System.out.println(tokenName);
-        }
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/developer/javac/leaf/RuleNameListRegx.java b/developer/javac/leaf/RuleNameListRegx.java
deleted file mode 100644 (file)
index 36ffb2b..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-Directly reads an ANTLR grammar file, a `.g4` file, and lists all the rules found in it.
-
-*/
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.ArrayList;
-import java.util.List;
-
-public class RuleNameListRegx {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE =
-    "Usage: RuleNameListRegx [-version] <path-to-g4-file>";
-
-  public static void main(String[] args) {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    boolean pretty_print = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        case "-pp":
-          pretty_print = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }
-    }
-    if (argList.size() != 1) {
-      System.err.println("Expected exactly one non-option argument.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String filePath = argList.get(0);
-
-    try {
-      Set<String> ruleNames = new HashSet<>();
-      BufferedReader br = new BufferedReader(new FileReader(filePath));
-      StringBuilder content = new StringBuilder();
-      String line;
-      while ((line = br.readLine()) != null) {
-        content.append(line).append("\n");
-      }
-
-      // Updated pattern to handle multi-line rules
-      Pattern rulePattern = Pattern.compile("(?m)^\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*:");
-
-      Matcher matcher = rulePattern.matcher(content.toString());
-      while (matcher.find()) {
-        ruleNames.add(matcher.group(1));
-      }
-
-      System.out.println("Extracted Rules:");
-      for (String rule : ruleNames) {
-        System.out.println(rule);
-      }
-    } catch (IOException e) {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/developer/javac/leaf/StringUtils.java b/developer/javac/leaf/StringUtils.java
deleted file mode 100644 (file)
index 774e253..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-public class StringUtils {
-
-    private static int spacesPerIndentLevel = 2; // Default to 2 spaces per indent level
-
-    public static void setSpacesPerIndentLevel(int spaces) {
-        spacesPerIndentLevel = spaces;
-    }
-
-    public static String indentString(String template, int indentLevel) {
-        String indent = " ".repeat(spacesPerIndentLevel * indentLevel);
-        String[] lines = template.split("\n");
-        StringBuilder indentedTemplate = new StringBuilder();
-        for (String line : lines) {
-            indentedTemplate.append(indent).append(line).append("\n");
-        }
-        return indentedTemplate.toString();
-    }
-}
diff --git a/developer/javac/leaf/Synthesize_SyntaxAnnotate.java b/developer/javac/leaf/Synthesize_SyntaxAnnotate.java
deleted file mode 100644 (file)
index 6f002f1..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Synthesize_SyntaxAnnotate {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE = 
-    "Usage: Synthesize_SyntaxAnnotate [-version] <grammar-name> <output-file-path>";
-
-  public static void main(String[] args) throws IOException {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }        
-    }
-    if (argList.size() != 2) {
-      System.err.println("Expected exactly two non-option arguments.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String grammarName = argList.get(0);
-    // in case the user provided a path instead of a name:
-    grammarName = Paths.get(grammarName).getFileName().toString().replace(".g4", "");
-
-    String outputFile = argList.get(1);
-
-    synthesizeSyntaxAnnotateClass(grammarName, outputFile);
-  }
-
-  private static void synthesizeSyntaxAnnotateClass(String grammarName, String outputFile) throws IOException {
-    String className = grammarName + "_SyntaxAnnotate";
-    String lexerName = grammarName + "Lexer";
-    String parserName = grammarName + "Parser";
-    String visitorName = grammarName + "_SyntaxAnnotate_PrintVisitor";
-
-    // Template for the SyntaxAnnotate class
-    String classTemplate = """
-      /* This file generated by Synthesize_SyntaxAnnotate given the grammar 
-         name: ____4_.
-         
-         SyntaxAnnotate programs accept a source file, then echo the source file with
-         syntax annotation. Synthesize_SyntaxAnnotate produces a SyntaxAnnotate program
-         for a specific grammar.
-       */
-      import org.antlr.v4.runtime.*;
-      import org.antlr.v4.runtime.tree.*;
-      import java.io.IOException;
-      import java.nio.file.Files;
-      import java.nio.file.Paths;
-      import java.util.ArrayList;
-      import java.util.List;
-
-      public class ____0_ {
-        // Constant for the usage message
-        private static final String USAGE_MESSAGE =
-          "Usage: ____0_ [-version] [-pp] <source-file-path>";
-
-        public static void main(String[] args) throws IOException {
-          if (args.length == 0) {
-            System.err.println(USAGE_MESSAGE);
-            System.exit(1);
-          }
-          boolean error = false;
-          boolean version = false;
-          boolean pretty_print = false;
-          List<String> argList = new ArrayList<>();
-          for (int i = 0; i < args.length; i++) {
-            String arg = args[i];
-            if (arg.startsWith("-")) {
-              switch (arg) {
-              case "-version":
-                version = true;
-                break;
-              case "-pp":
-                pretty_print = true;
-                break;
-              default:
-                System.err.println("Unrecognized option: " + arg);
-                error = true;
-              }
-            } else {
-              argList.add(arg);
-            }
-          }
-          if(version){
-            System.out.println("version 0.1");
-            if(error){
-              System.exit(1);
-            }else{
-              System.exit(0);
-            }        
-          }
-          if (argList.size() != 1) {
-            System.err.println("Expected exactly one non-option argument.");
-            error = true;
-          }
-          if(error){
-            System.err.println(USAGE_MESSAGE);
-            System.exit(1);
-          }
-
-          String input_file = argList.get(0);
-          String input = Files.readString(Paths.get(input_file));
-
-          try {
-            ____1_ lexer = new ____1_(CharStreams.fromString(input));
-            CommonTokenStream tokens = new CommonTokenStream(lexer);
-            ____2_ parser = new ____2_(tokens);
-            ParseTree tree = parser.program();
-
-            ____3_ visitor = new ____3_(parser.getRuleNames(), pretty_print);
-            String output = visitor.visit(tree);
-            System.out.println(output);
-          } catch (Exception e) {
-            e.printStackTrace();
-          }
-        }
-      }
-      """;
-
-    // Fill in the blanks in the template
-    classTemplate = classTemplate.replace("____0_", className);
-    classTemplate = classTemplate.replace("____1_", lexerName);
-    classTemplate = classTemplate.replace("____2_", parserName);
-    classTemplate = classTemplate.replace("____3_", visitorName);
-    classTemplate = classTemplate.replace("____4_", grammarName);
-
-    // Write the synthesized class to the output file
-    Files.writeString(Paths.get(outputFile), classTemplate);
-  }
-}
-
-//  LocalWords:  SyntaxAnnotate
diff --git a/developer/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitor.java b/developer/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitor.java
deleted file mode 100644 (file)
index ae508b0..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.List;
-import java.io.PrintWriter;
-
-public class Synthesize_SyntaxAnnotate_PrintVisitor {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE = 
-    "Usage: Synthesize_SyntaxAnnotate_PrintVisitor"
-    +" [-version]"
-    +" <g4-grammar-file-path> <outputFile> [indent-level (default 0)]"
-    ;
-
-  public static void main(String[] args) throws IOException {
-  if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    int indentLevel = 0;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if (version) {
-      System.out.println("Version 0.1");
-      if (error) {
-        System.exit(1);
-      } else {
-        System.exit(0);
-      }
-    }
-    if (argList.size() < 2 || argList.size() > 3) {
-      System.err.println("Expected two or three non-option arguments.");
-      error = true;
-    }
-    if (error) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String grammarFilePath = argList.get(0);
-    String outputFile      = argList.get(1);
-    if (argList.size() == 3) {
-      indentLevel = Integer.parseInt(argList.get(2));
-    }
-
-    String grammarName = Paths.get(grammarFilePath).getFileName().toString().replace(".g4", "");
-    String parserName = grammarName + "Parser";
-    String visitorClassName = grammarName + "_SyntaxAnnotate_PrintVisitor";
-
-    // Parse the .g4 file
-    CharStream input = CharStreams.fromFileName(grammarFilePath);
-    ANTLRv4Lexer lexer = new ANTLRv4Lexer(input);
-    CommonTokenStream tokens = new CommonTokenStream(lexer);
-    ANTLRv4Parser parser = new ANTLRv4Parser(tokens);
-
-    // Extract rules
-    ParseTree tree = parser.grammarSpec();
-    List<String> ruleNames = extractRuleNames(parser);
-
-    // Synthesize the print methods
-    StringBuilder printMethods = new StringBuilder();
-    for (String ruleName : ruleNames) {
-      printMethods.append(Synthesize_SyntaxAnnotate_PrintVisitorMethod.synthesizePrintMethod(parserName, ruleName, indentLevel + 1));
-    }
-
-    // Template for the PrintVisitor class
-    String classTemplate = """
-      /* This file synthesized by Synthesize_SyntaxAnnotate_PrintVisitor.
-      */
-      import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
-
-      public class ____0_ extends AbstractParseTreeVisitor<String> {
-        private final String[] ruleNames;
-
-        public ____0_(String[] ruleNames) {
-          this.ruleNames = ruleNames;
-        }
-
-        ____1_
-      }
-      """;
-
-    classTemplate = classTemplate.replace("____0_", visitorClassName);
-    classTemplate = classTemplate.replace("____1_", printMethods.toString());
-
-    try (PrintWriter writer = new PrintWriter(outputFile)) {
-      writer.print(classTemplate);
-    }
-  }
-
-  private static List<String> extractRuleNames(Parser parser) {
-    // Extract rule names from the parser
-    return Arrays.asList(parser.getRuleNames());
-  }
-}
-
-//  LocalWords:  SyntaxAnnotate PrintVisitor
diff --git a/developer/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java b/developer/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java
deleted file mode 100644 (file)
index 35394bb..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-import java.util.ArrayList;
-import java.util.List;
-import java.io.PrintWriter;
-
-public class Synthesize_SyntaxAnnotate_PrintVisitorMethod {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE = 
-    "Usage: Synthesize_SyntaxAnnotate_PrintVisitorMethod"
-    + " [-version]"
-    +" <grammar-name> <g4-rule-name> <output-file>"
-    ;
-
-  public static void main(String[] args) {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }        
-    }
-    if (argList.size() != 3) {
-      System.err.println("Expected exactly three non-option arguments.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String grammarName = argList.get(0);
-    String ruleName    = argList.get(1);
-    String outputFile  = argList.get(2);
-
-    String parserName = grammarName + "Parser";
-    
-    try {
-      PrintWriter writer = new PrintWriter(outputFile);
-      // start at indent level 0
-      writer.print(synthesizePrintMethod(parserName, ruleName, 0)); 
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-
-  public static String synthesizePrintMethod(String parserName, String ruleName, int indentLevel) {
-    // Template for the print method using text blocks
-    String template = """
-      public String visit____0_ (____1_.____0_Context ctx) {
-        StringBuilder result = new StringBuilder();
-        result.append("____0_(");
-        for (int i = 0; i < ctx.getChildCount(); i++) {
-          if (i > 0) result.append(", ");
-          result.append(visit(ctx.getChild(i)));
-        }
-        result.append(")");
-        return result.toString();
-      }
-      """;
-
-    // Fill in the blanks in the template
-    template = template.replace("____0_", ruleName);
-    template = template.replace("____1_", parserName);
-
-    // Indent the template
-    return StringUtils.indentString(template, indentLevel);
-  }
-}
diff --git a/developer/javac/leaf/TestBench.java b/developer/javac/leaf/TestBench.java
deleted file mode 100644 (file)
index 8bdcc67..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-import java.util.Map;
-
-public class TestBench {
-
-    public static void runTests(Map<String, Boolean> tests) {
-        int totalTests = tests.size();
-        int passedTests = 0;
-        int failedTests = 0;
-
-        for (Map.Entry<String, Boolean> test : tests.entrySet()) {
-            try {
-                if (test.getValue()) {
-                    passedTests++;
-                } else {
-                    System.out.println("failed: " + test.getKey());
-                    failedTests++;
-                }
-            } catch (Exception e) {
-                System.out.println("failed: " + test.getKey());
-                failedTests++;
-            }
-        }
-
-        System.out.println("Total tests run: " + totalTests);
-        System.out.println("Total tests passed: " + passedTests);
-        System.out.println("Total tests failed: " + failedTests);
-    }
-}
diff --git a/developer/javac/synthesized/Arithmetic2_SyntaxAnnotate.java b/developer/javac/synthesized/Arithmetic2_SyntaxAnnotate.java
deleted file mode 100644 (file)
index c4577ca..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* This file generated by Synthesize_SyntaxAnnotate given the grammar
-   name: Arithmetic2.
-
-   SyntaxAnnotate programs accept a source file, then echo the source file with
-   syntax annotation. Synthesize_SyntaxAnnotate produces a SyntaxAnnotate program
-   for a specific grammar.
- */
-import org.antlr.v4.runtime.*;
-import org.antlr.v4.runtime.tree.*;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Arithmetic2_SyntaxAnnotate {
-  // Constant for the usage message
-  private static final String USAGE_MESSAGE =
-    "Usage: Arithmetic2_SyntaxAnnotate [-version] [-pp] <source-file-path>";
-
-  public static void main(String[] args) throws IOException {
-    if (args.length == 0) {
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-    boolean error = false;
-    boolean version = false;
-    boolean pretty_print = false;
-    List<String> argList = new ArrayList<>();
-    for (int i = 0; i < args.length; i++) {
-      String arg = args[i];
-      if (arg.startsWith("-")) {
-        switch (arg) {
-        case "-version":
-          version = true;
-          break;
-        case "-pp":
-          pretty_print = true;
-          break;
-        default:
-          System.err.println("Unrecognized option: " + arg);
-          error = true;
-        }
-      } else {
-        argList.add(arg);
-      }
-    }
-    if(version){
-      System.out.println("version 0.1");
-      if(error){
-        System.exit(1);
-      }else{
-        System.exit(0);
-      }
-    }
-    if (argList.size() != 1) {
-      System.err.println("Expected exactly one non-option argument.");
-      error = true;
-    }
-    if(error){
-      System.err.println(USAGE_MESSAGE);
-      System.exit(1);
-    }
-
-    String input_file = argList.get(0);
-    String input = Files.readString(Paths.get(input_file));
-
-    try {
-      Arithmetic2Lexer lexer = new Arithmetic2Lexer(CharStreams.fromString(input));
-      CommonTokenStream tokens = new CommonTokenStream(lexer);
-      Arithmetic2Parser parser = new Arithmetic2Parser(tokens);
-      ParseTree tree = parser.program();
-
-      Arithmetic2_SyntaxAnnotate_PrintVisitor visitor = new Arithmetic2_SyntaxAnnotate_PrintVisitor(parser.getRuleNames(), pretty_print);
-      String output = visitor.visit(tree);
-      System.out.println(output);
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/developer/javac/synthesized/Arithmetic2_SyntaxAnnotate_PrintVisitor.java b/developer/javac/synthesized/Arithmetic2_SyntaxAnnotate_PrintVisitor.java
deleted file mode 100644 (file)
index 28a4866..0000000
+++ /dev/null
@@ -1,663 +0,0 @@
-/* This file synthesized by Synthesize_SyntaxAnnotate_PrintVisitor.
-*/
-import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
-
-public class Arithmetic2_SyntaxAnnotate_PrintVisitor extends AbstractParseTreeVisitor<String> {
-  private final String[] ruleNames;
-
-  public Arithmetic2_SyntaxAnnotate_PrintVisitor(String[] ruleNames) {
-    this.ruleNames = ruleNames;
-  }
-
-    public String visitgrammarSpec (Arithmetic2Parser.grammarSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("grammarSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitgrammarDecl (Arithmetic2Parser.grammarDeclContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("grammarDecl(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitgrammarType (Arithmetic2Parser.grammarTypeContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("grammarType(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitprequelConstruct (Arithmetic2Parser.prequelConstructContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("prequelConstruct(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitoptionsSpec (Arithmetic2Parser.optionsSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("optionsSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitoption (Arithmetic2Parser.optionContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("option(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitoptionValue (Arithmetic2Parser.optionValueContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("optionValue(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitdelegateGrammars (Arithmetic2Parser.delegateGrammarsContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("delegateGrammars(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitdelegateGrammar (Arithmetic2Parser.delegateGrammarContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("delegateGrammar(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visittokensSpec (Arithmetic2Parser.tokensSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("tokensSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitchannelsSpec (Arithmetic2Parser.channelsSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("channelsSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitidList (Arithmetic2Parser.idListContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("idList(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitaction_ (Arithmetic2Parser.action_Context ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("action_(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitactionScopeName (Arithmetic2Parser.actionScopeNameContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("actionScopeName(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitactionBlock (Arithmetic2Parser.actionBlockContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("actionBlock(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitargActionBlock (Arithmetic2Parser.argActionBlockContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("argActionBlock(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitmodeSpec (Arithmetic2Parser.modeSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("modeSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitrules (Arithmetic2Parser.rulesContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("rules(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleSpec (Arithmetic2Parser.ruleSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitparserRuleSpec (Arithmetic2Parser.parserRuleSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("parserRuleSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitexceptionGroup (Arithmetic2Parser.exceptionGroupContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("exceptionGroup(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitexceptionHandler (Arithmetic2Parser.exceptionHandlerContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("exceptionHandler(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitfinallyClause (Arithmetic2Parser.finallyClauseContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("finallyClause(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitrulePrequel (Arithmetic2Parser.rulePrequelContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("rulePrequel(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleReturns (Arithmetic2Parser.ruleReturnsContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleReturns(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitthrowsSpec (Arithmetic2Parser.throwsSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("throwsSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlocalsSpec (Arithmetic2Parser.localsSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("localsSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleAction (Arithmetic2Parser.ruleActionContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleAction(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleModifiers (Arithmetic2Parser.ruleModifiersContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleModifiers(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleModifier (Arithmetic2Parser.ruleModifierContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleModifier(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleBlock (Arithmetic2Parser.ruleBlockContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleBlock(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleAltList (Arithmetic2Parser.ruleAltListContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleAltList(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlabeledAlt (Arithmetic2Parser.labeledAltContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("labeledAlt(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerRuleSpec (Arithmetic2Parser.lexerRuleSpecContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerRuleSpec(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerRuleBlock (Arithmetic2Parser.lexerRuleBlockContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerRuleBlock(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerAltList (Arithmetic2Parser.lexerAltListContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerAltList(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerAlt (Arithmetic2Parser.lexerAltContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerAlt(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerElements (Arithmetic2Parser.lexerElementsContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerElements(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerElement (Arithmetic2Parser.lexerElementContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerElement(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerBlock (Arithmetic2Parser.lexerBlockContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerBlock(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerCommands (Arithmetic2Parser.lexerCommandsContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerCommands(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerCommand (Arithmetic2Parser.lexerCommandContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerCommand(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerCommandName (Arithmetic2Parser.lexerCommandNameContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerCommandName(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerCommandExpr (Arithmetic2Parser.lexerCommandExprContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerCommandExpr(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitaltList (Arithmetic2Parser.altListContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("altList(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitalternative (Arithmetic2Parser.alternativeContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("alternative(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitelement (Arithmetic2Parser.elementContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("element(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitpredicateOptions (Arithmetic2Parser.predicateOptionsContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("predicateOptions(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitpredicateOption (Arithmetic2Parser.predicateOptionContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("predicateOption(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlabeledElement (Arithmetic2Parser.labeledElementContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("labeledElement(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitebnf (Arithmetic2Parser.ebnfContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ebnf(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitblockSuffix (Arithmetic2Parser.blockSuffixContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("blockSuffix(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitebnfSuffix (Arithmetic2Parser.ebnfSuffixContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ebnfSuffix(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitlexerAtom (Arithmetic2Parser.lexerAtomContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("lexerAtom(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitatom (Arithmetic2Parser.atomContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("atom(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitnotSet (Arithmetic2Parser.notSetContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("notSet(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitblockSet (Arithmetic2Parser.blockSetContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("blockSet(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitsetElement (Arithmetic2Parser.setElementContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("setElement(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitblock (Arithmetic2Parser.blockContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("block(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitruleref (Arithmetic2Parser.rulerefContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("ruleref(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitcharacterRange (Arithmetic2Parser.characterRangeContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("characterRange(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitterminalDef (Arithmetic2Parser.terminalDefContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("terminalDef(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitelementOptions (Arithmetic2Parser.elementOptionsContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("elementOptions(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitelementOption (Arithmetic2Parser.elementOptionContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("elementOption(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-  public String visitidentifier (Arithmetic2Parser.identifierContext ctx) {
-    StringBuilder result = new StringBuilder();
-    result.append("identifier(");
-    for (int i = 0; i < ctx.getChildCount(); i++) {
-      if (i > 0) result.append(", ");
-      result.append(visit(ctx.getChild(i)));
-    }
-    result.append(")");
-    return result.toString();
-  }
-
-}
diff --git a/developer/jvm/.gitignore b/developer/jvm/.gitignore
deleted file mode 100644 (file)
index 2db43ed..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-*
-!/.gitignore
-
diff --git a/developer/ologist/#rule_list.txt# b/developer/ologist/#rule_list.txt#
deleted file mode 100644 (file)
index dd9812e..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-Extracted Rules:
-PATH
-MONTH
-RIGHT_ARROW
-RIGHT_BRACKET_TILDE
-CREATE
-GROUPS
-TRIM
-CLOSE
-UINT32
-AGGREGATES
-FLOAT128
-LOG10
-FLOOR
-CATALOG
-YEAR
-CONNECTING
-CURRENT_PROPERTY_GRAPH
-NOTHING
-PARTITION
-INT16
-REVERSE_SOLIDUS
-BINDINGS
-LEFT_ANGLE_BRACKET
-LEFT
-NODE
-LEFT_BRACKET
-SIZE
-BIGINT
-SUM
-WHERE
-AS
-AT
-MIN
-QUERY
-TILDE_LEFT_BRACKET
-LEFT_ARROW_TILDE
-LTRIM
-VARCHAR
-SOURCE
-THEN
-XOR
-BINDING
-ALL_DIFFERENT
-SAME
-ORDINALITY
-CALL
-ALTER
-SET
-INT32
-BYTE_LENGTH
-PATHS
-RIGHT_PAREN
-CONSTRAINT
-PRECISION
-ASC
-GROUP
-UPPER
-ABS
-DELETE
-SMALL
-SIMPLE_COMMENT_MINUS
-VARIABLE
-BY
-OFFSET
-OCTET_LENGTH
-SKIP_RESERVED_WORD
-ELEMENT_ID
-INTERVAL
-DURATION_BETWEEN
-PROCEDURE
-YIELD
-STDDEV_POP
-POWER
-DOUBLE_DOLLAR_SIGN
-COLLECT_LIST
-INT8
-DETACH
-OPEN
-PERCENT
-STRING
-VARBINARY
-SIMPLE
-INTEGER8
-TO
-BRACKET_RIGHT_ARROW
-FLOAT16
-UNION
-DURATION
-SLASH_MINUS
-HOME_PROPERTY_GRAPH
-LOCAL_TIMESTAMP
-TYPED
-LEFT_ARROW
-FLOAT32
-DOUBLE_PERIOD
-DESC
-INTEGER32
-INTEGER128
-OPTIONAL
-PRODUCT
-DESCENDING
-PROPERTY_EXISTS
-LABEL
-LEFT_BRACE
-CURRENT_TIME
-REPLACE
-LABELS
-INTEGER
-NUMBER
-PROJECT
-INTEGER256
-PROPERTY
-PERCENTILE_DISC
-FOR
-UNIQUE
-TRAILING
-BTRIM
-UINT64
-BOOLEAN
-INTEGER16
-AVG
-NOT
-UBIGINT
-CEILING
-LOWER
-LAST
-SINH
-PATH_LENGTH
-INSTANT
-SIN
-END
-RELATIONSHIP
-HAVING
-LIST
-TANH
-TEMPORAL
-QUOTE
-MULTISET_ALTERNATION_OPERATOR
-BINARY
-ASINp
-UINT8
-DROP
-INFINITY
-RETURN
-ELEMENTS
-LEFT_ARROW_BRACKET
-SIGNED
-LEFT_MINUS_RIGHT
-SCHEMA
-NEXT
-RADIANS
-NORMALIZE
-GQLSTATUS
-RENAME
-BIG
-SLASH_TILDE_RIGHT
-FLOAT256
-FILTER
-MOD
-EXISTS
-INT64
-FLOAT64
-CONCATENATION_OPERATOR
-TIME
-COLON
-INTERSECT
-NORMALIZED
-WITH
-CLONE
-SLASH_MINUS_RIGHT
-RIGHT_BRACKET
-CURRENT_ROLE
-GRANT
-RELATIONSHIPS
-PLUS_SIGN
-DATETIME
-BOOL
-DIRECTORY
-DESTINATION
-START
-CHAR_LENGTH
-CHARACTER_LENGTH
-ZONED
-UNDERSCORE
-PERCENTILE_CONT
-DOUBLE_QUOTE
-SQRT
-INT128
-FINISH
-NULLIF
-SESSION_USER
-TABLE
-STDDEV_SAMP
-WHEN
-AGGREGATE
-VERTEX
-EXCLAMATION_MARK
-LOCAL
-DIRECTED
-ELSE
-CEIL
-CURRENT_GRAPH
-IF
-TYPE
-RIGHT_DOUBLE_ARROW
-PARAMETER
-CAST
-LOCAL_TIME
-GRAPH
-AMPERSAND
-SLASH_TILDE
-TRAIL
-IN
-LOG
-DISTINCT
-HOME_SCHEMA
-INT256
-IS
-EXACT
-LEADING
-FUNCTION
-INTEGER64
-CASE
-NODETACH
-NFKC
-NFKD
-DOLLAR_SIGN
-WITHOUT
-COUNT
-NOT_EQUALS_OPERATOR
-MINUS_LEFT_BRACKET
-MAX
-UNSIGNED
-CHAR
-TRANSACTION
-SYSTEM_USER
-LEFT_PAREN
-WRITE
-ORDER
-COMMERCIAL_AT
-REMOVE
-RIGHT
-VALUES
-DOUBLE
-COMMA
-GRAVE_ACCENT
-ZONED_DATETIME
-MINUS_SLASH
-NUMERIC
-REVOKE
-COS
-CURRENT_SCHEMA
-USE
-COT
-ASTERISK
-CHARACTERISTICS
-COPY
-SESSION
-TILDE_SLASH
-FIRST
-UNDIRECTED
-SELECT
-RECORDS
-ELEMENT
-ASCENDING
-LABELED
-HOME_GRAPH
-LOCAL_DATETIME
-REPEATABLE
-DAY
-UINT
-SIMPLE_COMMENT_SOLIDUS
-BYTES
-TAN
-ALL
-CURRENT_USER
-LN
-ARRAY
-SUBSTRING
-ZONE
-RECORD
-DECIMAL
-ONLY
-NFC
-FROM
-RESET
-VALUE
-LEFT_ARROW_TILDE_BRACKET
-NFD
-RIGHT_BRACKET_MINUS
-ZONED_TIME
-COALESCE
-QUESTION_MARK
-TIMESTAMP
-ACOS
-MINUTE
-EDGE
-GREATER_THAN_OR_EQUALS_OPERATOR
-BOTH
-NULL
-UNIT
-LEFT_TILDE_SLASH
-VERTICAL_BAR
-DIFFERENT
-KEEP
-LEFT_MINUS_SLASH
-BRACKETED_COMMENT
-PARAMETERS
-EXISTING
-EXCEPT
-SOLIDUS
-READ
-DATE
-SHORTEST
-LIKE
-DATA
-DRYRUN
-AND
-PERIOD
-OTHERWISE
-REAL
-INSERT
-CURRENT_DATE
-ATAN
-NO
-FLOAT
-LESS_THAN_OR_EQUALS_OPERATOR
-RIGHT_ANGLE_BRACKET
-CURRENT_TIMESTAMP
-HOUR
-LIMIT
-UINT16
-ANY
-UINT256
-ABSTRACT
-INT
-ROLLBACK
-OF
-REFERENCE
-CARDINALITY
-EDGES
-TILDE_RIGHT_ARROW
-COSH
-NULLS
-RTRIM
-ON
-BRACKET_TILDE_RIGHT_ARROW
-WALK
-RIGHT_BRACE
-DEC
-OR
-COMMIT
-MINUS_SIGN
-UINT128
-USMALLINT
-DOUBLE_COLON
-EQUALS_OPERATOR
-DEGREES
-TEMP
-ACYCLIC
-SMALLINT
-LET
-SECOND
-TILDE
-EXP
-MATCH
-CLEAR
diff --git a/developer/ologist/.githolder b/developer/ologist/.githolder
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/developer/ologist/.ispell_antlr b/developer/ologist/.ispell_antlr
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/developer/ologist/Cypher_GQL_differences.txt b/developer/ologist/Cypher_GQL_differences.txt
deleted file mode 100644 (file)
index 227a5bf..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-Seems to me, that creating a disjoint sub graph is identical to creating a new graph.  Perhaps we can work with that.  Why don't we create a master index of disjoint subgraphs in a header, then when a new graph is made we will add an entry in the index. 
-ChatGPT
-Creating a master index of disjoint subgraphs and managing them within a single Neo4j database is a practical approach. By using labels or properties to differentiate subgraphs, you can effectively manage multiple logical graphs within a single physical graph.
-
-    Here's a step-by-step approach to implement this:
-
-    Step 1: Create the Master Index
-    First, create a master index node that will store references to all disjoint subgraphs.
-
-    cypher
-
-    MERGE (index:GraphIndex {name: 'MasterIndex'})
-    Step 2: Create a New Graph
-    When creating a new graph, add an entry to the master index.
-
-    cypher
-
-    // Create a new graph and add an entry to the master index
-    MERGE (index:GraphIndex {name: 'MasterIndex'})
-    CREATE (graph:Graph {name: 'myNewGraph'})
-    MERGE (index)-[:CONTAINS]->(graph)
-
-    // Create nodes and relationships within the new graph
-    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Alice'})
-    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Bob'})
-    Step 3: Querying Subgraphs
-    To query a specific subgraph, use the label or properties associated with that subgraph.
-
-    cypher
-
-    MATCH (index:GraphIndex {name: 'MasterIndex'})-[:CONTAINS]->(graph:Graph {name: 'myNewGraph'})-[:HAS_NODE]->(person:Person:myNewGraph)
-    RETURN person.name
-    Step 4: Adding More Nodes and Relationships to a Subgraph
-    To add more nodes and relationships to an existing subgraph, refer to the subgraph by its label or properties.
-
-    cypher
-
-    MATCH (graph:Graph {name: 'myNewGraph'})
-    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Charlie'})
-    CREATE (person:Person:myNewGraph {name: 'Alice'})-[:KNOWS]->(person:Person:myNewGraph {name: 'Charlie'})
-    Example: Full Workflow
-    Creating a New Graph
-    cypher
-
-    MERGE (index:GraphIndex {name: 'MasterIndex'})
-    CREATE (graph:Graph {name: 'myNewGraph'})
-    MERGE (index)-[:CONTAINS]->(graph)
-    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Alice'})
-    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Bob'})
-    Querying a Subgraph
-    cypher
-
-    MATCH (index:GraphIndex {name: 'MasterIndex'})-[:CONTAINS]->(graph:Graph {name: 'myNewGraph'})-[:HAS_NODE]->(person:Person:myNewGraph)
-    RETURN person.name
-    Adding to a Subgraph
-    cypher
-
-    MATCH (graph:Graph {name: 'myNewGraph'})
-    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Charlie'})
-    MATCH (alice:Person:myNewGraph {name: 'Alice'})
-    MATCH (charlie:Person:myNewGraph {name: 'Charlie'})
-    CREATE (alice)-[:KNOWS]->(charlie)
diff --git a/developer/ologist/GQL_20240412_rule_list.txt b/developer/ologist/GQL_20240412_rule_list.txt
deleted file mode 100644 (file)
index 729a7e6..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-Here's the list of rules found in the GQL_20240412.g4 file:
-
-transactionMode
-transactionAccessMode
-rollbackCommand
-commitCommand
-nestedProcedureSpecification
-procedureSpecification
-nestedDataModifyingProcedureSpecification
-nestedQuerySpecification
-procedureBody
-bindingVariableDefinitionBlock
-bindingVariableDefinition
-statementBlock
-statement
-nextStatement
-graphVariableDefinition
-optTypedGraphInitializer
-graphInitializer
-bindingTableVariableDefinition
-optTypedBindingTableInitializer
-bindingTableInitializer
-valueVariableDefinition
-optTypedValueInitializer
-valueInitializer
-graphExpression
-currentGraph
-bindingTableExpression
-nestedBindingTableQuerySpecification
-objectExpressionPrimary
-linearCatalogModifyingStatement
-simpleCatalogModifyingStatement
-primitiveCatalogModifyingStatement
-createSchemaStatement
-dropSchemaStatement
-createGraphStatement
-openGraphType
-ofGraphType
-graphTypeLikeGraph
-graphSource
-dropGraphStatement
-createGraphTypeStatement
-graphTypeSource
-copyOfGraphType
-dropGraphTypeStatement
-callCatalogModifyingProcedureStatement
-linearDataModifyingStatement
-focusedLinearDataModifyingStatement
-focusedLinearDataModifyingStatementBody
-focusedNestedDataModifyingProcedureSpecification
-ambientLinearDataModifyingStatement
-ambientLinearDataModifyingStatementBody
-simpleLinearDataAccessingStatement
-simpleDataModifyingStatement
-primitiveDataModifyingStatement
-insertStatement
-setStatement
-setItemList
-setItem
-setPropertyItem
-setAllPropertiesItem
-setLabelItem
-removeStatement
-removeItemList
-removeItem
-removePropertyItem
-removeLabelItem
-deleteStatement
-deleteItemList
-deleteItem
-callDataModifyingProcedureStatement
-compositeQueryStatement
-compositeQueryExpression
-queryConjunction
-setOperator
-compositeQueryPrimary
-linearQueryStatement
-focusedLinearQueryStatement
-focusedLinearQueryStatementBody
-focusedNestedQuerySpecification
-ambientLinearQueryStatement
-ambientLinearQueryStatementBody
-nestedLinearQuerySpecification
-simpleQuerySpecification
-simpleQueryPrimary
-callDataAccessingProcedureStatement
-ambientDataModifyingProcedureStatement
-ambientQuerySpecification
-ambientQueryPrimary
-simpleQuerySpecificationBody
-simpleQueryPrimaryExpression
-simpleQueryBodyExpression
-compoundQuerySpecification
-ambientLinearQuerySpecification
-simpleDataAccessingStatement
-ambientDataModifyingStatement
-ambientLinearDataModifyingSpecification
-simpleDataAccessingSpecification
-ambientDataModifyingStatementBody
-simpleDataModifyingSpecification
-ambientLinearDataModifyingStatementBody
-simpleLinearDataModifyingSpecification
-focusedLinearDataModifyingSpecification
-focusedDataModifyingSpecification
-focusedLinearDataModifyingStatementBodyExpression
-focusedLinearQuerySpecification
-simpleLinearQuerySpecification
-focusedLinearQuerySpecificationBody
-simpleLinearQuerySpecificationBody
-focusedLinearQuerySpecificationBodyExpression
-simpleLinearQuerySpecificationBodyExpression
-compoundQueryBody
-compoundQueryExpression
-compoundQueryExpressionPart
-queryPrimary
-queryExpression
-queryTerm
-query
-querySpecification
-queryExpressionBody
-simpleQueryExpression
-simpleQuerySpecificationBodyExpression
-simpleQuerySpecificationBodyExpressionPart
-compoundQuerySpecificationBodyExpression
-compoundQuerySpecificationBodyExpressionPart
-simpleQuerySpecificationBodyPart
-simpleQuerySpecificationBodyExpressionPart
-simpleQuerySpecificationBodyExpression
-queryPrimaryExpression
-queryExpressionPart
-queryExpressionBodyPart
-queryExpressionPrimary
-queryExpressionTerm
-queryExpressionPrimaryExpression
-queryExpressionPrimaryExpressionPart
-queryExpressionPrimaryExpressionBody
-queryExpressionPrimaryExpressionTerm
-queryExpressionPrimaryExpressionBodyPart
-queryExpressionPrimaryExpressionPrimary
-queryExpressionPrimaryExpressionTermPart
-queryExpressionPrimaryExpressionPrimaryPart
-simpleQueryExpressionPrimary
-simpleQueryExpressionPrimaryPart
-simpleQueryExpressionPrimaryBody
-simpleQueryExpressionPrimaryTerm
-simpleQueryExpressionPrimaryBodyPart
-simpleQueryExpressionPrimaryPrimary
-simpleQueryExpressionPrimaryPrimaryPart
-simpleQueryExpressionPrimaryTermPart
-simpleQueryExpressionPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyTermPart
-simpleQueryExpressionPrimaryBodyExpression
-simpleQueryExpressionPrimaryBodyExpressionPart
-simpleQueryExpressionPrimaryBodyExpressionBody
-simpleQueryExpressionPrimaryBodyExpressionTerm
-simpleQueryExpressionPrimaryBodyExpressionBodyPart
-simpleQueryExpressionPrimaryBodyExpressionTermPart
-simpleQueryExpressionPrimaryBodyExpressionPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
-simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimary ​​
-
-
-
-
-
-
-
diff --git a/developer/ologist/antlr-mode.el b/developer/ologist/antlr-mode.el
deleted file mode 100644 (file)
index 9557fc8..0000000
+++ /dev/null
@@ -1,2661 +0,0 @@
-;;; antlr-mode.el --- major mode for ANTLR grammar files
-
-;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
-
-;; Author: Christoph Wedler <Christoph.Wedler@sap.com>
-;; Keywords: languages, ANTLR, code generator
-;; Version: 2.2c
-;; X-URL: http://antlr-mode.sourceforge.net/
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; The Emacs package ANTLR-Mode provides: syntax highlighting for ANTLR grammar
-;; files, automatic indentation, menus containing rule/token definitions and
-;; supported options and various other things like running ANTLR from within
-;; Emacs.
-
-;; For details, check <http://antlr-mode.sourceforge.net/> or, if you prefer
-;; the manual style, follow all commands mentioned in the documentation of
-;; `antlr-mode'.  ANTLR is a LL(k)-based recognition tool which generates
-;; lexers, parsers and tree transformers in Java, C++ or Sather and can be
-;; found at <http://www.antlr.org/>.
-
-;; Bug fixes, bug reports, improvements, and suggestions for the newest version
-;; are strongly appreciated.
-
-;; To-do/Wish-list:
-;;
-;;  * Next Version [C-c C-w].  Produce HTML document with syntax highlighted
-;;    and hyper-links (using htmlize).
-;;  * Next Version [C-c C-u].  Insert/update special comments: each rule lists
-;;    all rules which use the current rule.  With font-lock update.
-;;  * Next Version.  Make hiding much more customizable.
-;;  * Planned [C-c C-j].  Jump to generated coding.
-;;  * Planned.  Further support for imenu, i.e., include entries for method
-;;    definitions at beginning of grammar class.
-;;  * Planned [C-c C-p].  Pack/unpack rule/subrule & options (one/multi-line).
-;;
-;;  * Probably.  Show rules/dependencies for ANT like for Makefile (does ANT
-;;    support vocabularies and grammar inheritance?), I have to look at
-;;    jde-ant.el: http://jakarta.apache.org/ant/manual/OptionalTasks/antlr.html
-;;  * Probably.  Make `indent-region' faster, especially in actions.  ELP
-;;    profiling in a class init action shows half the time is spent in
-;;    `antlr-next-rule', the other half in `c-guess-basic-syntax'.
-;;  * Unlikely.  Sather as generated language with syntax highlighting etc/.
-;;    Questions/problems: is sather-mode.el the standard mode for sather, is it
-;;    still supported, what is its relationship to eiffel3.el?  Requirement:
-;;    this mode must not depend on a Sather mode.
-;;  * Unlikely.  Faster syntax highlighting: sectionize the buffer into Antlr
-;;    and action code and run special highlighting functions on these regions.
-;;    Problems: code size, this mode would depend on font-lock internals.
-
-;;; Installation:
-
-;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode.
-
-;; If antlr-mode is not part of your distribution, put this file into your
-;; load-path and the following into your init file:
-;;   (autoload 'antlr-mode "antlr-mode" nil t)
-;;   (setq auto-mode-alist (cons '("\\.g\\'" . antlr-mode) auto-mode-alist))
-;;   (add-hook 'speedbar-load-hook  ; would be too late in antlr-mode.el
-;;            (lambda () (speedbar-add-supported-extension ".g")))
-
-;; I strongly recommend to use font-lock with a support mode like fast-lock,
-;; lazy-lock or better jit-lock (Emacs-21.1+) / lazy-shot (XEmacs).
-
-;; To customize, use menu item "Antlr" -> "Customize Antlr".
-
-;;; Code:
-
-(eval-when-compile
-  (require 'cl))
-
-(require 'easymenu)
-(require 'cc-mode)
-
-;; Just to get the rid of the byte compiler warning.  The code for
-;; this function and its friends are too complex for their own good.
-(declare-function cond-emacs-xemacs-macfn "antlr-mode" (args &optional msg))
-
-;; General Emacs/XEmacs-compatibility compile-time macros
-(eval-when-compile
-  (defmacro cond-emacs-xemacs (&rest args)
-    (cond-emacs-xemacs-macfn
-     args "`cond-emacs-xemacs' must return exactly one element"))
-  (defun cond-emacs-xemacs-macfn (args &optional msg)
-    (if (atom args) args
-      (and (eq (car args) :@) (null msg) ; (:@ ...spliced...)
-          (setq args (cdr args)
-                msg "(:@ ....) must return exactly one element"))
-      (let ((ignore (if (featurep 'xemacs) :EMACS :XEMACS))
-           (mode :BOTH) code)
-       (while (consp args)
-         (if (memq (car args) '(:EMACS :XEMACS :BOTH)) (setq mode (pop args)))
-         (if (atom args)
-             (or args (error "Used selector %s without elements" mode))
-           (or (eq ignore mode)
-               (push (cond-emacs-xemacs-macfn (car args)) code))
-           (pop args)))
-       (cond (msg (if (or args (cdr code)) (error msg) (car code)))
-             ((or (null args) (eq ignore mode)) (nreverse code))
-             (t (nconc (nreverse code) args))))))
-  ;; Emacs/XEmacs-compatibility `defun': remove interactive "_" for Emacs, use
-  ;; existing functions when they are `fboundp', provide shortcuts if they are
-  ;; known to be defined in a specific Emacs branch (for short .elc)
-  (defmacro defunx (name arglist &rest definition)
-    (let ((xemacsp (featurep 'xemacs)) reuses)
-      (while (memq (car definition)
-                  '(:try :emacs-and-try :xemacs-and-try))
-       (if (eq (pop definition) (if xemacsp :xemacs-and-try :emacs-and-try))
-           (setq reuses (car definition)
-                 definition nil)
-         (push (pop definition) reuses)))
-      (if (and reuses (symbolp reuses))
-         `(defalias ',name ',reuses)
-       (let* ((docstring (if (stringp (car definition)) (pop definition)))
-              (spec (and (not xemacsp)
-                         (eq (car-safe (car definition)) 'interactive)
-                         (null (cddar definition))
-                         (cadar definition))))
-         (if (and (stringp spec)
-                  (not (string-equal spec ""))
-                  (eq (aref spec 0) ?_))
-             (setq definition
-                   (cons (if (string-equal spec "_")
-                             '(interactive)
-                           `(interactive ,(substring spec 1)))
-                         (cdr definition))))
-         (if (null reuses)
-             `(defun ,name ,arglist ,docstring
-                ,@(cond-emacs-xemacs-macfn definition))
-           ;; no dynamic docstring in this case
-           `(eval-and-compile          ; no warnings in Emacs
-              (defalias ',name
-                (cond ,@(mapcar (lambda (func) `((fboundp ',func) ',func))
-                                (nreverse reuses))
-                      (t ,(if definition
-                              `(lambda ,arglist ,docstring
-                                 ,@(cond-emacs-xemacs-macfn definition))
-                            'ignore))))))))))
-  (defmacro ignore-errors-x (&rest body)
-    (let ((specials '((scan-sexps . 4) (scan-lists . 5)))
-         spec nils)
-      (if (and (featurep 'xemacs)
-              (null (cdr body)) (consp (car body))
-              (setq spec (assq (caar body) specials))
-              (>= (setq nils (- (cdr spec) (length (car body)))) 0))
-         `(,@(car body) ,@(make-list nils nil) t)
-       `(ignore-errors ,@body)))))
-
-;; More compile-time-macros
-(eval-when-compile
-  (defmacro save-buffer-state-x (&rest body) ; similar to EMACS/lazy-lock.el
-    (let ((modified (with-no-warnings (gensym "save-buffer-state-x-modified-"))))
-      `(let ((,modified (buffer-modified-p)))
-        (unwind-protect
-            (let ((buffer-undo-list t) (inhibit-read-only t)
-                  ,@(unless (featurep 'xemacs)
-                      '((inhibit-point-motion-hooks t) deactivate-mark))
-                  before-change-functions after-change-functions
-                  buffer-file-name buffer-file-truename)
-              ,@body)
-          (and (not ,modified) (buffer-modified-p)
-               (set-buffer-modified-p nil)))))))
-(put 'save-buffer-state-x 'lisp-indent-function 0)
-
-(defvar outline-level)
-(defvar imenu-use-markers)
-(defvar imenu-create-index-function)
-
-;; We cannot use `c-forward-syntactic-ws' directly since it is a macro since
-;; cc-mode-5.30 => antlr-mode compiled with older cc-mode would fail (macro
-;; call) when used with newer cc-mode.  Also, antlr-mode compiled with newer
-;; cc-mode would fail (undefined `c-forward-sws') when used with older cc-mode.
-;; Additional to the `defalias' below, we must set `antlr-c-forward-sws' to
-;; `c-forward-syntactic-ws' when `c-forward-sws' is not defined after requiring
-;; cc-mode.
-(defalias 'antlr-c-forward-sws 'c-forward-sws)
-
-
-;;;;##########################################################################
-;;;;  Variables
-;;;;##########################################################################
-
-
-(defgroup antlr nil
-  "Major mode for ANTLR grammar files."
-  :group 'languages
-  :link '(emacs-commentary-link "antlr-mode.el")
-  :link '(url-link "http://antlr-mode.sourceforge.net/")
-  :prefix "antlr-")
-
-(defconst antlr-version "2.2c"
-  "ANTLR major mode version number.
-Check <http://antlr-mode.sourceforge.net/> for the newest.")
-
-
-;;;===========================================================================
-;;;  Controlling ANTLR's code generator (language option)
-;;;===========================================================================
-
-(defvar antlr-language nil
-  "Major mode corresponding to ANTLR's \"language\" option.
-Set via `antlr-language-alist'.  The only useful place to change this
-buffer-local variable yourself is in `antlr-mode-hook' or in the \"local
-variable list\" near the end of the file, see
-`enable-local-variables'.")
-
-(defcustom antlr-language-alist
-  '((java-mode "Java" nil "\"Java\"" "Java")
-    (c++-mode "C++" "\"Cpp\"" "Cpp"))
-  "List of ANTLR's supported languages.
-Each element in this list looks like
-  \(MAJOR-MODE MODELINE-STRING OPTION-VALUE...)
-
-MAJOR-MODE, the major mode of the code in the grammar's actions, is the
-value of `antlr-language' if the first group in the string matched by
-REGEXP in `antlr-language-limit-n-regexp' is one of the OPTION-VALUEs.
-An OPTION-VALUE of nil denotes the fallback element.  MODELINE-STRING is
-also displayed in the mode line next to \"Antlr\"."
-  :group 'antlr
-  :type '(repeat (group :value (java-mode "")
-                       (function :tag "Major mode")
-                       (string :tag "Mode line string")
-                       (repeat :tag "ANTLR language option" :inline t
-                               (choice (const :tag "Default" nil)
-                                       string )))))
-
-(defcustom antlr-language-limit-n-regexp
-  '(8192 . "language[ \t]*=[ \t]*\\(\"?[A-Z][A-Za-z_]*\"?\\)")
-  "Used to set a reasonable value for `antlr-language'.
-Looks like \(LIMIT \. REGEXP).  Search for REGEXP from the beginning of
-the buffer to LIMIT and use the first group in the matched string to set
-the language according to `antlr-language-alist'."
-  :group 'antlr
-  :type '(cons (choice :tag "Limit" (const :tag "No" nil) (integer :value 0))
-              regexp))
-
-
-;;;===========================================================================
-;;;  Hide/Unhide, Indent/Tabs
-;;;===========================================================================
-
-(defcustom antlr-action-visibility 3
-  "Visibility of actions when command `antlr-hide-actions' is used.
-If nil, the actions with their surrounding braces are hidden.  If a
-number, do not hide the braces, only hide the contents if its length is
-greater than this number."
-  :group 'antlr
-  :type '(choice (const :tag "Completely hidden" nil)
-                (integer :tag "Hidden if longer than" :value 3)))
-
-(defcustom antlr-indent-comment 'tab
-  "Non-nil, if the indentation should touch lines in block comments.
-If nil, no continuation line of a block comment is changed.  If t, they
-are changed according to `c-indentation-line'.  When not nil and not t,
-they are only changed by \\[antlr-indent-command]."
-  :group 'antlr
-  :type '(radio (const :tag "No" nil)
-               (const :tag "Always" t)
-               (sexp :tag "With TAB" :format "%t" :value tab)))
-
-(defcustom antlr-tab-offset-alist
-  '((antlr-mode nil 4 nil)
-    (java-mode "antlr" 4 nil))
-  "Alist to determine whether to use ANTLR's convention for TABs.
-Each element looks like \(MAJOR-MODE REGEXP TAB-WIDTH INDENT-TABS-MODE).
-The first element whose MAJOR-MODE is nil or equal to `major-mode' and
-whose REGEXP is nil or matches variable `buffer-file-name' is used to
-set `tab-width' and `indent-tabs-mode'.  This is useful to support both
-ANTLR's and Java's indentation styles.  Used by `antlr-set-tabs'."
-  :group 'antlr
-  :type '(repeat (group :value (antlr-mode nil 8 nil)
-                       (choice (const :tag "All" nil)
-                               (function :tag "Major mode"))
-                       (choice (const :tag "All" nil) regexp)
-                       (integer :tag "Tab width")
-                       (boolean :tag "Indent-tabs-mode"))))
-
-(defcustom antlr-indent-style "java"
-  "If non-nil, cc-mode indentation style used for `antlr-mode'.
-See `c-set-style' and for details, where the most interesting part in
-`c-style-alist' is the value of `c-basic-offset'."
-  :group 'antlr
-  :type '(choice (const nil) regexp))
-
-(defcustom antlr-indent-item-regexp
-  "[]}):;|&]" ; & is local ANTLR extension (SGML's and-connector)
-  "Regexp matching lines which should be indented by one TAB less.
-See `antlr-indent-line' and command \\[antlr-indent-command]."
-  :group 'antlr
-  :type 'regexp)
-
-(defcustom antlr-indent-at-bol-alist
-  ;; eval-when-compile not usable with defcustom...
-  '((java-mode . "\\(package\\|import\\)\\>")
-    (c++-mode . "#\\(assert\\|cpu\\|define\\|endif\\|el\\(if\\|se\\)\\|i\\(dent\\|f\\(def\\|ndef\\)?\\|mport\\|nclude\\(_next\\)?\\)\\|line\\|machine\\|pragma\\|system\\|un\\(assert\\|def\\)\\|warning\\)\\>"))
-  "Alist of regexps matching lines are indented at column 0.
-Each element in this list looks like (MODE . REGEXP) where MODE is a
-function and REGEXP is a regular expression.
-
-If `antlr-language' equals to a MODE, the line starting at the first
-non-whitespace is matched by the corresponding REGEXP, and the line is
-part of a header action, indent the line at column 0 instead according
-to the normal rules of `antlr-indent-line'."
-  :group 'antlr
-  :type '(repeat (cons (function :tag "Major mode") regexp)))
-
-;; adopt indentation to cc-engine
-(defvar antlr-disabling-cc-syntactic-symbols
-  '(statement-block-intro
-    defun-block-intro topmost-intro statement-case-intro member-init-intro
-    arglist-intro brace-list-intro knr-argdecl-intro inher-intro
-    objc-method-intro
-    block-close defun-close class-close brace-list-close arglist-close
-    inline-close extern-lang-close namespace-close))
-
-
-;;;===========================================================================
-;;;  Options: customization
-;;;===========================================================================
-
-(defcustom antlr-options-use-submenus t
-  "Non-nil, if the major mode menu should include option submenus.
-If nil, the menu just includes a command to insert options.  Otherwise,
-it includes four submenus to insert file/grammar/rule/subrule options."
-  :group 'antlr
-  :type 'boolean)
-
-(defcustom antlr-tool-version 20701
-  "The version number of the Antlr tool.
-The value is an integer of the form XYYZZ which stands for vX.YY.ZZ.
-This variable is used to warn about non-supported options and to supply
-version correct option values when using \\[antlr-insert-option].
-
-Don't use a number smaller than 20600 since the stored history of
-Antlr's options starts with v2.06.00, see `antlr-options-alists'.  You
-can make this variable buffer-local."
-  :group 'antlr
-  :type 'integer)
-
-(defcustom antlr-options-auto-colon t
-  "Non-nil, if `:' is inserted with a rule or subrule options section.
-A `:' is only inserted if this value is non-nil, if a rule or subrule
-option is inserted with \\[antlr-insert-option], if there was no rule or
-subrule options section before, and if a `:' is not already present
-after the section, ignoring whitespace, comments and the init action."
-  :group 'antlr
-  :type 'boolean)
-
-(defcustom antlr-options-style nil
-  "List of symbols which determine the style of option values.
-If a style symbol is present, the corresponding option value is put into
-quotes, i.e., represented as a string, otherwise it is represented as an
-identifier.
-
-The only style symbol used in the default value of `antlr-options-alist'
-is `language-as-string'.  See also `antlr-read-value'."
-  :group 'antlr
-  :type '(repeat (symbol :tag "Style symbol")))
-
-(defcustom antlr-options-push-mark t
-  "Non-nil, if inserting an option should set & push mark.
-If nil, never set mark when inserting an option with command
-\\[antlr-insert-option].  If t, always set mark via `push-mark'.  If a
-number, only set mark if point was outside the options area before and
-the number of lines between point and the insert position is greater
-than this value.  Otherwise, only set mark if point was outside the
-options area before."
-  :group 'antlr
-  :type '(radio (const :tag "No" nil)
-               (const :tag "Always" t)
-               (integer :tag "Lines between" :value 10)
-               (sexp :tag "If outside options" :format "%t" :value outside)))
-
-(defcustom antlr-options-assign-string " = "
-  "String containing `=' to use between option name and value.
-This string is only used if the option to insert did not exist before
-or if there was no `=' after it.  In other words, the spacing around an
-existing `=' won't be changed when changing an option value."
-  :group 'antlr
-  :type 'string)
-
-
-;;;===========================================================================
-;;;  Options: definitions
-;;;===========================================================================
-
-(defvar antlr-options-headings '("file" "grammar" "rule" "subrule")
-  "Headings for the four different option kinds.
-The standard value is (\"file\" \"grammar\" \"rule\" \"subrule\").  See
-`antlr-options-alists'")
-
-(defvar antlr-options-alists
-  '(;; file options ----------------------------------------------------------
-    (("language" antlr-language-option-extra
-      (20600 antlr-read-value
-            "Generated language: " language-as-string
-            (("Java") ("Cpp") ("HTML") ("Diagnostic")))
-      (20700 antlr-read-value
-            "Generated language: " language-as-string
-            (("Java") ("Cpp") ("HTML") ("Diagnostic") ("Sather"))))
-     ("mangleLiteralPrefix" nil
-      (20600 antlr-read-value
-            "Prefix for literals (default LITERAL_): " t))
-     ("namespace" antlr-c++-mode-extra
-      (20700 antlr-read-value
-            "Wrap generated C++ code in namespace: " t))
-     ("namespaceStd" antlr-c++-mode-extra
-      (20701 antlr-read-value
-            "Replace ANTLR_USE_NAMESPACE(std) by: " t))
-     ("namespaceAntlr" antlr-c++-mode-extra
-      (20701 antlr-read-value
-            "Replace ANTLR_USE_NAMESPACE(antlr) by: " t))
-     ("genHashLines" antlr-c++-mode-extra
-      (20701 antlr-read-boolean
-            "Include #line in generated C++ code? "))
-     )
-    ;; grammar options --------------------------------------------------------
-    (("k" nil
-      (20600 antlr-read-value
-            "Lookahead depth: "))
-     ("importVocab" nil
-      (20600 antlr-read-value
-            "Import vocabulary: "))
-     ("exportVocab" nil
-      (20600 antlr-read-value
-            "Export vocabulary: "))
-     ("testLiterals" nil               ; lexer only
-      (20600 antlr-read-boolean
-            "Test each token against literals table? "))
-     ("defaultErrorHandler" nil                ; not for lexer
-      (20600 antlr-read-boolean
-            "Generate default exception handler for each rule? "))
-     ("codeGenMakeSwitchThreshold" nil
-      (20600 antlr-read-value
-            "Min number of alternatives for 'switch': "))
-     ("codeGenBitsetTestThreshold" nil
-      (20600 antlr-read-value
-            "Min size of lookahead set for bitset test: "))
-     ("analyzerDebug" nil
-      (20600 antlr-read-boolean
-            "Display debugging info during grammar analysis? "))
-     ("codeGenDebug" nil
-      (20600 antlr-read-boolean
-            "Display debugging info during code generation? "))
-     ("buildAST" nil                   ; not for lexer
-      (20600 antlr-read-boolean
-            "Use automatic AST construction/transformation? "))
-     ("ASTLabelType" nil               ; not for lexer
-      (20600 antlr-read-value
-            "Class of user-defined AST node: " t))
-     ("charVocabulary" nil             ; lexer only
-      (20600 nil
-            "Insert character vocabulary"))
-     ("interactive" nil
-      (20600 antlr-read-boolean
-            "Generate interactive lexer/parser? "))
-     ("caseSensitive" nil              ; lexer only
-      (20600 antlr-read-boolean
-            "Case significant when matching characters? "))
-     ("caseSensitiveLiterals" nil      ; lexer only
-      (20600 antlr-read-boolean
-            "Case significant when testing literals table? "))
-     ("classHeaderSuffix" nil
-      (20600 nil
-            "Additional string for grammar class definition"))
-     ("filter" nil                     ; lexer only
-      (20600 antlr-read-boolean
-            "Skip rule (the name, true or false): "
-            antlr-grammar-tokens))
-     ("namespace" antlr-c++-mode-extra
-      (20700 antlr-read-value
-            "Wrap generated C++ code for grammar in namespace: " t))
-     ("namespaceStd" antlr-c++-mode-extra
-      (20701 antlr-read-value
-            "Replace ANTLR_USE_NAMESPACE(std) by: " t))
-     ("namespaceAntlr" antlr-c++-mode-extra
-      (20701 antlr-read-value
-            "Replace ANTLR_USE_NAMESPACE(antlr) by: " t))
-     ("genHashLines" antlr-c++-mode-extra
-      (20701 antlr-read-boolean
-            "Include #line in generated C++ code? "))
-;;;     ("autoTokenDef" nil            ; parser only
-;;;      (80000 antlr-read-boolean             ; default: true
-;;;         "Automatically define referenced token? "))
-;;;     ("keywordsMeltTo" nil          ; parser only
-;;;      (80000 antlr-read-value
-;;;         "Change non-matching keywords to token type: "))
-     )
-    ;; rule options ----------------------------------------------------------
-    (("testLiterals" nil               ; lexer only
-      (20600 antlr-read-boolean
-            "Test this token against literals table? "))
-     ("defaultErrorHandler" nil                ; not for lexer
-      (20600 antlr-read-boolean
-            "Generate default exception handler for this rule? "))
-     ("ignore" nil                     ; lexer only
-      (20600 antlr-read-value
-            "In this rule, ignore tokens of type: " nil
-            antlr-grammar-tokens))
-     ("paraphrase" nil                 ; lexer only
-      (20600 antlr-read-value
-            "In messages, replace name of this token by: " t))
-     )
-    ;; subrule options -------------------------------------------------------
-    (("warnWhenFollowAmbig" nil
-      (20600 antlr-read-boolean
-            "Display warnings for ambiguities with FOLLOW? "))
-     ("generateAmbigWarnings" nil
-      (20600 antlr-read-boolean
-            "Display warnings for ambiguities? "))
-     ("greedy" nil
-      (20700 antlr-read-boolean
-            "Make this optional/loop subrule greedy? "))
-     ))
-  "Definitions for Antlr's options of all four different kinds.
-
-The value looks like \(FILE GRAMMAR RULE SUBRULE) where each FILE,
-GRAMMAR, RULE, and SUBRULE is a list of option definitions of the
-corresponding kind, i.e., looks like \(OPTION-DEF...).
-
-Each OPTION-DEF looks like \(OPTION-NAME EXTRA-FN VALUE-SPEC...) which
-defines a file/grammar/rule/subrule option with name OPTION-NAME.  The
-OPTION-NAMEs are used for the creation of the \"Insert XXX Option\"
-submenus, see `antlr-options-use-submenus', and to allow to insert the
-option name with completion when using \\[antlr-insert-option].
-
-If EXTRA-FN is a function, it is called at different phases of the
-insertion with arguments \(PHASE OPTION-NAME).  PHASE can have the
-values `before-input' or `after-insertion', additional phases might be
-defined in future versions of this mode.  The phase `before-input'
-occurs before the user is asked to insert a value.  The phase
-`after-insertion' occurs after the option value has been inserted.
-EXTRA-FN might be called with additional arguments in future versions of
-this mode.
-
-Each specification VALUE-SPEC looks like \(VERSION READ-FN ARG...).  The
-last VALUE-SPEC in an OPTION-DEF whose VERSION is smaller or equal to
-`antlr-tool-version' specifies how the user is asked for the value of
-the option.
-
-If READ-FN is nil, the only ARG is a string which is printed at the echo
-area to guide the user what to insert at point.  Otherwise, READ-FN is
-called with arguments \(INIT-VALUE ARG...) to get the new value of the
-option.  INIT-VALUE is the old value of the option or nil.
-
-The standard value contains the following functions as READ-FN:
-`antlr-read-value' with ARGs = \(PROMPT AS-STRING TABLE) which reads a
-general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which
-reads a boolean value or a member of TABLE.  PROMPT is the prompt when
-asking for a new value.  If non-nil, TABLE is a table for completion or
-a function evaluating to such a table.  The return value is quoted if
-AS-STRING is non-nil and is either t or a symbol which is a member of
-`antlr-options-style'.")
-
-
-;;;===========================================================================
-;;;  Run tool, create Makefile dependencies
-;;;===========================================================================
-
-(defcustom antlr-tool-command "java antlr.Tool"
-  "Command used in \\[antlr-run-tool] to run the Antlr tool.
-This variable should include all options passed to Antlr except the
-option \"-glib\" which is automatically suggested if necessary."
-  :group 'antlr
-  :type 'string)
-
-(defcustom antlr-ask-about-save t
-  "If not nil, \\[antlr-run-tool] asks which buffers to save.
-Otherwise, it saves all modified buffers before running without asking."
-  :group 'antlr
-  :type 'boolean)
-
-(defcustom antlr-makefile-specification
-  '("\n" ("GENS" "GENS%d" " \\\n\t") "$(ANTLR)")
-  "Variable to specify the appearance of the generated makefile rules.
-This variable influences the output of \\[antlr-show-makefile-rules].
-It looks like \(RULE-SEP GEN-VAR-SPEC COMMAND).
-
-RULE-SEP is the string to separate different makefile rules.  COMMAND is
-a string with the command which runs the Antlr tool, it should include
-all options except the option \"-glib\" which is automatically added
-if necessary.
-
-If GEN-VAR-SPEC is nil, each target directly consists of a list of
-files.  If GEN-VAR-SPEC looks like \(GEN-VAR GEN-VAR-FORMAT GEN-SEP), a
-Makefile variable is created for each rule target.
-
-Then, GEN-VAR is a string with the name of the variable which contains
-the file names of all makefile rules.  GEN-VAR-FORMAT is a format string
-producing the variable of each target with substitution COUNT/%d where
-COUNT starts with 1.  GEN-SEP is used to separate long variable values."
-  :group 'antlr
-  :type '(list (string :tag "Rule separator")
-              (choice
-               (const :tag "Direct targets" nil)
-               (list :tag "Variables for targets"
-                     (string :tag "Variable for all targets")
-                     (string :tag "Format for each target variable")
-                     (string :tag "Variable separator")))
-              (string :tag "ANTLR command")))
-
-(defvar antlr-file-formats-alist
-  '((java-mode ("%sTokenTypes.java") ("%s.java"))
-    (c++-mode ("%sTokenTypes.hpp") ("%s.cpp" "%s.hpp")))
-  "Language dependent formats which specify generated files.
-Each element in this list looks looks like
-  \(MAJOR-MODE (VOCAB-FILE-FORMAT...) (CLASS-FILE-FORMAT...)).
-
-The element whose MAJOR-MODE is equal to `antlr-language' is used to
-specify the generated files which are language dependent.  See variable
-`antlr-special-file-formats' for language independent files.
-
-VOCAB-FILE-FORMAT is a format string, it specifies with substitution
-VOCAB/%s the generated file for each export vocabulary VOCAB.
-CLASS-FILE-FORMAT is a format string, it specifies with substitution
-CLASS/%s the generated file for each grammar class CLASS.")
-
-(defvar antlr-special-file-formats '("%sTokenTypes.txt" "expanded%s.g")
-  "Language independent formats which specify generated files.
-The value looks like \(VOCAB-FILE-FORMAT EXPANDED-GRAMMAR-FORMAT).
-
-VOCAB-FILE-FORMAT is a format string, it specifies with substitution
-VOCAB/%s the generated or input file for each export or import
-vocabulary VOCAB, respectively.  EXPANDED-GRAMMAR-FORMAT is a format
-string, it specifies with substitution GRAMMAR/%s the constructed
-grammar file if the file GRAMMAR.g contains a grammar class which
-extends a class other than \"Lexer\", \"Parser\" or \"TreeParser\".
-
-See variable `antlr-file-formats-alist' for language dependent
-formats.")
-
-(defvar antlr-unknown-file-formats '("?%s?.g" "?%s?")
-  "Formats which specify the names of unknown files.
-The value looks like \(SUPER-GRAMMAR-FILE-FORMAT SUPER-EVOCAB-FORMAT).
-
-SUPER-GRAMMAR-FORMAT is a format string, it specifies with substitution
-SUPER/%s the name of a grammar file for Antlr's option \"-glib\" if no
-grammar file in the current directory defines the class SUPER or if it
-is defined more than once.  SUPER-EVOCAB-FORMAT is a format string, it
-specifies with substitution SUPER/%s the name for the export vocabulary
-of above mentioned class SUPER.")
-
-(defvar antlr-help-unknown-file-text
-  "## The following rules contain filenames of the form
-##  \"?SUPERCLASS?.g\" (and \"?SUPERCLASS?TokenTypes.txt\")
-## where SUPERCLASS is not found to be defined in any grammar file of
-## the current directory or is defined more than once.  Please replace
-## these filenames by the grammar files (and their exportVocab).\n\n"
-  "String indicating the existence of unknown files in the Makefile.
-See \\[antlr-show-makefile-rules] and `antlr-unknown-file-formats'.")
-
-(defvar antlr-help-rules-intro
-  "The following Makefile rules define the dependencies for all (non-
-expanded) grammars in directory \"%s\".\n
-They are stored in the kill-ring, i.e., you can insert them with C-y
-into your Makefile.  You can also invoke M-x antlr-show-makefile-rules
-from within a Makefile to insert them directly.\n\n\n"
-  "Introduction to use with \\[antlr-show-makefile-rules].
-It is a format string and used with substitution DIRECTORY/%s where
-DIRECTORY is the name of the current directory.")
-
-
-;;;===========================================================================
-;;;  Menu
-;;;===========================================================================
-
-(defcustom antlr-imenu-name t ; (featurep 'xemacs) ; TODO: Emacs-21 bug?
-  "Non-nil, if a \"Index\" menu should be added to the menubar.
-If it is a string, it is used instead \"Index\".  Requires package
-imenu."
-  :group 'antlr
-  :type '(choice (const :tag "No menu" nil)
-                (const :tag "Index menu" t)
-                (string :tag "Other menu name")))
-
-(defvar antlr-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\t" 'antlr-indent-command)
-    (define-key map "\e\C-a" 'antlr-beginning-of-rule)
-    (define-key map "\e\C-e" 'antlr-end-of-rule)
-    (define-key map "\C-c\C-a" 'antlr-beginning-of-body)
-    (define-key map "\C-c\C-e" 'antlr-end-of-body)
-    (define-key map "\C-c\C-f" 'c-forward-into-nomenclature)
-    (define-key map "\C-c\C-b" 'c-backward-into-nomenclature)
-    (define-key map "\C-c\C-c" 'comment-region)
-    (define-key map "\C-c\C-v" 'antlr-hide-actions)
-    (define-key map "\C-c\C-r" 'antlr-run-tool)
-    (define-key map "\C-c\C-o" 'antlr-insert-option)
-    ;; I'm too lazy to define my own:
-    (define-key map "\ea" 'c-beginning-of-statement)
-    (define-key map "\ee" 'c-end-of-statement)
-    ;; electric keys:
-    (define-key map ":" 'antlr-electric-character)
-    (define-key map ";" 'antlr-electric-character)
-    (define-key map "|" 'antlr-electric-character)
-    (define-key map "&" 'antlr-electric-character)
-    (define-key map "(" 'antlr-electric-character)
-    (define-key map ")" 'antlr-electric-character)
-    (define-key map "{" 'antlr-electric-character)
-    (define-key map "}" 'antlr-electric-character)
-    map)
-  "Keymap used in `antlr-mode' buffers.")
-
-(easy-menu-define antlr-mode-menu antlr-mode-map
-  "Major mode menu."
-  `("Antlr"
-    ,@(if (cond-emacs-xemacs
-          :EMACS (and antlr-options-use-submenus
-                      (>= emacs-major-version 21))
-          :XEMACS antlr-options-use-submenus)
-         `(("Insert File Option"
-            :filter ,(lambda (x) (antlr-options-menu-filter 1 x)))
-           ("Insert Grammar Option"
-            :filter ,(lambda (x) (antlr-options-menu-filter 2 x)))
-           ("Insert Rule Option"
-            :filter ,(lambda (x) (antlr-options-menu-filter 3 x)))
-           ("Insert Subrule Option"
-            :filter ,(lambda (x) (antlr-options-menu-filter 4 x)))
-           "---")
-       '(["Insert Option" antlr-insert-option
-          :active (not buffer-read-only)]))
-    ("Forward/Backward"
-     ["Backward Rule" antlr-beginning-of-rule t]
-     ["Forward Rule" antlr-end-of-rule t]
-     ["Start of Rule Body" antlr-beginning-of-body
-      :active (antlr-inside-rule-p)]
-     ["End of Rule Body" antlr-end-of-body
-      :active (antlr-inside-rule-p)]
-     "---"
-     ["Backward Statement" c-beginning-of-statement t]
-     ["Forward Statement" c-end-of-statement t]
-     ["Backward Into Nomencl." c-backward-into-nomenclature t]
-     ["Forward Into Nomencl." c-forward-into-nomenclature t])
-    ["Indent Region" indent-region
-     :active (and (not buffer-read-only) (c-region-is-active-p))]
-    ["Comment Out Region" comment-region
-     :active (and (not buffer-read-only) (c-region-is-active-p))]
-    ["Uncomment Region"
-     (comment-region (region-beginning) (region-end) '(4))
-     :active (and (not buffer-read-only) (c-region-is-active-p))]
-    "---"
-    ["Hide Actions (incl. Args)" antlr-hide-actions t]
-    ["Hide Actions (excl. Args)" (antlr-hide-actions 2) t]
-    ["Unhide All Actions" (antlr-hide-actions 0) t]
-    "---"
-    ["Run Tool on Grammar" antlr-run-tool t]
-    ["Show Makefile Rules" antlr-show-makefile-rules t]
-    "---"
-    ["Customize Antlr" (customize-group 'antlr) t]))
-
-
-;;;===========================================================================
-;;;  font-lock
-;;;===========================================================================
-
-(defcustom antlr-font-lock-maximum-decoration 'inherit
-  "The maximum decoration level for fontifying actions.
-Value `none' means, do not fontify actions, just normal grammar code
-according to `antlr-font-lock-additional-keywords'.  Value `inherit'
-means, use value of `font-lock-maximum-decoration'.  Any other value is
-interpreted as in `font-lock-maximum-decoration' with no level-0
-fontification, see `antlr-font-lock-keywords-alist'.
-
-While calculating the decoration level for actions, `major-mode' is
-bound to `antlr-language'.  For example, with value
-  \((java-mode \. 2) (c++-mode \. 0))
-Java actions are fontified with level 2 and C++ actions are not
-fontified at all."
-  :group 'antlr
-  :type '(choice (const :tag "None" none)
-                (const :tag "Inherit" inherit)
-                (const :tag "Default" nil)
-                (const :tag "Maximum" t)
-                (integer :tag "Level" 1)
-                (repeat :menu-tag "Mode specific" :tag "Mode specific"
-                        :value ((t . t))
-                        (cons :tag "Instance"
-                              (radio :tag "Mode"
-                                     (const :tag "All" t)
-                                     (symbol :tag "Name"))
-                              (radio :tag "Decoration"
-                                     (const :tag "Default" nil)
-                                     (const :tag "Maximum" t)
-                                     (integer :tag "Level" 1))))))
-
-(defconst antlr-no-action-keywords nil
-  ;; Using nil directly won't work (would use highest level, see
-  ;; `font-lock-choose-keywords'), but a non-symbol, i.e., (list), at `car'
-  ;; would break Emacs-21.0:
-  "Empty font-lock keywords for actions.
-Do not change the value of this constant.")
-
-(defvar antlr-font-lock-keywords-alist
-  '((java-mode
-     antlr-no-action-keywords
-     java-font-lock-keywords-1 java-font-lock-keywords-2
-     java-font-lock-keywords-3)
-    (c++-mode
-     antlr-no-action-keywords
-     c++-font-lock-keywords-1 c++-font-lock-keywords-2
-     c++-font-lock-keywords-3))
-  "List of font-lock keywords for actions in the grammar.
-Each element in this list looks like
-  \(MAJOR-MODE KEYWORD...)
-
-If `antlr-language' is equal to MAJOR-MODE, the KEYWORDs are the
-font-lock keywords according to `font-lock-defaults' used for the code
-in the grammar's actions and semantic predicates, see
-`antlr-font-lock-maximum-decoration'.")
-
-(defvar antlr-default-face 'antlr-default)
-(defface antlr-default '((t nil))
-  "Face to prevent strings from language dependent highlighting.
-Do not change."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-default-face 'face-alias 'antlr-default)
-(put 'antlr-font-lock-default-face 'obsolete-face "22.1")
-
-(defvar antlr-keyword-face 'antlr-keyword)
-(defface antlr-keyword
-  (cond-emacs-xemacs
-   '((((class color) (background light))
-      (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
-     (t :inherit font-lock-keyword-face)))
-  "ANTLR keywords."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-keyword-face 'face-alias 'antlr-keyword)
-(put 'antlr-font-lock-keyword-face 'obsolete-face "22.1")
-
-(defvar antlr-syntax-face 'antlr-keyword)
-(defface antlr-syntax
-  (cond-emacs-xemacs
-   '((((class color) (background light))
-      (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
-     (t :inherit font-lock-constant-face)))
-  "ANTLR syntax symbols like :, |, (, ), ...."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-syntax-face 'face-alias 'antlr-syntax)
-(put 'antlr-font-lock-syntax-face 'obsolete-face "22.1")
-
-(defvar antlr-ruledef-face 'antlr-ruledef)
-(defface antlr-ruledef
-  (cond-emacs-xemacs
-   '((((class color) (background light))
-      (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
-     (t :inherit font-lock-function-name-face)))
-  "ANTLR rule references (definition)."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-ruledef-face 'face-alias 'antlr-ruledef)
-(put 'antlr-font-lock-ruledef-face 'obsolete-face "22.1")
-
-(defvar antlr-tokendef-face 'antlr-tokendef)
-(defface antlr-tokendef
-  (cond-emacs-xemacs
-   '((((class color) (background light))
-      (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
-     (t :inherit font-lock-function-name-face)))
-  "ANTLR token references (definition)."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-tokendef-face 'face-alias 'antlr-tokendef)
-(put 'antlr-font-lock-tokendef-face 'obsolete-face "22.1")
-
-(defvar antlr-ruleref-face 'antlr-ruleref)
-(defface antlr-ruleref
-  '((((class color) (background light)) (:foreground "blue4"))
-    (t :inherit font-lock-type-face))
-  "ANTLR rule references (usage)."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-ruleref-face 'face-alias 'antlr-ruleref)
-(put 'antlr-font-lock-ruleref-face 'obsolete-face "22.1")
-
-(defvar antlr-tokenref-face 'antlr-tokenref)
-(defface antlr-tokenref
-  '((((class color) (background light)) (:foreground "orange4"))
-    (t :inherit font-lock-type-face))
-  "ANTLR token references (usage)."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-tokenref-face 'face-alias 'antlr-tokenref)
-(put 'antlr-font-lock-tokenref-face 'obsolete-face "22.1")
-
-(defvar antlr-literal-face 'antlr-literal)
-(defface antlr-literal
-  (cond-emacs-xemacs
-   '((((class color) (background light))
-      (:foreground "brown4" :EMACS :weight bold :XEMACS :bold t))
-     (t :inherit font-lock-string-face)))
-  "ANTLR special literal tokens.
-It is used to highlight strings matched by the first regexp group of
-`antlr-font-lock-literal-regexp'."
-  :group 'antlr)
-;; backward-compatibility alias
-(put 'antlr-font-lock-literal-face 'face-alias 'antlr-literal)
-(put 'antlr-font-lock-literal-face 'obsolete-face "22.1")
-
-(defcustom antlr-font-lock-literal-regexp "\"\\(\\sw\\(\\sw\\|-\\)*\\)\""
-  "Regexp matching literals with special syntax highlighting, or nil.
-If nil, there is no special syntax highlighting for some literals.
-Otherwise, it should be a regular expression which must contain a regexp
-group.  The string matched by the first group is highlighted with
-`antlr-font-lock-literal-face'."
-  :group 'antlr
-  :type '(choice (const :tag "None" nil) regexp))
-
-(defvar antlr-class-header-regexp
-  "\\(class\\)[ \t]+\\([A-Za-z\300-\326\330-\337]\\sw*\\)[ \t]+\\(extends\\)[ \t]+\\([A-Za-z\300-\326\330-\337]\\sw*\\)[ \t]*;"
-  "Regexp matching class headers.")
-
-(defvar antlr-font-lock-additional-keywords
-  (cond-emacs-xemacs
-   `((antlr-invalidate-context-cache)
-     ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))"
-      (1 antlr-tokendef-face))
-     ("\\$\\sw+" (0 antlr-keyword-face))
-     ;; the tokens are already fontified as string/docstrings:
-     (,(lambda (limit)
-        (if antlr-font-lock-literal-regexp
-            (antlr-re-search-forward antlr-font-lock-literal-regexp limit)))
-      (1 antlr-literal-face t)
-      :XEMACS (0 nil))                 ; XEmacs bug workaround
-     (,(lambda (limit)
-        (antlr-re-search-forward antlr-class-header-regexp limit))
-      (1 antlr-keyword-face)
-      (2 antlr-ruledef-face)
-      (3 antlr-keyword-face)
-      (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser"))
-            antlr-keyword-face
-          font-lock-type-face)))
-     (,(lambda (limit)
-        (antlr-re-search-forward
-         "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>"
-         limit))
-     (1 antlr-keyword-face))
-     (,(lambda (limit)
-        (antlr-re-search-forward
-         "^\\(private\\|public\\|protected\\)\\>[ \t]*\\(\\(\\sw+[ \t]*\\(:\\)?\\)\\)?"
-         limit))
-     (1 font-lock-type-face)           ; not XEmacs's java level-3 fruit salad
-     (3 (if (antlr-upcase-p (char-after (match-beginning 3)))
-           antlr-tokendef-face
-         antlr-ruledef-face) nil t)
-     (4 antlr-syntax-face nil t))
-     (,(lambda (limit)
-        (antlr-re-search-forward "^\\(\\sw+\\)[ \t]*\\(:\\)?" limit))
-     (1 (if (antlr-upcase-p (char-after (match-beginning 0)))
-           antlr-tokendef-face
-         antlr-ruledef-face) nil t)
-     (2 antlr-syntax-face nil t))
-     (,(lambda (limit)
-        ;; v:ruleref and v:"literal" is allowed...
-        (antlr-re-search-forward "\\(\\sw+\\)[ \t]*\\([=:]\\)?" limit))
-     (1 (if (match-beginning 2)
-           (if (eq (char-after (match-beginning 2)) ?=)
-               antlr-default-face
-             font-lock-variable-name-face)
-         (if (antlr-upcase-p (char-after (match-beginning 1)))
-             antlr-tokenref-face
-           antlr-ruleref-face)))
-     (2 antlr-default-face nil t))
-     (,(lambda (limit)
-        (antlr-re-search-forward "[|&:;(~]\\|)\\([*+?]\\|=>\\)?" limit))
-     (0 antlr-syntax-face))))
-  "Font-lock keywords for ANTLR's normal grammar code.
-See `antlr-font-lock-keywords-alist' for the keywords of actions.")
-
-(defvar antlr-font-lock-defaults
-  '(antlr-font-lock-keywords
-    nil nil ((?_ . "w") (?\( . ".") (?\) . ".")) beginning-of-defun)
-  "Font-lock defaults used for ANTLR syntax highlighting.
-The SYNTAX-ALIST element is also used to initialize
-`antlr-action-syntax-table'.")
-
-
-;;;===========================================================================
-;;;  Internal variables
-;;;===========================================================================
-
-(defvar antlr-mode-hook nil
-  "Hook called by `antlr-mode'.")
-
-(defvar antlr-mode-syntax-table
-  (let ((st (make-syntax-table)))
-    (c-populate-syntax-table st)
-    st)
-  "Syntax table used in `antlr-mode' buffers.
-If non-nil, it will be initialized in `antlr-mode'.")
-
-;; used for "in Java/C++ code" = syntactic-depth>0
-(defvar antlr-action-syntax-table
-  (let ((st (copy-syntax-table antlr-mode-syntax-table))
-        (slist (nth 3 antlr-font-lock-defaults)))
-    (while slist
-      (modify-syntax-entry (caar slist) (cdar slist) st)
-      (setq slist (cdr slist)))
-    st)
-  "Syntax table used for ANTLR action parsing.
-Initialized by `antlr-mode-syntax-table', changed by SYNTAX-ALIST in
-`antlr-font-lock-defaults'.  This table should be selected if you use
-`buffer-syntactic-context' and `buffer-syntactic-context-depth' in order
-not to confuse their context_cache.")
-
-(defvar antlr-mode-abbrev-table nil
-  "Abbreviation table used in `antlr-mode' buffers.")
-(define-abbrev-table 'antlr-mode-abbrev-table ())
-
-(defvar antlr-slow-cache-enabling-symbol 'loudly
-;; Emacs's font-lock changes buffer's tick counter, therefore this value should
-;; be a parameter of a font-lock function, but not any other variable of
-;; functions which call `antlr-slow-syntactic-context'.
-  "If value is a bound symbol, cache will be used even with text changes.
-This is no user option.  Used for `antlr-slow-syntactic-context'.")
-
-(defvar antlr-slow-cache-diff-threshold 5000
-  "Maximum distance between `point' and cache position for cache use.
-Used for `antlr-slow-syntactic-context'.")
-
-
-;;;;##########################################################################
-;;;;  The Code
-;;;;##########################################################################
-
-
-
-;;;===========================================================================
-;;;  Syntax functions -- Emacs vs XEmacs dependent, part 1
-;;;===========================================================================
-
-;; From help.el (XEmacs-21.1), without `copy-syntax-table'
-(defmacro antlr-with-syntax-table (syntab &rest body)
-  "Evaluate BODY with the syntax table SYNTAB."
-  `(let ((stab (syntax-table)))
-     (unwind-protect
-        (progn (set-syntax-table ,syntab) ,@body)
-       (set-syntax-table stab))))
-(put 'antlr-with-syntax-table 'lisp-indent-function 1)
-(put 'antlr-with-syntax-table 'edebug-form-spec '(form body))
-
-(defunx antlr-default-directory ()
-  :xemacs-and-try default-directory
-  "Return `default-directory'."
-  default-directory)
-
-;; Check Emacs-21.1 simple.el, `shell-command'.
-(defunx antlr-read-shell-command (prompt &optional initial-input history)
-  :xemacs-and-try read-shell-command
-  "Read a string from the minibuffer, using `shell-command-history'."
-  (read-from-minibuffer prompt initial-input nil nil
-                       (or history 'shell-command-history)))
-
-(defunx antlr-with-displaying-help-buffer (thunk &optional _name)
-  :xemacs-and-try with-displaying-help-buffer
-  "Make a help buffer and call `thunk' there."
-  (with-output-to-temp-buffer "*Help*"
-    (save-excursion (funcall thunk))))
-
-
-;;;===========================================================================
-;;;  Context cache
-;;;===========================================================================
-
-(defvar antlr-slow-context-cache nil "Internal.")
-
-;;;(defvar antlr-statistics-full-neg 0)
-;;;(defvar antlr-statistics-full-diff 0)
-;;;(defvar antlr-statistics-full-other 0)
-;;;(defvar antlr-statistics-cache 0)
-;;;(defvar antlr-statistics-inval 0)
-
-(defunx antlr-invalidate-context-cache (&rest _dummies)
-;; checkdoc-params: (dummies)
-  "Invalidate context cache for syntactical context information."
-  :XEMACS                              ; XEmacs bug workaround
-  (with-current-buffer (get-buffer-create " ANTLR XEmacs bug workaround")
-    (buffer-syntactic-context-depth)
-    nil)
-  :EMACS
-;;;  (incf antlr-statistics-inval)
-  (setq antlr-slow-context-cache nil))
-
-(defunx antlr-syntactic-context ()
-  "Return some syntactic context information.
-Return `string' if point is within a string, `block-comment' or
-`comment' is point is within a comment or the depth within all
-parenthesis-syntax delimiters at point otherwise.
-WARNING: this may alter `match-data'."
-  :XEMACS
-  (or (buffer-syntactic-context) (buffer-syntactic-context-depth))
-  :EMACS
-  (let ((orig (point)) diff state
-       ;; Arg, Emacs's (buffer-modified-tick) changes with font-lock.  Use
-       ;; hack that `loudly' is bound during font-locking => cache use will
-       ;; increase from 7% to 99.99% during font-locking.
-       (tick (or (boundp antlr-slow-cache-enabling-symbol)
-                 (buffer-modified-tick))))
-    (if (and (cdr antlr-slow-context-cache)
-            (>= (setq diff (- orig (cadr antlr-slow-context-cache))) 0)
-            (< diff antlr-slow-cache-diff-threshold)
-            (eq (current-buffer) (caar antlr-slow-context-cache))
-            (eq tick (cdar antlr-slow-context-cache)))
-       ;; (setq antlr-statistics-cache (1+ antlr-statistics-cache) ...)
-       (setq state (parse-partial-sexp (cadr antlr-slow-context-cache) orig
-                                       nil nil
-                                       (cddr antlr-slow-context-cache)))
-      (if (>= orig antlr-slow-cache-diff-threshold)
-         (beginning-of-defun)
-       (goto-char (point-min)))
-;;;      (cond ((and diff (< diff 0)) (incf antlr-statistics-full-neg))
-;;;        ((and diff (>= diff 3000)) (incf antlr-statistics-full-diff))
-;;;        (t (incf antlr-statistics-full-other)))
-      (setq state (parse-partial-sexp (point) orig)))
-    (goto-char orig)
-    (if antlr-slow-context-cache
-       (setcdr antlr-slow-context-cache (cons orig state))
-      (setq antlr-slow-context-cache
-           (cons (cons (current-buffer) tick)
-                 (cons orig state))))
-    (cond ((nth 3 state) 'string)
-         ((nth 4 state) 'comment)      ; block-comment? -- we don't care
-         (t (car state)))))
-
-;;;  (incf (aref antlr-statistics 2))
-;;;  (unless (and (eq (current-buffer)
-;;;               (caar antlr-slow-context-cache))
-;;;           (eq (buffer-modified-tick)
-;;;               (cdar antlr-slow-context-cache)))
-;;;    (incf (aref antlr-statistics 1))
-;;;    (setq antlr-slow-context-cache nil))
-;;;  (let* ((orig (point))
-;;;     (base (cadr antlr-slow-context-cache))
-;;;     (curr (cddr antlr-slow-context-cache))
-;;;     (state (cond ((eq orig (car curr)) (cdr curr))
-;;;                  ((eq orig (car base)) (cdr base))))
-;;;     diff diff2)
-;;;    (unless state
-;;;      (incf (aref antlr-statistics 3))
-;;;      (when curr
-;;;    (if (< (setq diff  (abs (- orig (car curr))))
-;;;           (setq diff2 (abs (- orig (car base)))))
-;;;        (setq state curr)
-;;;      (setq state base
-;;;            diff  diff2))
-;;;    (if (or (>= (1+ diff) (point)) (>= diff 3000))
-;;;        (setq state nil)))          ; start from bod/bob
-;;;      (if state
-;;;      (setq state
-;;;            (parse-partial-sexp (car state) orig nil nil (cdr state)))
-;;;    (if (>= orig 3000) (beginning-of-defun) (goto-char (point-min)))
-;;;    (incf (aref antlr-statistics 4))
-;;;    (setq cw (list orig (point) base curr))
-;;;    (setq state (parse-partial-sexp (point) orig)))
-;;;      (goto-char orig)
-;;;      (if antlr-slow-context-cache
-;;;      (setcdr (cdr antlr-slow-context-cache) (cons orig state))
-;;;    (setq antlr-slow-context-cache
-;;;          (cons (cons (current-buffer) (buffer-modified-tick))
-;;;                (cons (cons orig state) (cons orig state))))))
-;;;    (cond ((nth 3 state) 'string)
-;;;      ((nth 4 state) 'comment)      ; block-comment? -- we don't care
-;;;      (t (car state)))))
-
-;;;    (beginning-of-defun)
-;;;    (let ((state (parse-partial-sexp (point) orig)))
-;;;      (goto-char orig)
-;;;      (cond ((nth 3 state) 'string)
-;;;        ((nth 4 state) 'comment)    ; block-comment? -- we don't care
-;;;        (t (car state))))))
-
-
-;;;===========================================================================
-;;;  Miscellaneous functions
-;;;===========================================================================
-
-(defun antlr-upcase-p (char)
-  "Non-nil, if CHAR is an uppercase character (if CHAR was a char)."
-  ;; in XEmacs, upcase only works for ASCII
-  (or (and (<= ?A char) (<= char ?Z))
-      (and (<= ?\300 char) (<= char ?\337)))) ; ?\327 is no letter
-
-(defun antlr-re-search-forward (regexp bound)
-  "Search forward from point for regular expression REGEXP.
-Set point to the end of the occurrence found, and return point.  Return
-nil if no occurrence was found.  Do not search within comments, strings
-and actions/semantic predicates.  BOUND bounds the search; it is a
-buffer position.  See also the functions `match-beginning', `match-end'
-and `replace-match'."
-  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
-  (let ((continue t))
-    (while (and (re-search-forward regexp bound 'limit)
-               (save-match-data
-                 (if (eq (antlr-syntactic-context) 0)
-                     (setq continue nil)
-                   t))))
-    (if continue nil (point))))
-
-(defun antlr-search-forward (string)
-  "Search forward from point for STRING.
-Set point to the end of the occurrence found, and return point.  Return
-nil if no occurrence was found.  Do not search within comments, strings
-and actions/semantic predicates."
-  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
-  (let ((continue t))
-    (while (and (search-forward string nil 'limit)
-               (if (eq (antlr-syntactic-context) 0) (setq continue nil) t)))
-    (if continue nil (point))))
-
-(defun antlr-search-backward (string)
-  "Search backward from point for STRING.
-Set point to the beginning of the occurrence found, and return point.
-Return nil if no occurrence was found.  Do not search within comments,
-strings and actions/semantic predicates."
-  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
-  (let ((continue t))
-    (while (and (search-backward string nil 'limit)
-               (if (eq (antlr-syntactic-context) 0) (setq continue nil) t)))
-    (if continue nil (point))))
-
-(defsubst antlr-skip-sexps (count)
-  "Skip the next COUNT balanced expressions and the comments after it.
-Return position before the comments after the last expression."
-  (goto-char (or (ignore-errors-x (scan-sexps (point) count)) (point-max)))
-  (prog1 (point)
-    (antlr-c-forward-sws)))
-
-
-;;;===========================================================================
-;;;  font-lock
-;;;===========================================================================
-
-(defun antlr-font-lock-keywords ()
-  "Return font-lock keywords for current buffer.
-See `antlr-font-lock-additional-keywords', `antlr-language' and
-`antlr-font-lock-maximum-decoration'."
-  (if (eq antlr-font-lock-maximum-decoration 'none)
-      antlr-font-lock-additional-keywords
-    (append antlr-font-lock-additional-keywords
-           (eval (let ((major-mode antlr-language)) ; dynamic
-                       (font-lock-choose-keywords
-                        (cdr (assq antlr-language
-                                   antlr-font-lock-keywords-alist))
-                        (if (eq antlr-font-lock-maximum-decoration 'inherit)
-                            font-lock-maximum-decoration
-                          antlr-font-lock-maximum-decoration)))))))
-
-
-;;;===========================================================================
-;;;  imenu support
-;;;===========================================================================
-
-(defun antlr-grammar-tokens ()
-  "Return alist for tokens defined in current buffer."
-  (save-excursion (antlr-imenu-create-index-function t)))
-
-(defun antlr-imenu-create-index-function (&optional tokenrefs-only)
-  "Return imenu index-alist for ANTLR grammar files.
-IF TOKENREFS-ONLY is non-nil, just return alist with tokenref names."
-  (let ((items nil)
-       (classes nil)
-       (continue t))
-    ;; Using `imenu-progress-message' would require imenu for compilation, but
-    ;; nobody is missing these messages.  The generic imenu function searches
-    ;; backward, which is slower and more likely not to work during editing.
-    (antlr-with-syntax-table antlr-action-syntax-table
-      (antlr-invalidate-context-cache)
-      (goto-char (point-min))
-      (antlr-skip-file-prelude t)
-      (while continue
-       (if (looking-at "{") (antlr-skip-sexps 1))
-       (if (looking-at antlr-class-header-regexp)
-           (or tokenrefs-only
-               (push (cons (match-string 2)
-                           (if imenu-use-markers
-                               (copy-marker (match-beginning 2))
-                             (match-beginning 2)))
-                     classes))
-         (if (looking-at "p\\(ublic\\|rotected\\|rivate\\)")
-             (antlr-skip-sexps 1))
-         (when (looking-at "\\sw+")
-           (if tokenrefs-only
-               (if (antlr-upcase-p (char-after (point)))
-                   (push (list (match-string 0)) items))
-             (push (cons (match-string 0)
-                         (if imenu-use-markers
-                             (copy-marker (match-beginning 0))
-                           (match-beginning 0)))
-                   items))))
-       (if (setq continue (antlr-search-forward ";"))
-           (antlr-skip-exception-part t))))
-    (if classes
-       (cons (cons "Classes" (nreverse classes)) (nreverse items))
-      (nreverse items))))
-
-
-;;;===========================================================================
-;;;  Parse grammar files (internal functions)
-;;;===========================================================================
-
-(defun antlr-skip-exception-part (skip-comment)
-  "Skip exception part of current rule, i.e., everything after `;'.
-This also includes the options and tokens part of a grammar class
-header.  If SKIP-COMMENT is non-nil, also skip the comment after that
-part."
-  (let ((pos (point))
-       (class nil))
-    (antlr-c-forward-sws)
-    (while (looking-at "options\\>\\|tokens\\>")
-      (setq class t)
-      (setq pos (antlr-skip-sexps 2)))
-    (if class
-       ;; Problem: an action only belongs to a class def, not a normal rule.
-       ;; But checking the current rule type is too expensive => only expect
-       ;; an action if we have found an option or tokens part.
-       (if (looking-at "{") (setq pos (antlr-skip-sexps 1)))
-      (while (looking-at "exception\\>")
-       (setq pos (antlr-skip-sexps 1))
-       (when (looking-at "\\[")
-         (setq pos (antlr-skip-sexps 1)))
-       (while (looking-at "catch\\>")
-         (setq pos (antlr-skip-sexps 3)))))
-    (or skip-comment (goto-char pos))))
-
-(defun antlr-skip-file-prelude (skip-comment)
-  "Skip the file prelude: the header and file options.
-If SKIP-COMMENT is non-nil, also skip the comment after that part.
-Return the start position of the file prelude.
-
-Hack: if SKIP-COMMENT is `header-only' only skip header and return
-position before the comment after the header."
-  (let* ((pos (point))
-        (pos0 pos))
-    (antlr-c-forward-sws)
-    (if skip-comment (setq pos0 (point)))
-    (while (looking-at "header\\>[ \t]*\\(\"\\)?")
-      (setq pos (antlr-skip-sexps (if (match-beginning 1) 3 2))))
-    (if (eq skip-comment 'header-only) ; a hack...
-       pos
-      (when (looking-at "options\\>")
-       (setq pos (antlr-skip-sexps 2)))
-      (or skip-comment (goto-char pos))
-      pos0)))
-
-(defun antlr-next-rule (arg skip-comment)
-  "Move forward to next end of rule.  Do it ARG many times.
-A grammar class header and the file prelude are also considered as a
-rule.  Negative argument ARG means move back to ARGth preceding end of
-rule.  The behavior is not defined when ARG is zero.  If SKIP-COMMENT
-is non-nil, move to beginning of the rule."
-  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
-  ;; PRE: ARG<>0
-  (let ((pos (point))
-       (beg (point)))
-    ;; first look whether point is in exception part
-    (if (antlr-search-backward ";")
-       (progn
-         (setq beg (point))
-         (forward-char)
-         (antlr-skip-exception-part skip-comment))
-      (antlr-skip-file-prelude skip-comment))
-    (if (< arg 0)
-       (unless (and (< (point) pos) (zerop (incf arg)))
-         ;; if we have moved backward, we already moved one defun backward
-         (goto-char beg)               ; rewind (to ";" / point)
-         (while (and arg (<= (incf arg) 0))
-           (if (antlr-search-backward ";")
-               (setq beg (point))
-             (when (>= arg -1)
-               ;; try file prelude:
-               (setq pos (antlr-skip-file-prelude skip-comment))
-               (if (zerop arg)
-                   (if (>= (point) beg)
-                       (goto-char (if (>= pos beg) (point-min) pos)))
-                 (goto-char (if (or (>= (point) beg) (= (point) pos))
-                                (point-min) pos))))
-             (setq arg nil)))
-         (when arg                     ; always found a ";"
-           (forward-char)
-           (antlr-skip-exception-part skip-comment)))
-      (if (<= (point) pos)             ; moved backward?
-         (goto-char pos)               ; rewind
-       (decf arg))                     ; already moved one defun forward
-      (unless (zerop arg)
-       (while (>= (decf arg) 0)
-         (antlr-search-forward ";"))
-       (antlr-skip-exception-part skip-comment)))))
-
-(defun antlr-outside-rule-p ()
-  "Non-nil if point is outside a grammar rule.
-Move to the beginning of the current rule if point is inside a rule."
-  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
-  (let ((pos (point)))
-    (antlr-next-rule -1 nil)
-    (let ((between (or (bobp) (< (point) pos))))
-      (antlr-c-forward-sws)
-      (and between (> (point) pos) (goto-char pos)))))
-
-
-;;;===========================================================================
-;;;  Parse grammar files (commands)
-;;;===========================================================================
-;; No (interactive "_") in Emacs... use `zmacs-region-stays'.
-
-(defun antlr-inside-rule-p ()
-  "Non-nil if point is inside a grammar rule.
-A grammar class header and the file prelude are also considered as a
-rule."
-  (save-excursion
-    (antlr-with-syntax-table antlr-action-syntax-table
-      (not (antlr-outside-rule-p)))))
-
-(defunx antlr-end-of-rule (&optional arg)
-  "Move forward to next end of rule.  Do it ARG [default: 1] many times.
-A grammar class header and the file prelude are also considered as a
-rule.  Negative argument ARG means move back to ARGth preceding end of
-rule.  If ARG is zero, run `antlr-end-of-body'."
-  (interactive "_p")
-  (if (zerop arg)
-      (antlr-end-of-body)
-    (antlr-with-syntax-table antlr-action-syntax-table
-      (antlr-next-rule arg nil))))
-
-(defunx antlr-beginning-of-rule (&optional arg)
-  "Move backward to preceding beginning of rule.  Do it ARG many times.
-A grammar class header and the file prelude are also considered as a
-rule.  Negative argument ARG means move forward to ARGth next beginning
-of rule.  If ARG is zero, run `antlr-beginning-of-body'."
-  (interactive "_p")
-  (if (zerop arg)
-      (antlr-beginning-of-body)
-    (antlr-with-syntax-table antlr-action-syntax-table
-      (antlr-next-rule (- arg) t))))
-
-(defunx antlr-end-of-body (&optional msg)
-  "Move to position after the `;' of the current rule.
-A grammar class header is also considered as a rule.  With optional
-prefix arg MSG, move to `:'."
-  (interactive "_")
-  (antlr-with-syntax-table antlr-action-syntax-table
-    (let ((orig (point)))
-      (if (antlr-outside-rule-p)
-         (error "Outside an ANTLR rule"))
-      (let ((bor (point)))
-       (when (< (antlr-skip-file-prelude t) (point))
-         ;; Yes, we are in the file prelude
-         (goto-char orig)
-         (error (or msg "The file prelude is without `;'")))
-       (antlr-search-forward ";")
-       (when msg
-         (when (< (point)
-                  (progn (goto-char bor)
-                         (or (antlr-search-forward ":") (point-max))))
-           (goto-char orig)
-           (error msg))
-         (antlr-c-forward-sws))))))
-
-(defunx antlr-beginning-of-body ()
-  "Move to the first element after the `:' of the current rule."
-  (interactive "_")
-  (antlr-end-of-body "Class headers and the file prelude are without `:'"))
-
-
-;;;===========================================================================
-;;;  Literal normalization, Hide Actions
-;;;===========================================================================
-
-(defun antlr-downcase-literals (&optional transform)
-  "Convert all literals in buffer to lower case.
-If non-nil, TRANSFORM is used on literals instead of `downcase-region'."
-  (interactive)
-  (or transform (setq transform 'downcase-region))
-  (let ((literals 0))
-    (save-excursion
-      (goto-char (point-min))
-      (antlr-with-syntax-table antlr-action-syntax-table
-       (antlr-invalidate-context-cache)
-       (while (antlr-re-search-forward "\"\\(\\sw\\(\\sw\\|-\\)*\\)\"" nil)
-         (funcall transform (match-beginning 0) (match-end 0))
-         (incf literals))))
-    (message "Transformed %d literals" literals)))
-
-(defun antlr-upcase-literals ()
-  "Convert all literals in buffer to upper case."
-  (interactive)
-  (antlr-downcase-literals 'upcase-region))
-
-(defun antlr-hide-actions (arg &optional silent)
-  "Hide or unhide all actions in buffer.
-Hide all actions including arguments in brackets if ARG is 1 or if
-called interactively without prefix argument.  Hide all actions
-excluding arguments in brackets if ARG is 2 or higher.  Unhide all
-actions if ARG is 0 or negative.  See `antlr-action-visibility'.
-
-Display a message unless optional argument SILENT is non-nil."
-  (interactive "p")
-  (save-buffer-state-x
-    (if (> arg 0)
-       (let ((regexp (if (= arg 1) "[]}]" "}"))
-             (diff (and antlr-action-visibility
-                        (+ (max antlr-action-visibility 0) 2))))
-         (antlr-hide-actions 0 t)
-         (save-excursion
-           (goto-char (point-min))
-           (antlr-with-syntax-table antlr-action-syntax-table
-             (antlr-invalidate-context-cache)
-             (while (antlr-re-search-forward regexp nil)
-               (let ((beg (ignore-errors-x (scan-sexps (point) -1))))
-                 (when beg
-                   (if diff            ; braces are visible
-                       (if (> (point) (+ beg diff))
-                           (add-text-properties (1+ beg) (1- (point))
-                                                '(invisible t intangible t)))
-                     ;; if actions is on line(s) of its own, hide WS
-                     (and (looking-at "[ \t]*$")
-                          (save-excursion
-                            (goto-char beg)
-                            (skip-chars-backward " \t")
-                            (and (bolp) (setq beg (point))))
-                          (beginning-of-line 2)) ; beginning of next line
-                     (add-text-properties beg (point)
-                                          '(invisible t intangible t))))))))
-         (or silent
-             (message "Hide all actions (%s arguments)...done"
-                      (if (= arg 1) "including" "excluding"))))
-      (remove-text-properties (point-min) (point-max)
-                             '(invisible nil intangible nil))
-      (or silent
-         (message "Unhide all actions (including arguments)...done")))))
-
-
-;;;===========================================================================
-;;;  Insert option: command
-;;;===========================================================================
-
-(defun antlr-insert-option (level option &optional location)
-  "Insert file/grammar/rule/subrule option near point.
-LEVEL determines option kind to insert: 1=file, 2=grammar, 3=rule,
-4=subrule.  OPTION is a string with the name of the option to insert.
-LOCATION can be specified for not calling `antlr-option-kind' twice.
-
-Inserting an option with this command works as follows:
-
- 1. When called interactively, LEVEL is determined by the prefix
-    argument or automatically deduced without prefix argument.
- 2. Signal an error if no option of that level could be inserted, e.g.,
-    if the buffer is read-only, the option area is outside the visible
-    part of the buffer or a subrule/rule option should be inserted with
-    point outside a subrule/rule.
- 3. When called interactively, OPTION is read from the minibuffer with
-    completion over the known options of the given LEVEL.
- 4. Ask user for confirmation if the given OPTION does not seem to be a
-    valid option to insert into the current file.
- 5. Find a correct position to insert the option.
- 6. Depending on the option, insert it the following way \(inserting an
-    option also means inserting the option section if necessary\):
-     - Insert the option and let user insert the value at point.
-     - Read a value (with completion) from the minibuffer, using a
-       previous value as initial contents, and insert option with value.
- 7. Final action depending on the option.  For example, set the language
-    according to a newly inserted language option.
-
-The name of all options with a specification for their values are stored
-in `antlr-options-alists'.  The used specification also depends on the
-value of `antlr-tool-version', i.e., step 4 will warn you if you use an
-option that has been introduced in newer version of ANTLR, and step 5
-will offer completion using version-correct values.
-
-If the option already exists inside the visible part of the buffer, this
-command can be used to change the value of that option.  Otherwise, find
-a correct position where the option can be inserted near point.
-
-The search for a correct position is as follows:
-
-  * If search is within an area where options can be inserted, use the
-    position of point.  Inside the options section and if point is in
-    the middle of a option definition, skip the rest of it.
-  * If an options section already exists, insert the options at the end.
-    If only the beginning of the area is visible, insert at the
-    beginning.
-  * Otherwise, find the position where an options section can be
-    inserted and insert a new section before any comments.  If the
-    position before the comments is not visible, insert the new section
-    after the comments.
-
-This function also inserts \"options {...}\" and the \":\" if necessary,
-see `antlr-options-auto-colon'.  See also `antlr-options-assign-string'.
-
-This command might also set the mark like \\[set-mark-command] does, see
-`antlr-options-push-mark'."
-  (interactive (antlr-insert-option-interactive current-prefix-arg))
-  (barf-if-buffer-read-only)
-  (or location (setq location (cdr (antlr-option-kind level))))
-  (cond ((null level)
-        (error "Cannot deduce what kind of option to insert"))
-       ((atom location)
-        (error "Cannot insert any %s options around here"
-               (elt antlr-options-headings (1- level)))))
-  (let ((area (car location))
-       (place (cdr location)))
-    (cond ((null place)                ; invisible
-          (error (if area
-                     "Invisible %s options, use %s to make them visible"
-                   "Invisible area for %s options, use %s to make it visible")
-                 (elt antlr-options-headings (1- level))
-                 (substitute-command-keys "\\[widen]")))
-         ((null area)                  ; without option part
-          (antlr-insert-option-do level option nil
-                                  (null (cdr place))
-                                  (car place)))
-         ((save-excursion              ; with option part, option visible
-            (goto-char (max (point-min) (car area)))
-            (re-search-forward (concat "\\(^\\|;\\)[ \t]*\\(\\<"
-                                       (regexp-quote option)
-                                       "\\>\\)[ \t\n]*\\(\\(=[ \t]?\\)[ \t]*\\(\\(\\sw\\|\\s_\\)+\\|\"\\([^\n\"\\]\\|[\\][^\n]\\)*\"\\)?\\)?")
-                               ;; 2=name, 3=4+5, 4="=", 5=value
-                               (min (point-max) (cdr area))
-                               t))
-          (antlr-insert-option-do level option
-                                  (cons (or (match-beginning 5)
-                                            (match-beginning 3))
-                                        (match-end 5))
-                                  (and (null (cdr place)) area)
-                                  (or (match-beginning 5)
-                                      (match-end 4)
-                                      (match-end 2))))
-         (t                            ; with option part, option not yet
-          (antlr-insert-option-do level option t
-                                  (and (null (cdr place)) area)
-                                  (car place))))))
-
-(defun antlr-insert-option-interactive (arg)
-  "Interactive specification for `antlr-insert-option'.
-Return \(LEVEL OPTION LOCATION)."
-  (barf-if-buffer-read-only)
-  (if arg (setq arg (prefix-numeric-value arg)))
-  (unless (memq arg '(nil 1 2 3 4))
-    (error "Valid prefix args: no=auto, 1=file, 2=grammar, 3=rule, 4=subrule"))
-  (let* ((kind (antlr-option-kind arg))
-        (level (car kind)))
-    (if (atom (cdr kind))
-       (list level nil (cdr kind))
-      (let* ((table (elt antlr-options-alists (1- level)))
-            (completion-ignore-case t) ;dynamic
-            (input (completing-read (format "Insert %s option: "
-                                            (elt antlr-options-headings
-                                                 (1- level)))
-                                    table)))
-       (list level input (cdr kind))))))
-
-(defun antlr-options-menu-filter (level _menu-items)
-  "Return items for options submenu of level LEVEL."
-  ;; checkdoc-params: (menu-items)
-  (let ((active (if buffer-read-only
-                   nil
-                 (consp (cdr-safe (cdr (antlr-option-kind level)))))))
-    (mapcar (lambda (option)
-             (vector option
-                     (list 'antlr-insert-option level option)
-                     :active active))
-           (sort (mapcar 'car (elt antlr-options-alists (1- level)))
-                 'string-lessp))))
-
-
-;;;===========================================================================
-;;;  Insert option: determine section-kind
-;;;===========================================================================
-
-(defun antlr-option-kind (requested)
-  "Return level and location for option to insert near point.
-Call function `antlr-option-level' with argument REQUESTED.  If the
-result is nil, return \(REQUESTED \. error).  If the result has the
-non-nil value LEVEL, return \(LEVEL \. LOCATION) where LOCATION looks
-like \(AREA \. PLACE), see `antlr-option-location'."
-  (save-excursion
-    (save-restriction
-      (let ((min0 (point-min))         ; before `widen'!
-           (max0 (point-max))
-           (orig (point))
-           (level (antlr-option-level requested)) ; calls `widen'!
-           pos)
-       (cond ((null level)
-              (setq level requested))
-             ((eq level 1)             ; file options
-              (goto-char (point-min))
-              (setq pos (antlr-skip-file-prelude 'header-only)))
-             ((not (eq level 3))       ; grammar or subrule options
-              (setq pos (point))
-              (antlr-c-forward-sws))
-             ((looking-at "^\\(private[ \t\n]\\|public[ \t\n]\\|protected[ \t\n]\\)?[ \t\n]*\\(\\(\\sw\\|\\s_\\)+\\)[ \t\n]*\\(!\\)?[ \t\n]*\\(\\[\\)?")
-              ;; rule options, with complete rule header
-              (goto-char (or (match-end 4) (match-end 3)))
-              (setq pos (antlr-skip-sexps (if (match-end 5) 1 0)))
-              (when (looking-at "returns[ \t\n]*\\[")
-                (goto-char (1- (match-end 0)))
-                (setq pos (antlr-skip-sexps 1)))))
-       (cons level
-             (cond ((null pos) 'error)
-                   ((looking-at "options[ \t\n]*{")
-                    (goto-char (match-end 0))
-                    (setq pos (ignore-errors-x (scan-lists (point) 1 1)))
-                    (antlr-option-location orig min0 max0
-                                           (point)
-                                           (if pos (1- pos) (point-max))
-                                           t))
-                   (t
-                    (antlr-option-location orig min0 max0
-                                           pos (point)
-                                           nil))))))))
-
-(defun antlr-option-level (requested)
-  "Return level for option to insert near point.
-Remove any restrictions from current buffer and return level for the
-option to insert near point, i.e., 1, 2, 3, 4, or nil if no such option
-can be inserted.  If REQUESTED is non-nil, it is the only possible value
-to return except nil.  If REQUESTED is nil, return level for the nearest
-option kind, i.e., the highest number possible.
-
-If the result is 2, point is at the beginning of the class after the
-class definition.  If the result is 3 or 4, point is at the beginning of
-the rule/subrule after the init action.  Otherwise, the point position
-is undefined."
-  (widen)
-  (if (eq requested 1)
-      1
-    (antlr-with-syntax-table antlr-action-syntax-table
-      (antlr-invalidate-context-cache)
-      (let* ((orig (point))
-            (outsidep (antlr-outside-rule-p))
-            bor depth)
-       (if (eq (char-after) ?\{) (antlr-skip-sexps 1))
-       (setq bor (point))              ; beginning of rule (after init action)
-       (cond ((eq requested 2)         ; grammar options required?
-              (let (boc)               ; beginning of class
-                (goto-char (point-min))
-                (while (and (<= (point) bor)
-                            (antlr-re-search-forward antlr-class-header-regexp
-                                                     nil))
-                  (if (<= (match-beginning 0) bor)
-                      (setq boc (match-end 0))))
-                (when boc
-                  (goto-char boc)
-                  2)))
-             ((save-excursion          ; in region of file options?
-                (goto-char (point-min))
-                (antlr-skip-file-prelude t) ; ws/comment after: OK
-                (< orig (point)))
-              (and (null requested) 1))
-             (outsidep                 ; outside rule not OK
-              nil)
-             ((looking-at antlr-class-header-regexp) ; rule = class def?
-              (goto-char (match-end 0))
-              (and (null requested) 2))
-             ((eq requested 3)         ; rule options required?
-              (goto-char bor)
-              3)
-             ((setq depth (antlr-syntactic-grammar-depth orig bor))
-              (if (> depth 0)          ; move out of actions
-                  (goto-char (scan-lists (point) -1 depth)))
-              (set-syntax-table antlr-mode-syntax-table)
-              (antlr-invalidate-context-cache)
-              (if (eq (antlr-syntactic-context) 0) ; not in subrule?
-                  (unless (eq requested 4)
-                    (goto-char bor)
-                    3)
-                (goto-char (1+ (scan-lists (point) -1 1)))
-                4)))))))
-
-(defun antlr-option-location (orig min-vis max-vis min-area max-area withp)
-  "Return location for the options area.
-ORIG is the original position of `point', MIN-VIS is `point-min' and
-MAX-VIS is `point-max'.  If WITHP is non-nil, there exists an option
-specification and it starts after the brace at MIN-AREA and stops at
-MAX-AREA.  If WITHP is nil, there is no area and the region where it
-could be inserted starts at MIN-AREA and stops at MAX-AREA.
-
-The result has the form (AREA . PLACE).  AREA is (MIN-AREA . MAX-AREA)
-if WITHP is non-nil, and nil otherwise.  PLACE is nil if the area is
-invisible, (ORIG) if ORIG is inside the area, (MIN-AREA . beginning) for
-a visible start position and (MAX-AREA . end) for a visible end position
-where the beginning is preferred if WITHP is nil and the end if WITHP is
-non-nil."
-  (cons (and withp (cons min-area max-area))
-       (cond ((and (<= min-area orig) (<= orig max-area)
-                   (save-excursion
-                     (goto-char orig)
-                     (not (memq (antlr-syntactic-context)
-                                '(comment block-comment)))))
-              ;; point in options area and not in comment
-              (list orig))
-             ((and (null withp) (<= min-vis min-area) (<= min-area max-vis))
-              ;; use start of options area (only if not `withp')
-              (cons min-area 'beginning))
-             ((and (<= min-vis max-area) (<= max-area max-vis))
-              ;; use end of options area
-              (cons max-area 'end))
-             ((and withp (<= min-vis min-area) (<= min-area max-vis))
-              ;; use start of options area (only if `withp')
-              (cons min-area 'beginning)))))
-
-(defun antlr-syntactic-grammar-depth (pos beg)
-  "Return syntactic context depth at POS.
-Move to POS and from there on to the beginning of the string or comment
-if POS is inside such a construct.  Then, return the syntactic context
-depth at point if the point position is smaller than BEG.
-WARNING: this may alter `match-data'."
-  (goto-char pos)
-  (let ((context (or (antlr-syntactic-context) 0)))
-    (while (and context (not (integerp context)))
-      (cond ((eq context 'string)
-            (setq context
-                  (and (search-backward "\"" nil t)
-                       (>= (point) beg)
-                       (or (antlr-syntactic-context) 0))))
-           ((memq context '(comment block-comment))
-            (setq context
-                  (and (re-search-backward "/[/*]" nil t)
-                       (>= (point) beg)
-                       (or (antlr-syntactic-context) 0))))))
-    context))
-
-
-;;;===========================================================================
-;;;  Insert options: do the insertion
-;;;===========================================================================
-
-(defun antlr-insert-option-do (level option old area pos)
-  "Insert option into buffer at position POS.
-Insert option of level LEVEL and name OPTION.  If OLD is non-nil, an
-options area is already exists.  If OLD looks like \(BEG \. END), the
-option already exists.  Then, BEG is the start position of the option
-value, the position of the `=' or nil, and END is the end position of
-the option value or nil.
-
-If the original point position was outside an options area, AREA is nil.
-Otherwise, and if an option specification already exists, AREA is a cons
-cell where the two values determine the area inside the braces."
-  (let* ((spec (cdr (assoc option (elt antlr-options-alists (1- level)))))
-        (value (antlr-option-spec level option (cdr spec) (consp old))))
-    (if (fboundp (car spec)) (funcall (car spec) 'before-input option))
-    ;; set mark (unless point was inside options area before)
-    (if (cond (area (eq antlr-options-push-mark t))
-             ((numberp antlr-options-push-mark)
-              (> (count-lines (min (point) pos) (max (point) pos))
-                 antlr-options-push-mark))
-             (antlr-options-push-mark))
-       (push-mark))
-    ;; read option value -----------------------------------------------------
-    (goto-char pos)
-    (if (null value)
-       ;; no option specification found
-       (if (y-or-n-p (format "Insert unknown %s option %s? "
-                             (elt antlr-options-headings (1- level))
-                             option))
-           (message "Insert value for %s option %s"
-                    (elt antlr-options-headings (1- level))
-                    option)
-         (error "Didn't insert unknown %s option %s"
-                (elt antlr-options-headings (1- level))
-                option))
-      ;; option specification found
-      (setq value (cdr value))
-      (if (car value)
-         (let ((initial (and (consp old) (cdr old)
-                             (buffer-substring (car old) (cdr old)))))
-           (setq value (apply (car value)
-                              (and initial
-                                   (if (eq (aref initial 0) ?\")
-                                       (read initial)
-                                     initial))
-                              (cdr value))))
-       (message "%s" (or (cadr value) ""))
-       (setq value nil)))
-    ;; insert value ----------------------------------------------------------
-    (if (consp old)
-       (antlr-insert-option-existing old value)
-      (if (consp area)
-         ;; Move outside string/comment if point is inside option spec
-         (antlr-syntactic-grammar-depth (point) (car area)))
-      (antlr-insert-option-space area old)
-      (or old (antlr-insert-option-area level))
-      (insert option " = ;")
-      (backward-char)
-      (if value (insert value)))
-    ;; final -----------------------------------------------------------------
-    (if (fboundp (car spec)) (funcall (car spec) 'after-insertion option))))
-
-(defun antlr-option-spec (level option specs existsp)
-  "Return version correct option value specification.
-Return specification for option OPTION of kind level LEVEL.  SPECS
-should correspond to the VALUE-SPEC... in `antlr-option-alists'.
-EXISTSP determines whether the option already exists."
-  (let (value)
-    (while (and specs (>= antlr-tool-version (caar specs)))
-      (setq value (pop specs)))
-    (cond (value)                      ; found correct spec
-         ((null specs) nil)            ; didn't find any specs
-         (existsp (car specs)) ; wrong version, but already present
-         ((y-or-n-p (format "Insert v%s %s option %s in v%s? "
-                            (antlr-version-string (caar specs))
-                            (elt antlr-options-headings (1- level))
-                            option
-                            (antlr-version-string antlr-tool-version)))
-          (car specs))
-         (t
-          (error "Didn't insert v%s %s option %s in v%s"
-                 (antlr-version-string (caar specs))
-                 (elt antlr-options-headings (1- level))
-                 option
-                 (antlr-version-string antlr-tool-version))))))
-
-(defun antlr-version-string (version)
-  "Format the Antlr version number VERSION, see `antlr-tool-version'."
-  (let ((version100 (/ version 100)))
-    (format "%d.%d.%d"
-           (/ version100 100) (mod version100 100) (mod version 100))))
-
-
-;;;===========================================================================
-;;;  Insert options: the details (used by `antlr-insert-option-do')
-;;;===========================================================================
-
-(defun antlr-insert-option-existing (old value)
-  "Insert option value VALUE at point for existing option.
-For OLD, see `antlr-insert-option-do'."
-  ;; no = => insert =
-  (unless (car old) (insert antlr-options-assign-string))
-  ;; with user input => insert if necessary
-  (when value
-    (if (cdr old)              ; with value
-       (if (string-equal value (buffer-substring (car old) (cdr old)))
-           (goto-char (cdr old))
-         (delete-region (car old) (cdr old))
-         (insert value))
-      (insert value)))
-  (unless (looking-at "\\([^\n=;{}/'\"]\\|'\\([^\n'\\]\\|\\\\.\\)*'\\|\"\\([^\n\"\\]\\|\\\\.\\)*\"\\)*;")
-    ;; stuff (no =, {, } or /) at point is not followed by ";"
-    (insert ";")
-    (backward-char)))
-
-(defun antlr-insert-option-space (area old)
-  "Find appropriate place to insert option, insert newlines/spaces.
-For AREA and OLD, see `antlr-insert-option-do'."
-  (let ((orig (point))
-       (open t))
-    (skip-chars-backward " \t")
-    (unless (bolp)
-      (let ((before (char-after (1- (point)))))
-       (goto-char orig)
-       (and old                        ; with existing options area
-            (consp area)               ; if point inside existing area
-            (not (eq before ?\;))      ; if not at beginning of option
-                                       ; => skip to end of option
-            (if (and (search-forward ";" (cdr area) t)
-                     (let ((context (antlr-syntactic-context)))
-                       (or (null context) (numberp context))))
-                (setq orig (point))
-              (goto-char orig)))
-       (skip-chars-forward " \t")
-
-       (if (looking-at "$\\|//")
-           ;; just comment after point => skip (+ lines w/ same col comment)
-           (let ((same (if (> (match-end 0) (match-beginning 0))
-                           (current-column))))
-             (beginning-of-line 2)
-             (or (bolp) (insert "\n"))
-             (when (and same (null area)) ; or (consp area)?
-               (while (and (looking-at "[ \t]*\\(//\\)")
-                           (goto-char (match-beginning 1))
-                           (= (current-column) same))
-                 (beginning-of-line 2)
-                 (or (bolp) (insert "\n")))))
-         (goto-char orig)
-         (if (null old)
-             (progn (insert "\n") (antlr-indent-line))
-           (unless (eq (char-after (1- (point))) ?\ )
-             (insert " "))
-           (unless (eq (char-after (point)) ?\ )
-             (insert " ")
-             (backward-char))
-           (setq open nil)))))
-    (when open
-      (beginning-of-line 1)
-      (insert "\n")
-      (backward-char)
-      (antlr-indent-line))))
-
-(defun antlr-insert-option-area (level)
-  "Insert new options area for options of level LEVEL.
-Used by `antlr-insert-option-do'."
-  (insert "options {\n\n}")
-  (when (and antlr-options-auto-colon
-            (memq level '(3 4))
-            (save-excursion
-              (antlr-c-forward-sws)
-              (if (eq (char-after (point)) ?\{) (antlr-skip-sexps 1))
-              (not (eq (char-after (point)) ?\:))))
-    (insert "\n:")
-    (antlr-indent-line)
-    (end-of-line 0))
-  (backward-char 1)
-  (antlr-indent-line)
-  (beginning-of-line 0)
-  (antlr-indent-line))
-
-
-;;;===========================================================================
-;;;  Insert options: in `antlr-options-alists'
-;;;===========================================================================
-
-(defun antlr-read-value (initial-contents prompt
-                                         &optional as-string table table-x)
-  "Read a string from the minibuffer, possibly with completion.
-If INITIAL-CONTENTS is non-nil, insert it in the minibuffer initially.
-PROMPT is a string to prompt with, normally it ends in a colon and a
-space.  If AS-STRING is t or is a member \(comparison done with `eq') of
-`antlr-options-style', return printed representation of the user input,
-otherwise return the user input directly.
-
-If TABLE or TABLE-X is non-nil, read with completion.  The completion
-table is the resulting alist of TABLE-X concatenated with TABLE where
-TABLE can also be a function evaluation to an alist.
-
-Used inside `antlr-options-alists'."
-  (let* ((completion-ignore-case t)    ; dynamic
-        (table0 (and (or table table-x)
-                     (append table-x
-                             (if (functionp table) (funcall table) table))))
-        (input (if table0
-                   (completing-read prompt table0 nil nil initial-contents)
-                 (read-from-minibuffer prompt initial-contents))))
-    (if (and as-string
-            (or (eq as-string t)
-                (cdr (assq as-string antlr-options-style))))
-       (format "%S" input)
-      input)))
-
-(defun antlr-read-boolean (initial-contents prompt &optional table)
-  "Read a boolean value from the minibuffer, with completion.
-If INITIAL-CONTENTS is non-nil, insert it in the minibuffer initially.
-PROMPT is a string to prompt with, normally it ends in a question mark
-and a space.  \"(true or false) \" is appended if TABLE is nil.
-
-Read with completion over \"true\", \"false\" and the keys in TABLE, see
-also `antlr-read-value'.
-
-Used inside `antlr-options-alists'."
-  (antlr-read-value initial-contents
-                   (if table prompt (concat prompt "(true or false) "))
-                   nil
-                   table '(("false") ("true"))))
-
-(defun antlr-language-option-extra (phase &rest _dummies)
-;; checkdoc-params: (dummies)
-  "Change language according to the new value of the \"language\" option.
-Call `antlr-mode' if the new language would be different from the value
-of `antlr-language', keeping the value of variable `font-lock-mode'.
-
-Called in PHASE `after-insertion', see `antlr-options-alists'."
-  (when (eq phase 'after-insertion)
-    (let ((new-language (antlr-language-option t)))
-      (or (null new-language)
-         (eq new-language antlr-language)
-         (let ((font-lock (and (boundp 'font-lock-mode) font-lock-mode)))
-           (if font-lock (font-lock-mode 0))
-           (antlr-mode)
-           (and font-lock (null font-lock-mode) (font-lock-mode 1)))))))
-
-(defun antlr-c++-mode-extra (phase option &rest _dummies)
-;; checkdoc-params: (option dummies)
-  "Warn if C++ option is used with the wrong language.
-Ask user \(\"y or n\"), if a C++ only option is going to be inserted but
-`antlr-language' has not the value `c++-mode'.
-
-Called in PHASE `before-input', see `antlr-options-alists'."
-  (and (eq phase 'before-input)
-       (not (eq antlr-language 'c++-mode))
-       (not (y-or-n-p (format "Insert C++ %s option? " option)))
-       (error "Didn't insert C++ %s option with language %s"
-             option (cadr (assq antlr-language antlr-language-alist)))))
-
-
-;;;===========================================================================
-;;;  Compute dependencies
-;;;===========================================================================
-
-(defun antlr-file-dependencies ()
-  "Return dependencies for grammar in current buffer.
-The result looks like \(FILE \(CLASSES \. SUPERS) VOCABS \. LANGUAGE)
-  where CLASSES = ((CLASS . CLASS-EVOCAB) ...),
-        SUPERS  = ((SUPER . USE-EVOCAB-P) ...), and
-        VOCABS  = ((EVOCAB ...) . (IVOCAB ...))
-
-FILE is the current buffer's file-name without directory part and
-LANGUAGE is the value of `antlr-language' in the current buffer.  Each
-EVOCAB is an export vocabulary and each IVOCAB is an import vocabulary.
-
-Each CLASS is a grammar class with its export vocabulary CLASS-EVOCAB.
-Each SUPER is a super-grammar class where USE-EVOCAB-P indicates whether
-its export vocabulary is used as an import vocabulary."
-  (unless buffer-file-name
-    (error "Grammar buffer does not visit a file"))
-  (let (classes export-vocabs import-vocabs superclasses default-vocab)
-    (antlr-with-syntax-table antlr-action-syntax-table
-      (goto-char (point-min))
-      (while (antlr-re-search-forward antlr-class-header-regexp nil)
-       ;; parse class definition --------------------------------------------
-       (let* ((class (match-string 2))
-              (sclass (match-string 4))
-              ;; export vocab defaults to class name (first grammar in file)
-              ;; or to the export vocab of the first grammar in file:
-              (evocab (or default-vocab class))
-              (ivocab nil))
-         (goto-char (match-end 0))
-         (antlr-c-forward-sws)
-         (while (looking-at "options\\>\\|\\(tokens\\)\\>")
-           (if (match-beginning 1)
-               (antlr-skip-sexps 2)
-             (goto-char (match-end 0))
-             (antlr-c-forward-sws)
-             ;; parse grammar option sections -------------------------------
-             (when (eq (char-after (point)) ?\{)
-               (let* ((beg (1+ (point)))
-                      (end (1- (antlr-skip-sexps 1)))
-                      (cont (point)))
-               (goto-char beg)
-               (if (re-search-forward "\\<exportVocab[ \t]*=[ \t]*\\([A-Za-z\300-\326\330-\337]\\sw*\\)" end t)
-                   (setq evocab (match-string 1)))
-               (goto-char beg)
-               (if (re-search-forward "\\<importVocab[ \t]*=[ \t]*\\([A-Za-z\300-\326\330-\337]\\sw*\\)" end t)
-                   (setq ivocab (match-string 1)))
-               (goto-char cont)))))
-         (unless (member sclass '("Parser" "Lexer" "TreeParser"))
-           (let ((super (assoc sclass superclasses)))
-             (if super
-                 (or ivocab (setcdr super t))
-               (push (cons sclass (null ivocab)) superclasses))))
-         ;; remember class with export vocabulary:
-         (push (cons class evocab) classes)
-         ;; default export vocab is export vocab of first grammar in file:
-         (or default-vocab (setq default-vocab evocab))
-         (or (member evocab export-vocabs) (push evocab export-vocabs))
-         (or (null ivocab)
-             (member ivocab import-vocabs) (push ivocab import-vocabs)))))
-    (if classes
-       (list* (file-name-nondirectory buffer-file-name)
-              (cons (nreverse classes) (nreverse superclasses))
-              (cons (nreverse export-vocabs) (nreverse import-vocabs))
-              antlr-language))))
-
-(defun antlr-directory-dependencies (dirname)
-  "Return dependencies for all grammar files in directory DIRNAME.
-The result looks like \((CLASS-SPEC ...) \. \(FILE-DEP ...))
-  where CLASS-SPEC = (CLASS (FILE \. EVOCAB) ...).
-
-FILE-DEP are the dependencies for each grammar file in DIRNAME, see
-`antlr-file-dependencies'.  For each grammar class CLASS, FILE is a
-grammar file in which CLASS is defined and EVOCAB is the name of the
-export vocabulary specified in that file."
-  (let ((grammar (directory-files dirname t "\\.g\\'")))
-    (when grammar
-      (let ((antlr-imenu-name nil)             ; dynamic-let: no imenu
-           (expanded-regexp
-             (concat (format (regexp-quote
-                              (cadr antlr-special-file-formats))
-                             ".+")
-                     "\\'"))
-           classes dependencies)
-        (with-temp-buffer
-          (dolist (file grammar)
-            (when (and (file-regular-p file)
-                       (null (string-match expanded-regexp file)))
-              (insert-file-contents file t nil nil t)
-              (normal-mode t)           ; necessary for major-mode, syntax
-                                       ; table and `antlr-language'
-              (when (derived-mode-p 'antlr-mode)
-                (let* ((file-deps (antlr-file-dependencies))
-                       (file (car file-deps)))
-                  (when file-deps
-                    (dolist (class-def (caadr file-deps))
-                      (let ((file-evocab (cons file (cdr class-def)))
-                            (class-spec (assoc (car class-def) classes)))
-                        (if class-spec
-                            (nconc (cdr class-spec) (list file-evocab))
-                          (push (list (car class-def) file-evocab)
-                                classes))))
-                    (push file-deps dependencies)))))))
-       (cons (nreverse classes) (nreverse dependencies))))))
-
-
-;;;===========================================================================
-;;;  Compilation: run ANTLR tool
-;;;===========================================================================
-
-(defun antlr-superclasses-glibs (supers classes)
-  "Compute the grammar lib option for the super grammars SUPERS.
-Look in CLASSES for the right grammar lib files for SUPERS.  SUPERS is
-part SUPER in the result of `antlr-file-dependencies'.  CLASSES is the
-part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'.
-
-The result looks like \(OPTION WITH-UNKNOWN GLIB ...).  OPTION is the
-complete \"-glib\" option.  WITH-UNKNOWN is t if there is none or more
-than one grammar file for at least one super grammar.
-
-Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB).  GRAMMAR-FILE is a file
-in which a super-grammar is defined.  EVOCAB is the value of the export
-vocabulary of the super-grammar or nil if it is not needed."
-  ;; If the superclass is defined in the same file, that file will be included
-  ;; with -glib again.  This will lead to a redefinition.  But defining a
-  ;; analyzer of the same class twice in a file will lead to an error anyway...
-  (let (glibs unknown)
-    (while supers
-      (let* ((super (pop supers))
-            (sup-files (cdr (assoc (car super) classes)))
-            (file (and sup-files (null (cdr sup-files)) (car sup-files))))
-       (or file (setq unknown t))      ; not exactly one file
-       (push (cons (or (car file)
-                       (format (car antlr-unknown-file-formats)
-                               (car super)))
-                   (and (cdr super)
-                        (or (cdr file)
-                            (format (cadr antlr-unknown-file-formats)
-                                    (car super)))))
-             glibs)))
-    (cons (if glibs (concat " -glib " (mapconcat 'car glibs ";")) "")
-         (cons unknown glibs))))
-
-(defun antlr-run-tool (command file &optional saved)
-  "Run Antlr took COMMAND on grammar FILE.
-When called interactively, COMMAND is read from the minibuffer and
-defaults to `antlr-tool-command' with a computed \"-glib\" option if
-necessary.
-
-Save all buffers first unless optional value SAVED is non-nil.  When
-called interactively, the buffers are always saved, see also variable
-`antlr-ask-about-save'."
-  (interactive (antlr-run-tool-interactive))
-  (or saved (save-some-buffers (not antlr-ask-about-save)))
-  (let ((default-directory (file-name-directory file)))
-    (compilation-start (concat command " " (file-name-nondirectory file))
-                      nil (lambda (_mode-name) "*Antlr-Run*"))))
-
-(defun antlr-run-tool-interactive ()
-  ;; code in `interactive' is not compiled
-  "Interactive specification for `antlr-run-tool'.
-Use prefix argument ARG to return \(COMMAND FILE SAVED)."
-  (let* ((supers (cdadr (save-excursion
-                         (save-restriction
-                           (widen)
-                           (antlr-file-dependencies)))))
-        (glibs ""))
-    (when supers
-      (save-some-buffers (not antlr-ask-about-save) nil)
-      (setq glibs (car (antlr-superclasses-glibs
-                       supers
-                       (car (antlr-directory-dependencies
-                             (antlr-default-directory)))))))
-    (list (antlr-read-shell-command "Run Antlr on current file with: "
-                                   (concat antlr-tool-command glibs " "))
-         buffer-file-name
-         supers)))
-
-
-;;;===========================================================================
-;;;  Makefile creation
-;;;===========================================================================
-
-(defun antlr-makefile-insert-variable (number pre post)
-  "Insert Makefile variable numbered NUMBER according to specification.
-Also insert strings PRE and POST before and after the variable."
-  (let ((spec (cadr antlr-makefile-specification)))
-    (when spec
-      (insert pre
-             (if number (format (cadr spec) number) (car spec))
-             post))))
-
-(defun antlr-insert-makefile-rules (&optional in-makefile)
-  "Insert Makefile rules in the current buffer at point.
-IN-MAKEFILE is non-nil, if the current buffer is the Makefile.  See
-command `antlr-show-makefile-rules' for detail."
-  (let* ((dirname (antlr-default-directory))
-        (deps0 (antlr-directory-dependencies dirname))
-        (classes (car deps0))          ; CLASS -> (FILE . EVOCAB) ...
-        (deps (cdr deps0))             ; FILE -> (c . s) (ev . iv) . LANGUAGE
-        (with-error nil)
-        (gen-sep (or (caddr (cadr antlr-makefile-specification)) " "))
-        (n (and (cdr deps) (cadr antlr-makefile-specification) 0)))
-    (or in-makefile (set-buffer standard-output))
-    (dolist (dep deps)
-      (let ((supers (cdadr dep))
-           (lang (cdr (assoc (cdddr dep) antlr-file-formats-alist))))
-       (if n (incf n))
-       (antlr-makefile-insert-variable n "" " =")
-       (if supers
-           (insert " "
-                   (format (cadr antlr-special-file-formats)
-                           (file-name-sans-extension (car dep)))))
-       (dolist (class-def (caadr dep))
-         (let ((sep gen-sep))
-           (dolist (class-file (cadr lang))
-             (insert sep (format class-file (car class-def)))
-             (setq sep " "))))
-       (dolist (evocab (caaddr dep))
-         (let ((sep gen-sep))
-           (dolist (vocab-file (cons (car antlr-special-file-formats)
-                                     (car lang)))
-             (insert sep (format vocab-file evocab))
-             (setq sep " "))))
-       (antlr-makefile-insert-variable n "\n$(" ")")
-       (insert ": " (car dep))
-       (dolist (ivocab (cdaddr dep))
-         (insert " " (format (car antlr-special-file-formats) ivocab)))
-       (let ((glibs (antlr-superclasses-glibs supers classes)))
-         (if (cadr glibs) (setq with-error t))
-         (dolist (super (cddr glibs))
-           (insert " " (car super))
-           (if (cdr super)
-               (insert " " (format (car antlr-special-file-formats)
-                                   (cdr super)))))
-         (insert "\n\t"
-                 (caddr antlr-makefile-specification)
-                 (car glibs)
-                 " $<\n"
-                 (car antlr-makefile-specification)))))
-    (if n
-       (let ((i 0))
-         (antlr-makefile-insert-variable nil "" " =")
-         (while (<= (incf i) n)
-           (antlr-makefile-insert-variable i " $(" ")"))
-         (insert "\n" (car antlr-makefile-specification))))
-    (if (string-equal (car antlr-makefile-specification) "\n")
-       (backward-delete-char 1))
-    (when with-error
-      (goto-char (point-min))
-      (insert antlr-help-unknown-file-text))
-    (unless in-makefile
-      (copy-region-as-kill (point-min) (point-max))
-      (goto-char (point-min))
-      (insert (format antlr-help-rules-intro dirname)))))
-
-;;;###autoload
-(defun antlr-show-makefile-rules ()
-  "Show Makefile rules for all grammar files in the current directory.
-If the `major-mode' of the current buffer has the value `makefile-mode',
-the rules are directory inserted at point.  Otherwise, a *Help* buffer
-is shown with the rules which are also put into the `kill-ring' for
-\\[yank].
-
-This command considers import/export vocabularies and grammar
-inheritance and provides a value for the \"-glib\" option if necessary.
-Customize variable `antlr-makefile-specification' for the appearance of
-the rules.
-
-If the file for a super-grammar cannot be determined, special file names
-are used according to variable `antlr-unknown-file-formats' and a
-commentary with value `antlr-help-unknown-file-text' is added.  The
-*Help* buffer always starts with the text in `antlr-help-rules-intro'."
-  (interactive)
-  (if (null (derived-mode-p 'makefile-mode))
-      (antlr-with-displaying-help-buffer 'antlr-insert-makefile-rules)
-    (push-mark)
-    (antlr-insert-makefile-rules t)))
-
-
-;;;===========================================================================
-;;;  Indentation
-;;;===========================================================================
-
-(defun antlr-indent-line ()
-  "Indent the current line as ANTLR grammar code.
-The indentation of grammar lines are calculated by `c-basic-offset',
-multiplied by:
- - the level of the paren/brace/bracket depth,
- - plus 0/2/1, depending on the position inside the rule: header, body,
-   exception part,
- - minus 1 if `antlr-indent-item-regexp' matches the beginning of the
-   line starting from the first non-whitespace.
-
-Lines inside block comments are indented by `c-indent-line' according to
-`antlr-indent-comment'.
-
-Lines in actions except top-level actions in a header part or an option
-area are indented by `c-indent-line'.
-
-Lines in header actions are indented at column 0 if `antlr-language'
-equals to a key in `antlr-indent-at-bol-alist' and the line starting at
-the first non-whitespace is matched by the corresponding value.
-
-For the initialization of `c-basic-offset', see `antlr-indent-style' and,
-to a lesser extent, `antlr-tab-offset-alist'."
-  (save-restriction
-    (let ((orig (point))
-         (min0 (point-min))
-         bol boi indent syntax cc-syntax)
-      (widen)
-      (beginning-of-line)
-      (setq bol (point))
-      (if (< bol min0)
-         (error "Beginning of current line not visible"))
-      (skip-chars-forward " \t")
-      (setq boi (point))
-      ;; check syntax at beginning of indentation ----------------------------
-      (antlr-with-syntax-table antlr-action-syntax-table
-       (antlr-invalidate-context-cache)
-       (setq syntax (antlr-syntactic-context))
-       (cond ((symbolp syntax)
-              (setq indent nil))       ; block-comments, strings, (comments)
-             ((progn
-                (antlr-next-rule -1 t)
-                (if (antlr-search-forward ":") (< boi (1- (point))) t))
-              (setq indent 0))         ; in rule header
-             ((if (antlr-search-forward ";") (< boi (point)) t)
-              (setq indent 2))         ; in rule body
-             (t
-              (forward-char)
-              (antlr-skip-exception-part nil)
-              (setq indent (if (> (point) boi) 1 0))))) ; in exception part?
-      ;; check whether to use indentation engine of cc-mode ------------------
-      (antlr-invalidate-context-cache)
-      (goto-char boi)
-      (when (and indent (> syntax 0))
-       (cond ((> syntax 1)             ; block in action => use cc-mode
-              (setq indent nil))
-             ((and (= indent 0)
-                   (assq antlr-language antlr-indent-at-bol-alist)
-                   (looking-at (cdr (assq antlr-language
-                                          antlr-indent-at-bol-alist))))
-              (setq syntax 'bol))
-             ((setq cc-syntax (c-guess-basic-syntax))
-              (let ((cc cc-syntax) symbol)
-                (while (setq symbol (pop cc))
-                  (when (cdr symbol)
-                    (or (memq (car symbol)
-                              antlr-disabling-cc-syntactic-symbols)
-                        (setq indent nil))
-                    (setq cc nil)))))))
-;;;            ((= indent 1)           ; exception part => use cc-mode
-;;;             (setq indent nil))
-;;;            ((save-restriction      ; not in option part => cc-mode
-;;;               (goto-char (scan-lists (point) -1 1))
-;;;               (skip-chars-backward " \t\n")
-;;;               (narrow-to-region (point-min) (point))
-;;;               (not (re-search-backward "\\<options\\'" nil t)))
-;;;             (setq indent nil)))))
-       ;; compute the corresponding indentation and indent --------------------
-      (if (null indent)
-         ;; Use the indentation engine of cc-mode
-         (progn
-           (goto-char orig)
-           (if (or (numberp syntax)
-                   (if (eq syntax 'string) nil (eq antlr-indent-comment t)))
-               (c-indent-line cc-syntax)))
-       ;; do it ourselves
-       (goto-char boi)
-       (unless (symbolp syntax)                ; direct indentation
-         ;;(antlr-invalidate-context-cache)
-         (incf indent (antlr-syntactic-context))
-         (and (> indent 0) (looking-at antlr-indent-item-regexp) (decf indent))
-         (setq indent (* indent c-basic-offset)))
-       ;; the usual major-mode indent stuff ---------------------------------
-       (setq orig (- (point-max) orig))
-       (unless (= (current-column) indent)
-         (delete-region bol boi)
-         (beginning-of-line)
-         (indent-to indent))
-       ;; If initial point was within line's indentation,
-       ;; position after the indentation.  Else stay at same point in text.
-       (if (> (- (point-max) orig) (point))
-           (goto-char (- (point-max) orig)))))))
-
-(defun antlr-indent-command (&optional arg)
-  "Indent the current line or insert tabs/spaces.
-With optional prefix argument ARG or if the previous command was this
-command, insert ARG tabs or spaces according to `indent-tabs-mode'.
-Otherwise, indent the current line with `antlr-indent-line'."
-  (interactive "*P")
-  (if (or arg (eq last-command 'antlr-indent-command))
-      (insert-tab arg)
-    (let ((antlr-indent-comment (and antlr-indent-comment t))) ; dynamic
-      (antlr-indent-line))))
-
-(defun antlr-electric-character (&optional arg)
-  "Insert the character you type and indent the current line.
-Insert the character like `self-insert-command' and indent the current
-line as `antlr-indent-command' does.  Do not indent the line if
-
- * this command is called with a prefix argument ARG,
- * there are characters except whitespaces between point and the
-   beginning of the line, or
- * point is not inside a normal grammar code, { and } are also OK in
-   actions.
-
-This command is useful for a character which has some special meaning in
-ANTLR's syntax and influences the auto indentation, see
-`antlr-indent-item-regexp'."
-  (interactive "*P")
-  (if (or arg
-         (save-excursion (skip-chars-backward " \t") (not (bolp)))
-         (antlr-with-syntax-table antlr-action-syntax-table
-           (antlr-invalidate-context-cache)
-           (let ((context (antlr-syntactic-context)))
-             (not (and (numberp context)
-                       (or (zerop context)
-                           (memq last-command-event '(?\{ ?\}))))))))
-      (self-insert-command (prefix-numeric-value arg))
-    (self-insert-command (prefix-numeric-value arg))
-    (antlr-indent-line)))
-
-
-;;;===========================================================================
-;;;  Mode entry
-;;;===========================================================================
-
-(defun antlr-c-init-language-vars ()
-  "Like `c-init-language-vars-for' when using cc-mode before v5.29."
-  (let ((settings                      ; (cdr '(setq...)) will be optimized
-        (if (eq antlr-language 'c++-mode)
-            (cdr '(setq                ;' from `c++-mode' v5.20, v5.28
-                   c-keywords (c-identifier-re c-C++-keywords)
-                   c-conditional-key c-C++-conditional-key
-                   c-comment-start-regexp c-C++-comment-start-regexp
-                   c-class-key c-C++-class-key
-                   c-extra-toplevel-key c-C++-extra-toplevel-key
-                   c-access-key c-C++-access-key
-                   c-recognize-knr-p nil
-                   c-bitfield-key c-C-bitfield-key ; v5.28
-                   ))
-          (cdr '(setq                  ; from `java-mode' v5.20, v5.28
-                 c-keywords (c-identifier-re c-Java-keywords)
-                 c-conditional-key c-Java-conditional-key
-                 c-comment-start-regexp c-Java-comment-start-regexp
-                 c-class-key c-Java-class-key
-                 c-method-key nil
-                 c-baseclass-key nil
-                 c-recognize-knr-p nil
-                 c-access-key c-Java-access-key ; v5.20
-                 c-inexpr-class-key c-Java-inexpr-class-key ; v5.28
-                 )))))
-    (while settings
-      (when (boundp (car settings))
-       (ignore-errors
-         (set (car settings) (eval (cadr settings)))))
-      (setq settings (cddr settings)))))
-
-(defun antlr-language-option (search)
-  "Find language in `antlr-language-alist' for language option.
-If SEARCH is non-nil, find element for language option.  Otherwise, find
-the default language."
-  (let ((value
-         (and search
-              (save-excursion
-                (goto-char (point-min))
-                (re-search-forward (cdr antlr-language-limit-n-regexp)
-                                   (+ (point)
-                                      (car antlr-language-limit-n-regexp))
-                                   t))
-              (match-string 1)))
-       (seq antlr-language-alist)
-       r)
-    ;; Like (find VALUE antlr-language-alist :key 'cddr :test 'member)
-    (while seq
-      (setq r (pop seq))
-      (if (member value (cddr r))
-         (setq seq nil)                ; stop
-       (setq r nil)))                  ; no result yet
-    (car r)))
-
-;;;###autoload
-(define-derived-mode antlr-mode prog-mode
-  ;; FIXME: Since it uses cc-mode, it bumps into c-update-modeline's
-  ;; limitation to mode-name being a string.
-  ;; '("Antlr." (:eval (cadr (assq antlr-language antlr-language-alist))))
-  "Antlr"
-  "Major mode for editing ANTLR grammar files."
-  :abbrev-table antlr-mode-abbrev-table
-  (c-initialize-cc-mode)               ; cc-mode is required
-  (unless (fboundp 'c-forward-sws)     ; see above
-    (fset 'antlr-c-forward-sws 'c-forward-syntactic-ws))
-  ;; ANTLR specific ----------------------------------------------------------
-  (unless antlr-language
-    (set (make-local-variable 'antlr-language)
-         (or (antlr-language-option t) (antlr-language-option nil))))
-  (if (stringp (cadr (assq antlr-language antlr-language-alist)))
-      (setq mode-name
-           (concat "Antlr."
-                   (cadr (assq antlr-language antlr-language-alist)))))
-  ;; indentation, for the C engine -------------------------------------------
-  (setq c-buffer-is-cc-mode antlr-language)
-  (cond ((fboundp 'c-init-language-vars-for) ; cc-mode 5.30.5+
-        (c-init-language-vars-for antlr-language))
-       ((fboundp 'c-init-c-language-vars) ; cc-mode 5.30 to 5.30.4
-        (c-init-c-language-vars)       ; not perfect, but OK
-        (setq c-recognize-knr-p nil))
-       ((fboundp 'c-init-language-vars) ; cc-mode 5.29
-        (let ((init-fn 'c-init-language-vars))
-          (funcall init-fn)))          ; is a function in v5.29
-       (t                              ; cc-mode upto 5.28
-        (antlr-c-init-language-vars))) ; do it myself
-  (c-basic-common-init antlr-language (or antlr-indent-style "gnu"))
-  (set (make-local-variable 'outline-regexp) "[^#\n\^M]")
-  (set (make-local-variable 'outline-level) 'c-outline-level) ;TODO: define own
-  (set (make-local-variable 'indent-line-function) 'antlr-indent-line)
-  (set (make-local-variable 'indent-region-function) nil)      ; too lazy
-  (setq comment-start "// "
-       comment-end ""
-       comment-start-skip "/\\*+ *\\|// *")
-  ;; various -----------------------------------------------------------------
-  (set (make-local-variable 'font-lock-defaults) antlr-font-lock-defaults)
-  (easy-menu-add antlr-mode-menu)
-  (set (make-local-variable 'imenu-create-index-function)
-       'antlr-imenu-create-index-function)
-  (set (make-local-variable 'imenu-generic-expression) t) ; fool stupid test
-  (and antlr-imenu-name                        ; there should be a global variable...
-       (fboundp 'imenu-add-to-menubar)
-       (imenu-add-to-menubar
-       (if (stringp antlr-imenu-name) antlr-imenu-name "Index")))
-  (antlr-set-tabs))
-
-;; A smarter version of `group-buffers-menu-by-mode-then-alphabetically' (in
-;; XEmacs) could use the following property.  The header of the submenu would
-;; be "Antlr" instead of "Antlr.C++" or (not and!) "Antlr.Java".
-(put 'antlr-mode 'mode-name "Antlr")
-
-;;;###autoload
-(defun antlr-set-tabs ()
-  "Use ANTLR's convention for TABs according to `antlr-tab-offset-alist'.
-Used in `antlr-mode'.  Also a useful function in `java-mode-hook'."
-  (if buffer-file-name
-      (let ((alist antlr-tab-offset-alist) elem)
-       (while alist
-         (setq elem (pop alist))
-         (and (or (null (car elem)) (eq (car elem) major-mode))
-              (or (null (cadr elem))
-                  (string-match (cadr elem) buffer-file-name))
-              (setq tab-width (caddr elem)
-                    indent-tabs-mode (cadddr elem)
-                    alist nil))))))
-
-(provide 'antlr-mode)
-
-;;; Local IspellPersDict: .ispell_antlr
-
-;;; antlr-mode.el ends here
diff --git a/developer/ologist/cycle_dection.html b/developer/ologist/cycle_dection.html
deleted file mode 100644 (file)
index 3c9fb85..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>Dependency Build Algorithm</title>
-  <style>
-    body {
-      background-color: hsl(0, 0%, 0%); /* Black background */
-      color: hsl(40, 100%, 85%); /* Wheatgrass color (offwhite with a tan hue) */
-      font-family: "Courier New", Courier, monospace;
-    }
-    code {
-      background-color: hsl(0, 0%, 15%); /* Dark gray background for code blocks */
-      border: 1px solid hsl(0, 0%, 25%); /* Slightly lighter gray for the border */
-      border-radius: 4px;
-      padding: 4px;
-      color: hsl(40, 100%, 85%); /* Wheatgrass-colored text */
-      display: inline-block; /* Inline-block to extend only as long as the code */
-      white-space: pre-wrap;
-      font-size: 14px;
-    }
-    ol {
-      margin-left: 20px;
-    }
-    li {
-      margin-bottom: 10px;
-    }
-    h1, h2 {
-      color: hsl(40, 100%, 75%); /* Lighter wheatgrass color for headers */
-    }
-    a {
-      color: hsl(150, 100%, 65%); /* Light green for links */
-    }
-  </style>
-</head>
-<body>
-  <h2>Cycle Detection in Dependency Graph</h2>
-  <h3>Overview</h3>
-  <p>
-    The <code>is_acyclic_q</code> function is designed to detect cycles in a dependency graph using a depth-first search (DFS) algorithm. It starts from a list of root node labels and traverses the graph to ensure that there are no cycles. If a cycle is detected, the function marks the nodes involved and continues to explore other parts of the graph.
-  </p>
-  <h3>Key Concepts</h3>
-  <ul>
-    <li><strong>Dependency Graph</strong>: A graph where nodes represent build targets and edges represent dependencies between these targets.</li>
-    <li><strong>Depth-First Search (DFS)</strong>: An algorithm for traversing or searching tree or graph data structures. It starts at the root and explores as far as possible along each branch before backtracking.</li>
-    <li><strong>Cycle Detection</strong>: The process of identifying cycles (loops) in a graph, where a cycle is a path that starts and ends at the same node.</li>
-  </ul>
-  <h3>Functions</h3>
-  <h4>1. is_acyclic_q</h4>
-  <p>
-    <strong>Purpose</strong>: To determine if the dependency graph is acyclic (i.e., contains no cycles).
-  </p>
-  <p>
-    <strong>Parameters</strong>: 
-    <ul>
-      <li><code>root_node_labels</code>: A list of labels for the root nodes to start the cycle search.</li>
-      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Returns</strong>: 
-    <ul>
-      <li><code>'acyclic'</code> if no cycles are found.</li>
-      <li><code>'cycle_found'</code> if cycles are detected.</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Process</strong>:
-    <ul>
-      <li>Initializes a stack for DFS traversal.</li>
-      <li>Iteratively calls the <code>is_acyclic_q_descend</code> function to traverse the graph and detect cycles.</li>
-      <li>Updates the traversal state and continues exploring other paths until the stack is empty.</li>
-    </ul>
-  </p>
-  <h4>2. is_acyclic_q_descend</h4>
-  <p>
-    <strong>Purpose</strong>: To perform the actual DFS traversal and cycle detection for a given path.
-  </p>
-  <p>
-    <strong>Parameters</strong>: 
-    <ul>
-      <li><code>path_stack</code>: A stack representing the current path in the graph.</li>
-      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Returns</strong>: 
-    <ul>
-      <li><code>'leaf_node'</code> if the current node has no children.</li>
-      <li><code>'cycle_found'</code> if a cycle is detected.</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Process</strong>:
-    <ul>
-      <li>Collects the current path and node.</li>
-      <li>Checks for cycles by comparing the current node with nodes in the path.</li>
-      <li>Marks nodes involved in cycles and updates the stack to continue traversal.</li>
-    </ul>
-  </p>
-  <h3>Usage</h3>
-  <p>
-    The <code>is_acyclic_q</code> function is used to ensure that the dependency graph defined in the build file is free of cycles. This is crucial for preventing infinite loops and ensuring that the build process can proceed smoothly.
-  </p>
-</body>
-</html>
diff --git a/developer/ologist/dependency_graph.html b/developer/ologist/dependency_graph.html
deleted file mode 100644 (file)
index 378c52d..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>Dependency Build Algorithm</title>
-  <style>
-    body {
-      background-color: hsl(0, 0%, 0%); /* Black background */
-      color: hsl(40, 100%, 85%); /* Wheatgrass color (offwhite with a tan hue) */
-      font-family: "Courier New", Courier, monospace;
-    }
-    code {
-      background-color: hsl(0, 0%, 15%); /* Dark gray background for code blocks */
-      border: 1px solid hsl(0, 0%, 25%); /* Slightly lighter gray for the border */
-      border-radius: 4px;
-      padding: 4px;
-      color: hsl(40, 100%, 85%); /* Wheatgrass-colored text */
-      display: block;
-      white-space: pre-wrap;
-      font-size: 14px;
-    }
-    ol {
-      margin-left: 20px;
-    }
-    li {
-      margin-bottom: 10px;
-    }
-    h1, h2 {
-      color: hsl(40, 100%, 75%); /* Lighter wheatgrass color for headers */
-    }
-    a {
-      color: hsl(150, 100%, 65%); /* Light green for links */
-    }
-  </style>
-</head>
-<body>
-  <h2>Cycle Detection in Dependency Graph</h2>
-  <h3>Overview</h3>
-  <p>
-    The <code>is_acyclic_q</code> function is designed to detect cycles in a dependency graph using a depth-first search (DFS) algorithm. It starts from a list of root node labels and traverses the graph to ensure that there are no cycles. If a cycle is detected, the function marks the nodes involved and continues to explore other parts of the graph.
-  </p>
-  <h3>Key Concepts</h3>
-  <ul>
-    <li><strong>Dependency Graph</strong>: A graph where nodes represent build targets and edges represent dependencies between these targets.</li>
-    <li><strong>Depth-First Search (DFS)</strong>: An algorithm for traversing or searching tree or graph data structures. It starts at the root and explores as far as possible along each branch before backtracking.</li>
-    <li><strong>Cycle Detection</strong>: The process of identifying cycles (loops) in a graph, where a cycle is a path that starts and ends at the same node.</li>
-  </ul>
-  <h3>Functions</h3>
-  <h4>1. is_acyclic_q</h4>
-  <p>
-    <strong>Purpose</strong>: To determine if the dependency graph is acyclic (i.e., contains no cycles).
-  </p>
-  <p>
-    <strong>Parameters</strong>: 
-    <ul>
-      <li><code>root_node_labels</code>: A list of labels for the root nodes to start the cycle search.</li>
-      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Returns</strong>: 
-    <ul>
-      <li><code>'acyclic'</code> if no cycles are found.</li>
-      <li><code>'cycle_found'</code> if cycles are detected.</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Process</strong>:
-    <ul>
-      <li>Initializes a stack for DFS traversal.</li>
-      <li>Iteratively calls the <code>is_acyclic_q_descend</code> function to traverse the graph and detect cycles.</li>
-      <li>Updates the traversal state and continues exploring other paths until the stack is empty.</li>
-    </ul>
-  </p>
-  <h4>2. is_acyclic_q_descend</h4>
-  <p>
-    <strong>Purpose</strong>: To perform the actual DFS traversal and cycle detection for a given path.
-  </p>
-  <p>
-    <strong>Parameters</strong>: 
-    <ul>
-      <li><code>path_stack</code>: A stack representing the current path in the graph.</li>
-      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Returns</strong>: 
-    <ul>
-      <li><code>'leaf_node'</code> if the current node has no children.</li>
-      <li><code>'cycle_found'</code> if a cycle is detected.</li>
-    </ul>
-  </p>
-  <p>
-    <strong>Process</strong>:
-    <ul>
-      <li>Collects the current path and node.</li>
-      <li>Checks for cycles by comparing the current node with nodes in the path.</li>
-      <li>Marks nodes involved in cycles and updates the stack to continue traversal.</li>
-    </ul>
-  </p>
-  <h3>Usage</h3>
-  <p>
-    The <code>is_acyclic_q</code> function is used to ensure that the dependency graph defined in the build file is free of cycles. This is crucial for preventing infinite loops and ensuring that the build process can proceed smoothly.
-  </p>
-
-</body>
-</html>  
-
-<h2>2. Run Build Scripts</h2>
-<ol>
-  <li>Traverse the queue starting from the tail (the most recently added nodes).</li>
-  <li>For each node, attempt to build it by checking the file dates of the target node and its dependencies:
-    <ol>
-      <li>If the target file is older than any dependency, execute the node’s build function.</li>
-      <li>After building, recheck the file dates. If the file date has been updated, mark the node as successfully built.</li>
-      <li>If the build fails or the file date is not updated, mark the node with an error in its property list.</li>
-    </ol>
-  </li>
-  <li>Nodes with dependencies marked with errors will not be built, and errors will propagate up the dependency tree.</li>
-</ol>
-
-<h2>3. Final Reporting and Status</h2>
-<ol>
-  <li>If the root node is successfully built, report the success and any other successfully built nodes.</li>
-  <li>If an error has propagated to the root, report the failure.</li>
-  <li>Keep a list of all successfully built nodes and provide a final summary of the build status.</li>
-</ol>
-
-<h2>4. Node Definitions</h2>
-<p>Each node in the dependency graph is defined by a property dictionary. A node is either a symbol or a path:</p>
-<ol>
-  <li>Symbol Nodes: These represent abstract concepts or commands and always trigger a build unless marked with an error.</li>
-  <li>Path Nodes: These represent file paths. A path node is considered built if its target file is newer than its dependencies.</li>
-</ol>
-<p>Both node types are identified by a label, and their dependencies are stored as a list of node labels. The presence of an error property indicates that the node has failed to build or encountered a problem during processing.</p>
-
-</body>
-</html>
diff --git a/developer/ologist/deps.gradle b/developer/ologist/deps.gradle
deleted file mode 100644 (file)
index 8427e1f..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-// useful regular expressions
-def base = "[a-zA-Z0-9_-]+"
-def ext = "[a-zA-Z0-9_-]+$"
-def name = "${filebase}\.${fileext}"
-def path = "[.]+/${name}"
-
-
-// Predefined returnable functions for comparison
-def no_match_f = { target ->
-    println "No match found for target: ${target}"
-}
-
-def dependency_list_f = { jarFilePath, javaFilePath ->
-    println "Building JAR file for target: ${jarFilePath}"
-    println "Target: ${jarFilePath} depends on: ${javaFilePath}"
-    return [jarFilePath, javaFilePath]
-}
-
-// Main function to handle target matching
-def target_executor(token) {
-    // Match against the expected executor path pattern
-    def match = token =~ /(?:^executor\/)(${base})\.class$/
-
-    // If there’s no match, return the no_match function
-    if (!match) {
-        return no_match_f.curry(token)
-    }
-
-    // Extract the base name of the matched target (e.g., "RuleNameListRegx")
-    def targetBase = match[0][1]
-
-    // Define the expected Java and JAR file paths
-    def javaFilePath = "${javaCompInDir}${targetBase}.java"
-    def jarFilePath = "${executorDir}${targetBase}.jar"
-
-    // Check if the corresponding Java file exists in the javac directory
-    def javaFile = new File(javaFilePath)
-    if (!javaFile.exists()) {
-        // Return the function to print the missing Java file message
-        return no_java_file_f.curry(javaFilePath)
-    }
-
-    // Return the function that handles the JAR build step
-    return build_jar_f.curry(jarFilePath, javaFilePath)
-}
-
-// Example usage:
-def f = target_executor("executor/RuleNameListRegx.class")
-if (f == no_match_f) {
-    println "No match found"
-} else if (f == no_java_file_f) {
-    println "No corresponding Java file"
-} else {
-    f()  // Call the returned function to perform the build
-}
-
-
-
-
-// useful regular expressions
-def base = "[a-zA-Z0-9_-]+"
-def ext = "[a-zA-Z0-9_-]+$"
-def name = "${filebase}\.${fileext}
-def path = "[.]+/${name}"
-
-def target_executor( token ){
-
-  // "(?:" ... ) matches are thrown away
-  def match = token =~ /(?:^executor/)(${base})(?:${ext})/
-
-  // if there is a corresponding primary javac/primary/%1.java file,
-  // then creating the executable wrapper depends upon the .jar
-  // file, which will later chain back to the java file.
-
-  ...
-
-// returns a function that produces the jar file, or returns
-// a function that, if invoked prints the message that there is
-// no corresponding java file.
-
-
-  return ...
-
-}
-
-
-// Define the build target, dependencies, and functions as triples
-def build_triples = [
-  [
-    targets: [""]
-    deps: ["jvm/%1.class"]
-  ]
-
-  ,[ 
-    targets: ["(?:${path}/)
-   ...
-
-  ],
-]
-
-
-
-
-def programMap = [
-  [target: ["exectutor/
-
-    // RuleNameListRegx does not require ANTLR or external tools
-    "RuleNameListRegx": [
-        "wrapped_jar_from_java": "RuleNameListRegx",
-        "java_depends": [],
-        "grammar": [],
-        "program_deps": []
-    ],
-
-    // RuleNameList does not require ANTLR or external tools
-    "RuleNameList": [
-        "wrapped_jar_from_java": "RuleNameList",
-        "java_depends": [],
-        "grammar": [],
-        "program_deps": []
-    ],
-
-    // Synthesize_SyntaxAnnotate_PrintVisitorMethod has dependencies on Java classes
-    "Synthesize_SyntaxAnnotate_PrintVisitorMethod": [
-        "wrapped_jar_from_java": "Synthesize_SyntaxAnnotate_PrintVisitorMethod",
-        "java_depends": ["StringUtils"],
-        "grammar": [],
-        "program_deps": []
-    ],
-
-    // Synthesize_SyntaxAnnotate_PrintVisitor depends on Synthesize_SyntaxAnnotate_PrintVisitorMethod
-    "Synthesize_SyntaxAnnotate_PrintVisitor": [
-        "wrapped_jar_from_java": "Synthesize_SyntaxAnnotate_PrintVisitor",
-        "java_depends": ["StringUtils", "Synthesize_SyntaxAnnotate_PrintVisitorMethod"],
-        "grammar": [],
-        "program_deps": []
-    ],
-
-    // ANTLRv4_RuleNameList requires the ANTLRv4 grammar and is used in parsing ANTLR grammars
-    "ANTLRv4_RuleNameList": [
-        "wrapped_jar_from_java": "ANTLRv4_RuleNameList",
-        "java_depends": [],
-        "grammar": ["ANTLRv4"],
-        "program_deps": []
-    ],
-
-    // Arithmetic_Echo requires the Arithmetic grammar and ANTLR-generated files
-    "Arithmetic_Echo": [
-        "wrapped_jar_from_java": "Arithmetic_Echo",
-        "java_depends": ["Arithmetic_Echo_PrintVisitor"],
-        "grammar": ["Arithmetic"],
-        "program_deps": []
-    ],
-
-    // Arithmetic_Echo__Test also depends on the Arithmetic grammar
-    "Arithmetic_Echo__Test": [
-        "wrapped_jar_from_java": "Arithmetic_Echo__Test",
-        "java_depends": ["Arithmetic_Echo_PrintVisitor"],
-        "grammar": ["Arithmetic"],
-        "program_deps": []
-    ],
-
-    // Arithmetic_SyntaxAnnotate has dependencies on Arithmetic and generated files
-    "Arithmetic_SyntaxAnnotate": [
-        "wrapped_jar_from_java": "Arithmetic_SyntaxAnnotate",
-        "java_depends": ["Arithmetic_SyntaxAnnotate_PrintVisitor"],
-        "grammar": ["Arithmetic"],
-        "program_deps": []
-    ],
-
-    // Arithmetic_SyntaxAnnotate__Test has similar dependencies as Arithmetic_SyntaxAnnotate
-    "Arithmetic_SyntaxAnnotate__Test": [
-        "wrapped_jar_from_java": "Arithmetic_SyntaxAnnotate__Test",
-        "java_depends": ["Arithmetic_SyntaxAnnotate_PrintVisitor"],
-        "grammar": ["Arithmetic"],
-        "program_deps": []
-    ],
-
-    // Arithmetic2_SyntaxAnnotate has its own grammar and dependencies
-    "Arithmetic2_SyntaxAnnotate": [
-        "wrapped_jar_from_java": "Arithmetic2_SyntaxAnnotate",
-        "java_depends": ["Arithmetic2_SyntaxAnnotate_PrintVisitor"],
-        "grammar": ["Arithmetic2"],
-        "program_deps": []
-    ],
-
-    // Arithmetic2_SyntaxAnnotate__Test has the same dependencies as Arithmetic2_SyntaxAnnotate
-    "Arithmetic2_SyntaxAnnotate__Test": [
-        "wrapped_jar_from_java": "Arithmetic2_SyntaxAnnotate__Test",
-        "java_depends": ["Arithmetic2_SyntaxAnnotate_PrintVisitor"],
-        "grammar": ["Arithmetic2"],
-        "program_deps": []
-    ],
-
-    // ANTLRv4_SyntaxAnnotate requires the ANTLRv4 grammar
-    "ANTLRv4_SyntaxAnnotate": [
-        "wrapped_jar_from_java": "ANTLRv4_SyntaxAnnotate",
-        "java_depends": ["ANTLRv4_SyntaxAnnotate_PrintVisitor"],
-        "grammar": ["ANTLRv4"],
-        "program_deps": []
-    ],
-
-    // Arithmetic_Swap has multiple dependencies on generated files and grammars
-    "Arithmetic_Swap": [
-        "wrapped_jar_from_java": "Arithmetic_Swap",
-        "java_depends": ["Arithmetic_SwapVisitor", "Arithmetic_Echo_PrintVisitor"],
-        "grammar": ["Arithmetic"],
-        "program_deps": []
-    ],
-
-    // GQL-related program with its own grammar and dependencies
-    "GQL_20240412_SyntaxAnnotate": [
-        "wrapped_jar_from_java": "GQL_20240412_SyntaxAnnotate",
-        "java_depends": ["GQL_20240412_SyntaxAnnotate_PrintVisitor"],
-        "grammar": ["GQL_20240412"],
-        "program_deps": []
-    ],
-
-    "GQL_20240412_SyntaxAnnotate__Test": [
-        "wrapped_jar_from_java": "GQL_20240412_SyntaxAnnotate__Test",
-        "java_depends": ["GQL_20240412_SyntaxAnnotate_PrintVisitor"],
-        "grammar": ["GQL_20240412"],
-        "program_deps": []
-    ],
-
-    // Additional tools
-    "TerminalToCategory": [
-        "wrapped_jar_from_java": "TerminalToCategory",
-        "java_depends": [],
-        "grammar": [],
-        "program_deps": []
-    ],
-
-    "GrammarSplitter": [
-        "wrapped_jar_from_java": "GrammarSplitter",
-        "java_depends": [],
-        "grammar": [],
-        "program_deps": []
-    ]
-]
diff --git a/developer/ologist/emacs.txt b/developer/ologist/emacs.txt
deleted file mode 100644 (file)
index 545ab89..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-antlr-mode.el -> .emacs.d
-(autoload 'antlr-mode "antlr-mode" "Major mode for editing ANTLR grammars." t)
-(add-to-list 'auto-mode-alist '("\\.g4\\'" . antlr-mode))
-
-
-C-c C-g b to run gradle build
-C-c C-g t to run gradle test
-C-c C-g s to run a single test
-C-c C-g d to run a Gradle command with the daemon
-
-e
diff --git a/developer/ologist/for_developers.md b/developer/ologist/for_developers.md
deleted file mode 100644 (file)
index c702f7f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-The work area for developers is the `developer` directory. All other subdirectories
-and files found at the top level are for project management.
-
-The best way to setup the environment and to enter the `developer` directory is
-to use the `repo` command found in RT's `resource` project. The `repo` command
-will start a new shell with the proper environment variables setup for the 
-project, and nothing else.
-
-A project can also be entered by sourcing `env_dev` by running the command
-`. exector/env_dev` in a shell.  `use_tool` is analogous to `activate` in Python.
-
-
-
-
-
diff --git a/developer/ologist/grammar_source.txt b/developer/ologist/grammar_source.txt
deleted file mode 100644 (file)
index 18a3870..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-GQL grammar came from:
-   https://github.com/opengql/grammar.git
-
-ANTLR grammar came from:
-   Note the antlr gammar on this site, many grammars listed.
-   https://github.com/antlr/grammars-v4
-   It came as four files:
-     ANTLRv4Lexer.g4
-     ANTLRv4Parser.g4
-     LexBasic.g4
-     LexerAdaptor.java
-
-Cypher movies example:
-  https://github.com/neo4j-graph-examples/movies/blob/main/scripts/movies.cypher
-
diff --git a/developer/ologist/groovy.el b/developer/ologist/groovy.el
deleted file mode 100644 (file)
index f08befb..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-;; Ensure package archives are set up
-(require 'package)
-(setq package-archives '(("melpa" . "https://melpa.org/packages/")
-                         ("gnu" . "https://elpa.gnu.org/packages/")))
-(package-initialize)
-
-;; Install neotree if not already installed
-(unless (package-installed-p 'groovy-mode)
-  (package-refresh-contents)
-  (package-install 'groovy-mode))
-
-;; Configure NeoTree
-(with-eval-after-load 'groovy-mode
-  (setq groovy-indent-offset 2)
-  )
-
diff --git a/developer/ologist/node_labels_unique_q.txt b/developer/ologist/node_labels_unique_q.txt
deleted file mode 100644 (file)
index b978a74..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-
-predicate == is_well_formed_q
-
-We can not check that the node labels are unique because the given value
-is a single node, and the code is stateless. Besides there is no contract with
-the programmer on how to use the predicated, so the programmer could call the
-predicate multiple times on the same node.  Now can we test this condition in
-our do_markup_graph routine because of the way lookup works, it will always
-return the same node for the same label.  This would be a truly difficult check
-to perform because the map does not given an error but just takes the second of
-the duplicate key definitions (is this really true?)  besides, it would require
-a formal proof of the recognizer functions that they do not return different
-definitions for different keys to match regexprs against.  I've been mulling
-this over.  As we currently the programmer provides the map and function
-definitions, we don't even know which nodes will be in the graph...
diff --git a/developer/ologist/rule_list.txt b/developer/ologist/rule_list.txt
deleted file mode 100644 (file)
index 79457ec..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-Extracted Rules:
-PATH
-MONTH
-RIGHT_ARROW
-RIGHT_BRACKET_TILDE
-CREATE
-GROUPS
-TRIM
-CLOSE
-UINT32
-AGGREGATES
-FLOAT128
-LOG10
-FLOOR
-CATALOG
-YEAR
-CONNECTING
-CURRENT_PROPERTY_GRAPH
-NOTHING
-PARTITION
-INT16
-REVERSE_SOLIDUS
-BINDINGS
-LEFT_ANGLE_BRACKET
-LEFT
-NODE
-LEFT_BRACKET
-SIZE
-BIGINT
-SUM
-WHERE
-AS
-AT
-MIN
-QUERY
-TILDE_LEFT_BRACKET
-LEFT_ARROW_TILDE
-LTRIM
-VARCHAR
-SOURCE
-THEN
-XOR
-BINDING
-ALL_DIFFERENT
-SAME
-ORDINALITY
-CALL
-ALTER
-SET
-INT32
-BYTE_LENGTH
-PATHS
-RIGHT_PAREN
-CONSTRAINT
-PRECISION
-ASC
-GROUP
-UPPER
-ABS
-DELETE
-SMALL
-SIMPLE_COMMENT_MINUS
-VARIABLE
-BY
-OFFSET
-OCTET_LENGTH
-SKIP_RESERVED_WORD
-ELEMENT_ID
-INTERVAL
-DURATION_BETWEEN
-PROCEDURE
-YIELD
-STDDEV_POP
-POWER
-DOUBLE_DOLLAR_SIGN
-COLLECT_LIST
-INT8
-DETACH
-OPEN
-PERCENT
-STRING
-VARBINARY
-SIMPLE
-INTEGER8
-TO
-BRACKET_RIGHT_ARROW
-FLOAT16
-UNION
-DURATION
-SLASH_MINUS
-HOME_PROPERTY_GRAPH
-LOCAL_TIMESTAMP
-TYPED
-LEFT_ARROW
-FLOAT32
-DOUBLE_PERIOD
-DESC
-INTEGER32
-INTEGER128
-OPTIONAL
-PRODUCT
-DESCENDING
-PROPERTY_EXISTS
-LABEL
-LEFT_BRACE
-CURRENT_TIME
-REPLACE
-LABELS
-INTEGER
-NUMBER
-PROJECT
-INTEGER256
-PROPERTY
-PERCENTILE_DISC
-FOR
-UNIQUE
-TRAILING
-BTRIM
-UINT64
-BOOLEAN
-INTEGER16
-AVG
-NOT
-UBIGINT
-CEILING
-LOWER
-LAST
-SINH
-PATH_LENGTH
-INSTANT
-SIN
-END
-RELATIONSHIP
-HAVING
-LIST
-TANH
-TEMPORAL
-QUOTE
-MULTISET_ALTERNATION_OPERATOR
-BINARY
-ASIN
-UINT8
-DROP
-INFINITY
-RETURN
-ELEMENTS
-LEFT_ARROW_BRACKET
-SIGNED
-LEFT_MINUS_RIGHT
-SCHEMA
-NEXT
-RADIANS
-NORMALIZE
-GQLSTATUS
-RENAME
-BIG
-SLASH_TILDE_RIGHT
-FLOAT256
-FILTER
-MOD
-EXISTS
-INT64
-FLOAT64
-CONCATENATION_OPERATOR
-TIME
-COLON
-INTERSECT
-NORMALIZED
-WITH
-CLONE
-SLASH_MINUS_RIGHT
-RIGHT_BRACKET
-CURRENT_ROLE
-GRANT
-RELATIONSHIPS
-PLUS_SIGN
-DATETIME
-BOOL
-DIRECTORY
-DESTINATION
-START
-CHAR_LENGTH
-CHARACTER_LENGTH
-ZONED
-UNDERSCORE
-PERCENTILE_CONT
-DOUBLE_QUOTE
-SQRT
-INT128
-FINISH
-NULLIF
-SESSION_USER
-TABLE
-STDDEV_SAMP
-WHEN
-AGGREGATE
-VERTEX
-EXCLAMATION_MARK
-LOCAL
-DIRECTED
-ELSE
-CEIL
-CURRENT_GRAPH
-IF
-TYPE
-RIGHT_DOUBLE_ARROW
-PARAMETER
-CAST
-LOCAL_TIME
-GRAPH
-AMPERSAND
-SLASH_TILDE
-TRAIL
-IN
-LOG
-DISTINCT
-HOME_SCHEMA
-INT256
-IS
-EXACT
-LEADING
-FUNCTION
-INTEGER64
-CASE
-NODETACH
-NFKC
-NFKD
-DOLLAR_SIGN
-WITHOUT
-COUNT
-NOT_EQUALS_OPERATOR
-MINUS_LEFT_BRACKET
-MAX
-UNSIGNED
-CHAR
-TRANSACTION
-SYSTEM_USER
-LEFT_PAREN
-WRITE
-ORDER
-COMMERCIAL_AT
-REMOVE
-RIGHT
-VALUES
-DOUBLE
-COMMA
-GRAVE_ACCENT
-ZONED_DATETIME
-MINUS_SLASH
-NUMERIC
-REVOKE
-COS
-CURRENT_SCHEMA
-USE
-COT
-ASTERISK
-CHARACTERISTICS
-COPY
-SESSION
-TILDE_SLASH
-FIRST
-UNDIRECTED
-SELECT
-RECORDS
-ELEMENT
-ASCENDING
-LABELED
-HOME_GRAPH
-LOCAL_DATETIME
-REPEATABLE
-DAY
-UINT
-SIMPLE_COMMENT_SOLIDUS
-BYTES
-TAN
-ALL
-CURRENT_USER
-LN
-ARRAY
-SUBSTRING
-ZONE
-RECORD
-DECIMAL
-ONLY
-NFC
-FROM
-RESET
-VALUE
-LEFT_ARROW_TILDE_BRACKET
-NFD
-RIGHT_BRACKET_MINUS
-ZONED_TIME
-COALESCE
-QUESTION_MARK
-TIMESTAMP
-ACOS
-MINUTE
-EDGE
-GREATER_THAN_OR_EQUALS_OPERATOR
-BOTH
-NULL
-UNIT
-LEFT_TILDE_SLASH
-VERTICAL_BAR
-DIFFERENT
-KEEP
-LEFT_MINUS_SLASH
-BRACKETED_COMMENT
-PARAMETERS
-EXISTING
-EXCEPT
-SOLIDUS
-READ
-DATE
-SHORTEST
-LIKE
-DATA
-DRYRUN
-AND
-PERIOD
-OTHERWISE
-REAL
-INSERT
-CURRENT_DATE
-ATAN
-NO
-FLOAT
-LESS_THAN_OR_EQUALS_OPERATOR
-RIGHT_ANGLE_BRACKET
-CURRENT_TIMESTAMP
-HOUR
-LIMIT
-UINT16
-ANY
-UINT256
-ABSTRACT
-INT
-ROLLBACK
-OF
-REFERENCE
-CARDINALITY
-EDGES
-TILDE_RIGHT_ARROW
-COSH
-NULLS
-RTRIM
-ON
-BRACKET_TILDE_RIGHT_ARROW
-WALK
-RIGHT_BRACE
-DEC
-OR
-COMMIT
-MINUS_SIGN
-UINT128
-USMALLINT
-DOUBLE_COLON
-EQUALS_OPERATOR
-DEGREES
-TEMP
-ACYCLIC
-SMALLINT
-LET
-SECOND
-TILDE
-EXP
-MATCH
-CLEAR
diff --git a/developer/ologist/rules_by_catebory.txt b/developer/ologist/rules_by_catebory.txt
deleted file mode 100644 (file)
index 729f885..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-
-#--------------------------------------------------------------------------------
-# Data Types
-#   INTEGER16 is referenced in some rules.  INT16 is referenced in others.
-#
-
-
-BIGINT
-BOOL
-BOOLEAN
-BYTE_STRING_LITERAL
-CHARACTERISTICS
-CHARACTER_LENGTH
-FLOAT256
-INT
-INT8
-INT16
-INT32
-INT64
-INT128
-INT256
-INT256
-INTEGER16
-INTEGER32
-SMALLINT
-UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-
-booleanType
-booleanValueExpression
-byteStringType
-byteStringValueExpression
-decimalExactNumericType
-numericValueExpressionDividend
-signedBinaryExactNumericType
-trimCharacterOrByteString
-trimCharacterOrByteStringSource
-trimMultiCharacterCharacterString
-unsignedInteger
-verboseBinaryExactNumericType
-
diff --git a/developer/ologist/rules_by_category.html b/developer/ologist/rules_by_category.html
deleted file mode 100644 (file)
index 5e28fc0..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<code>
-<h2>Data Types</h2>
-<ul>
-  <li>signedBinaryExactNumericType</li>
-  <li>BYTE_STRING_LITERAL</li>
-  <li>decimalExactNumericType</li>
-  <li>booleanType</li>
-  <li>INT256</li>
-  <li>FLOAT256</li>
-  <li>DATETIME</li>
-  <li>BOOLEAN</li>
-  <li>VARCHAR</li>
-  <li>UNSIGNED_INTEGER</li>
-  <li>numericValueExpressionDividend</li>
-</ul>
-<h2>Identifiers and References</h2>
-<ul>
-  <li>labelName</li>
-  <li>bindingVariable</li>
-  <li>nodeTypeLabelSet</li>
-  <li>absoluteCatalogSchemaReference</li>
-  <li>destinationNodeTypeAlias</li>
-  <li>graphTypeReference</li>
-</ul>
-<h2>Modifiers and Qualifiers</h2>
-<ul>
-  <li>DISTINCT</li>
-  <li>setQuantifier</li>
-  <li>simplifiedDefaultingRight</li>
-  <li>WITH</li>
-  <li>sessionSetSchemaClause</li>
-  <li>sessionSetParameterClause</li>
-  <li>fixedQuantifier</li>
-</ul>
-<h2>Functions</h2>
-<ul>
-  <li>LOG10</li>
-  <li>FLOOR</li>
-  <li>characterOrByteStringFunction</li>
-  <li>ceilingFunction</li>
-  <li>trigonometricFunction</li>
-  <li>durationFunction</li>
-  <li>datetimeFunction</li>
-  <li>generalSetFunction</li>
-  <li>functionCall</li>
-</ul>
-<h2>Expressions and Operators</h2>
-<ul>
-  <li>booleanValueExpression</li>
-  <li>commonLogarithm</li>
-  <li>comparisonPredicatePart2</li>
-  <li>naturalLogarithm</li>
-  <li>powerFunction</li>
-  <li>SIN</li>
-  <li>MINUS_LEFT_BRACKET</li>
-  <li>UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX</li>
-  <li>simplifiedOverrideRight</li>
-</ul>
-<h2>Commands and Statements</h2>
-<ul>
-  <li>SELECT</li>
-  <li>INSERT</li>
-  <li>CREATE</li>
-  <li>DROP</li>
-  <li>ROLLBACK</li>
-  <li>simpleMatchStatement</li>
-  <li>sessionSetCommand</li>
-  <li>matchStatement</li>
-  <li>matchStatementBlock</li>
-  <li>createGraphStatement</li>
-</ul>
-<h2>Patterns and Matching</h2>
-<ul>
-  <li>simpleMatchStatement</li>
-  <li>pathPattern</li>
-  <li>elementPatternPredicate</li>
-  <li>graphPatternYieldClause</li>
-  <li>graphPatternBindingTable</li>
-  <li>pathPrimary</li>
-  <li>pathOrPaths</li>
-  <li>simplifiedPathUnion</li>
-</ul>
-<h2>Structures and Schema</h2>
-<ul>
-  <li>procedureSpecification</li>
-  <li>compositeQueryPrimary</li>
-  <li>procedureBody</li>
-  <li>linearCatalogModifyingStatement</li>
-  <li>graphInitializer</li>
-  <li>schemaReference</li>
-</ul>
-<h2>Miscellaneous</h2>
-<ul>
-  <li>LEFT_ARROW_TILDE</li>
-  <li>SIMPLE_COMMENT_MINUS</li>
-  <li>optionalMatchStatement</li>
-  <li>UNIQUE</li>
-  <li>optionalOperand</li>
-  <li>simplifiedContents</li>
-</ul>
-</code>
diff --git a/developer/ologist/terminal_symbol_list.txt b/developer/ologist/terminal_symbol_list.txt
deleted file mode 100644 (file)
index 14946b0..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-#--------------------------------------------------------------------------------
-# terminal symbols in the GQL_20240420 grammar
-#
-
-# Literals
-NULL
-TRUE
-FALSE
-NUMBER
-BOOLEAN_LITERAL
-
-# Data Types
-BIGINT
-BOOL
-BOOLEAN
-BYTES
-BYTE_LENGTH
-BYTE_STRING_LITERAL
-CARDINALITY
-CHAR
-DATE
-DATETIME
-DAY
-DEC
-DECIMAL
-DOUBLE
-DURATION
-DURATION_BETWEEN
-ELEMENT
-ELEMENT_ID
-FLOAT
-FLOAT
-INSTANT
-INT
-INT128
-INT16
-INT256
-INT32
-INT64
-INT8
-INTEGER
-INTERVAL
-MAX
-MIN
-MINUTE
-MODULUS
-MONTH
-NUMERIC
-REAL
-SIZE
-SMALLINT
-TEMP
-TEMPORAL
-TIME
-UBIGINT
-UINT
-UINT128
-UINT16
-UINT256
-UINT32
-UINT64
-UINT8
-UNSIGNED_BINARY_INTEGER
-UNSIGNED_DECIMAL_INTEGER
-UNSIGNED_HEXADECIMAL_INTEGER
-UNSIGNED_OCTAL_INTEGER
-USMALLINT
-VALUE
-VALUES
-VARBINARY
-VARCHAR
-YEAR
-ZONED
-ZONED_DATETIME
-ZONED_TIME
-
-
-# Functions
-ABS
-ACOS
-AGGREGATE
-AGGREGATES
-ALL_DIFFERENT
-ASIN
-ATAN
-AVG
-BTRIM
-CAST
-CEIL
-CEILING
-CHARACTER_LENGTH
-CONCATENATION_OPERATOR
-COS
-COSH
-COT
-COUNT
-EXP
-FLOOR
-LOG
-LOG10
-LOWER
-LTRIM
-MOD
-OCTET_LENGTH
-POSITION
-POWER
-RADIANS
-RTRIM
-SIN
-SINH
-SQRT
-STDDEV_POP
-STDDEV_SAMP
-SUBSTRING
-SUM
-TAN
-TANH
-TRIM
-UPPER
-
-# Punctuation and Operators
-AMPERSAND
-ASTERISK
-BRACKETED_COMMENT
-BRACKET_RIGHT_ARROW
-BRACKET_TILDE_RIGHT_ARROW
-COLON
-COMMA
-COMMERCIAL_AT
-CONCATENATION_OPERATOR
-DOLLAR_SIGN
-DOUBLE_COLON
-DOUBLE_DOLLAR_SIGN
-DOUBLE_PERIOD
-DOUBLE_QUOTE
-DOUBLE_QUOTED_CHARACTER_SEQUENCE
-EQUALS_OPERATOR
-EXCLAMATION_MARK
-GREATER_THAN_OR_EQUALS_OPERATOR
-LEFT_ANGLE_BRACKET
-LEFT_ARROW
-LEFT_BRACE
-LEFT_BRACKET
-LEFT_MINUS_RIGHT
-LEFT_MINUS_SLASH
-LEFT_PAREN
-LEFT_TILDE_SLASH
-LESS_THAN_OR_EQUALS_OPERATOR
-MINUS_LEFT_BRACKET
-MINUS_SIGN
-PERIOD
-PLUS_SIGN
-REVERSE_SOLIDUS
-RIGHT_ANGLE_BRACKET
-RIGHT_ARROW
-RIGHT_BRACE
-RIGHT_BRACKET
-RIGHT_BRACKET_MINUS
-RIGHT_BRACKET_TILDE
-RIGHT_DOUBLE_ARROW
-RIGHT_PAREN
-SINGLE_QUOTED_CHARACTER_SEQUENCE
-SLASH_MINUS
-SLASH_MINUS_RIGHT
-SLASH_TILDE
-SLASH_TILDE_RIGHT
-SOLIDUS
-TILDE
-TILDE_LEFT_BRACKET
-TILDE_RIGHT_ARROW
-TILDE_SLASH
-UNDERSCORE
-VERTICAL_BAR
-
-# Keywords
-ABSTRACT
-ALL
-ALTER
-AND
-ANY
-ARRAY
-AS
-ASC
-ASCENDING
-AT
-BIG
-BINARY
-BINDING
-BINDINGS
-BOTH
-CALL
-CATALOG
-CLEAR
-CLONE
-CLOSE
-COMMIT
-CONSTRAINT
-CREATE
-CURRENT_PROPERTY_GRAPH
-CURRENT_SCHEMA
-DELETE
-DESC
-DESCENDING
-DETACH
-DIFFERENT
-DIRECTED
-DIRECTORY
-DISTINCT
-DROP
-DRYRUN
-ELEMENTS
-EXCEPT
-EXISTING
-EXISTS
-FALSE
-FILTER
-FINISH
-FIRST
-FROM
-FUNCTION
-GENERAL_PARAMETER_REFERENCE
-GRANT
-GROUP
-GROUPS
-HAVING
-HOME_GRAPH
-HOME_PROPERTY_GRAPH
-HOME_SCHEMA
-IN
-INSERT
-INTERSECT
-IS
-KEEP
-LABELED
-LAST
-LEADING
-LEFT
-LEFT_ARROW_BRACKET
-LEFT_ARROW_TILDE
-LIKE
-LIST
-MATCH
-NOT
-NOTHING
-NULL
-NULLIF
-OF
-ON
-ONLY
-OPEN
-OPTIONAL
-OR
-ORDER
-ORDINALITY
-OTHERWISE
-PARENT
-PARENTHESIZED
-PATH
-PATHS
-PRECISION
-PRIMARY
-PRIORITY
-PROCEDURE
-PRODUCT
-PROPERTIES
-PROPERTY
-PROPERTY_EXISTS
-QUANTIFIER
-REFERENCE
-REFERENCES
-REFLECT
-REGULAR
-REMOVE
-RENAME
-REPEATABLE
-REPLACE
-RESET
-RETURN
-REVOKE
-RIGHT
-ROLLBACK
-SAME
-SCHEMA
-SELECT
-SESSION
-SET
-SHORTEST
-SIGNED
-SIMPLE
-SIMPLE_COMMENT_MINUS
-SIMPLE_COMMENT_SOLIDUS
-SOURCE
-SP
-START
-SUBSTITUTED_PARAMETER_REFERENCE
-TABLE
-TO
-TRAIL
-TRAILING
-TRANSACTION
-TRUE
-TYPED
-UNDIRECTED
-UNION
-UNIQUE
-UNIT
-UNSIGNED
-USE
-USING
-VERTEX
-WALK
-WHERE
-WHITESPACE
-WITH
-WITHOUT
-WRITE
-XOR
-YIELD
-ZONE
-
-
-# Control Flow
-BREAK
-CASE
-CONTINUE
-DO
-ELSE
-END
-FOR
-IF
-IMPLIES
-LOOP
-RETURN
-THEN
-WHEN
-WHILE
-
-# Miscellaneous
-ACCENT_QUOTED_CHARACTER_SEQUENCE
-ACYCLIC
-CURRENT_DATE
-CURRENT_GRAPH
-CURRENT_ROLE
-CURRENT_TIME
-CURRENT_TIMESTAMP
-CURRENT_USER
-EDGE
-EDGES
-GQLSTATUS
-GRAPH
-GRAVE_ACCENT
-LABEL
-LABELS
-NODE
-NODES
-RELATIONSHIP
-RELATIONSHIPS
-SESSION_USER
-SYSTEM_USER
-TYPE
-VARIABLE
diff --git a/developer/ologist/terminal_symbol_list_unsorted.txt b/developer/ologist/terminal_symbol_list_unsorted.txt
deleted file mode 100644 (file)
index 80be8af..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-ABS
-ABSTRACT
-ACCENT_QUOTED_CHARACTER_SEQUENCE
-ACOS
-ACYCLIC
-AGGREGATE
-AGGREGATES
-ALL
-ALL_DIFFERENT
-ALTER
-AMPERSAND
-AND
-ANY
-ARRAY
-AS
-ASC
-ASCENDING
-ASIN
-ASTERISK
-AT
-ATAN
-AVG
-BIG
-BIGINT
-BINARY
-BINDING
-BINDINGS
-BOOL
-BOOLEAN
-BOOLEAN_LITERAL
-BOTH
-BRACKETED_COMMENT
-BRACKET_RIGHT_ARROW
-BRACKET_TILDE_RIGHT_ARROW
-BTRIM
-BY
-BYTES
-BYTE_LENGTH
-BYTE_STRING_LITERAL
-CALL
-CARDINALITY
-CASE
-CAST
-CATALOG
-CEIL
-CEILING
-CHAR
-CHARACTERISTICS
-CHARACTER_LENGTH
-CHAR_LENGTH
-CLEAR
-CLONE
-CLOSE
-COALESCE
-COLLECT_LIST
-COLON
-COMMA
-COMMERCIAL_AT
-COMMIT
-CONCATENATION_OPERATOR
-CONNECTING
-CONSTRAINT
-COPY
-COS
-COSH
-COT
-COUNT
-CREATE
-CURRENT_DATE
-CURRENT_GRAPH
-CURRENT_PROPERTY_GRAPH
-CURRENT_ROLE
-CURRENT_SCHEMA
-CURRENT_TIME
-CURRENT_TIMESTAMP
-CURRENT_USER
-DATA
-DATE
-DATETIME
-DAY
-DEC
-DECIMAL
-DEGREES
-DELETE
-DESC
-DESCENDING
-DESTINATION
-DETACH
-DIFFERENT
-DIRECTED
-DIRECTORY
-DISTINCT
-DOLLAR_SIGN
-DOUBLE
-DOUBLE_COLON
-DOUBLE_DOLLAR_SIGN
-DOUBLE_PERIOD
-DOUBLE_QUOTE
-DOUBLE_QUOTED_CHARACTER_SEQUENCE
-DROP
-DRYRUN
-DURATION
-DURATION_BETWEEN
-EDGE
-EDGES
-ELEMENT
-ELEMENTS
-ELEMENT_ID
-ELSE
-END
-EQUALS_OPERATOR
-EXACT
-EXCEPT
-EXCLAMATION_MARK
-EXISTING
-EXISTS
-EXP
-FILTER
-FINISH
-FIRST
-FLOAT
-FLOOR
-FOR
-FROM
-FUNCTION
-GENERAL_PARAMETER_REFERENCE
-GQLSTATUS
-GRANT
-GRAPH
-GRAVE_ACCENT
-GREATER_THAN_OR_EQUALS_OPERATOR
-GROUP
-GROUPS
-HAVING
-HOME_GRAPH
-HOME_PROPERTY_GRAPH
-HOME_SCHEMA
-HOUR
-IF
-IMPLIES
-IN
-INFINITY
-INSERT
-INSTANT
-INT
-INTEGER
-INTERSECT
-INTERVAL
-IS
-KEEP
-LABEL
-LABELED
-LABELS
-LAST
-LEADING
-LEFT
-LEFT_ANGLE_BRACKET
-LEFT_ARROW
-LEFT_ARROW_BRACKET
-LEFT_ARROW_TILDE
-LEFT_BRACE
-LEFT_BRACKET
-LEFT_MINUS_RIGHT
-LEFT_MINUS_SLASH
-LEFT_PAREN
-LEFT_TILDE_SLASH
-LESS_THAN_OR_EQUALS_OPERATOR
-LIKE
-LIST
-LOG
-LOG10
-LOWER
-LTRIM
-MATCH
-MAX
-MIN
-MINUS_LEFT_BRACKET
-MINUS_SIGN
-MINUTE
-MOD
-MODULUS
-MONTH
-MULTISET_ALTERNATION_OPERATOR
-NFKC
-NFKD
-NODE
-NODETACH
-NORMALIZE
-NOT
-NOT_EQUALS_OPERATOR
-NOTHING
-NULL
-NULLIF
-NUMBER
-NUMERIC
-OCTET_LENGTH
-OF
-ON
-ONLY
-OPEN
-OPTIONAL
-OR
-ORDER
-ORDINALITY
-OTHERWISE
-PARENT
-PARENTHESIZED
-PATH
-PATHS
-PERCENT
-PERIOD
-PLUS_SIGN
-POWER
-PRECISION
-PRIMARY
-PRIORITY
-PROCEDURE
-PRODUCT
-PROPERTIES
-PROPERTY
-PROPERTY_EXISTS
-QUANTIFIER
-QUOTE
-RADIANS
-REAL
-REFERENCE
-REFERENCES
-REFLECT
-REGULAR
-REMOVE
-RENAME
-REPEATABLE
-REPLACE
-RESET
-RETURN
-REVERSE_SOLIDUS
-REVOKE
-RIGHT
-RIGHT_ANGLE_BRACKET
-RIGHT_ARROW
-RIGHT_BRACE
-RIGHT_BRACKET
-RIGHT_BRACKET_MINUS
-RIGHT_BRACKET_TILDE
-RIGHT_DOUBLE_ARROW
-RIGHT_PAREN
-ROLLBACK
-RTRIM
-SAME
-SCHEMA
-SECOND
-SELECT
-SESSION
-SESSION_USER
-SET
-SHORTEST
-SIGNED
-SIMPLE
-SIMPLE_COMMENT_MINUS
-SIMPLE_COMMENT_SOLIDUS
-SIN
-SINGLE_QUOTED_CHARACTER_SEQUENCE
-SINH
-SIZE
-SKIP_RESERVED_WORD
-SLASH_MINUS
-SLASH_MINUS_RIGHT
-SLASH_TILDE
-SLASH_TILDE_RIGHT
-SMALL
-SMALLINT
-SOLIDUS
-SOURCE
-SP
-SQRT
-START
-STDDEV_POP
-STDDEV_SAMP
-STRING
-SUBSTITUTED_PARAMETER_REFERENCE
-SUBSTRING
-SUM
-SYSTEM_USER
-TABLE
-TAN
-TANH
-TEMP
-TEMPORAL
-THEN
-TILDE
-TILDE_LEFT_BRACKET
-TILDE_RIGHT_ARROW
-TILDE_SLASH
-TIME
-TIMESTAMP
-TO
-TRAIL
-TRAILING
-TRANSACTION
-TRIM
-TYPE
-TYPED
-UBIGINT
-UINT
-UNDERSCORE
-UNDIRECTED
-UNION
-UNIQUE
-UNIT
-UNSIGNED
-UNSIGNED_BINARY_INTEGER
-UNSIGNED_DECIMAL_INTEGER
-UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
-UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
-UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
-UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
-UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
-UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
-UNSIGNED_HEXADECIMAL_INTEGER
-UNSIGNED_OCTAL_INTEGER
-UPPER
-USE
-USMALLINT
-VALUE
-VALUES
-VARBINARY
-VARCHAR
-VARIABLE
-VERTEX
-VERTICAL_BAR
-WALK
-WHEN
-WHERE
-WHITESPACE
-WITH
-WITHOUT
-WRITE
-XOR
-YEAR
-YIELD
-ZONE
-ZONED
-ZONED_DATETIME
-ZONED_TIME
diff --git a/developer/test/Arithmetic_SyntaxAnnotate__Test_0.txt b/developer/test/Arithmetic_SyntaxAnnotate__Test_0.txt
deleted file mode 100644 (file)
index fe7e39e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-3 + 5
diff --git a/developer/test/Arithmetic_SyntaxAnnotate__Test_1.txt b/developer/test/Arithmetic_SyntaxAnnotate__Test_1.txt
deleted file mode 100644 (file)
index fe7e39e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-3 + 5
diff --git a/developer/test/Arithmetic_SyntaxAnnotate__Test_2.txt b/developer/test/Arithmetic_SyntaxAnnotate__Test_2.txt
deleted file mode 100644 (file)
index 1603bfc..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-2 * (3 + 4)
-
diff --git a/developer/test/Arithmetic_SyntaxAnnotate__Test_3.txt b/developer/test/Arithmetic_SyntaxAnnotate__Test_3.txt
deleted file mode 100644 (file)
index d11b7e2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-10 / 2
diff --git a/developer/test/Arithmetic_SyntaxAnnotate__Test_4.txt b/developer/test/Arithmetic_SyntaxAnnotate__Test_4.txt
deleted file mode 100644 (file)
index df1f368..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-3 + 5 * (10 - 4)
-
diff --git a/developer/test/Neo4NBA/create_relationship_0.cypher b/developer/test/Neo4NBA/create_relationship_0.cypher
deleted file mode 100644 (file)
index 1f35649..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-MATCH (player:Player {name: 'LeBron James'}), (team:Team {name: 'Lakers'})
-CREATE (player)-[:PLAYS_FOR]->(team)
diff --git a/developer/test/Neo4NBA/create_team_0.cypher b/developer/test/Neo4NBA/create_team_0.cypher
deleted file mode 100644 (file)
index 136ad4c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-CREATE (team:Team {name: 'Lakers', city: 'Los Angeles'})
diff --git a/developer/test/Neo4NBA/delete_player_and_relationship.cypher b/developer/test/Neo4NBA/delete_player_and_relationship.cypher
deleted file mode 100644 (file)
index 9f5d1b1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-MATCH (player:Player {name: 'LeBron James'})-[r:PLAYS_FOR]->(team:Team {name: 'Lakers'})
-DELETE r
-DELETE player
diff --git a/developer/test/Neo4NBA/notes.txt b/developer/test/Neo4NBA/notes.txt
deleted file mode 100644 (file)
index e6410e4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-https://github.com/iftahro/Neo4NBA
-
-It appears these Cypher examples also conform to GQL syntax.
-
diff --git a/developer/test/Neo4NBA/query_players_by_team_0.cypher b/developer/test/Neo4NBA/query_players_by_team_0.cypher
deleted file mode 100644 (file)
index 8098ef0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-MATCH (player:Player)-[:PLAYS_FOR]->(team:Team {name: 'Lakers'})
-RETURN player.name
diff --git a/developer/test/Neo4NBA/updating_nodes_0.cypher b/developer/test/Neo4NBA/updating_nodes_0.cypher
deleted file mode 100644 (file)
index aab1285..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-MATCH (team:Team {name: 'Lakers'})
-SET team.championships = 17
diff --git a/developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(double_colon).gql b/developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(double_colon).gql
deleted file mode 100644 (file)
index 376c053..0000000
+++ /dev/null
@@ -1 +0,0 @@
-CREATE GRAPH mySocialNetwork ::socialNetworkGraphType
diff --git a/developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(lexical).gql b/developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(lexical).gql
deleted file mode 100644 (file)
index b0a7160..0000000
+++ /dev/null
@@ -1 +0,0 @@
-CREATE GRAPH mySocialNetwork TYPED socialNetworkGraphType
diff --git a/developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_nested_graph_type_(double_colon).gql b/developer/test/opengql_grammar_samples_20240801/create_closed_graph_from_nested_graph_type_(double_colon).gql
deleted file mode 100644 (file)
index 2166f79..0000000
+++ /dev/null
@@ -1 +0,0 @@
-CREATE GRAPH mySocialNetwork ::{(City :City {name STRING, state STRING, country STRING})}
diff --git a/developer/test/opengql_grammar_samples_20240801/create_graph.gql b/developer/test/opengql_grammar_samples_20240801/create_graph.gql
deleted file mode 100644 (file)
index b415659..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-CREATE GRAPH mygraph ANY
-
-CREATE GRAPH mygraph {
-  (Person :Person {lastname STRING, firstname STRING,joined DATE})
-}
-
-CREATE GRAPH mygraph mygraphtype
-
-CREATE GRAPH /mygraph LIKE /mysrcgraph
-
-CREATE GRAPH mygraph ANY AS COPY OF mysrcgraph
-
-CREATE GRAPH mygraph {
-  (Person :Person {lastname STRING, firstname STRING,joined DATE})
-} AS COPY OF mysrcgraph
diff --git a/developer/test/opengql_grammar_samples_20240801/create_schema.gql b/developer/test/opengql_grammar_samples_20240801/create_schema.gql
deleted file mode 100644 (file)
index 7a2277f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CREATE SCHEMA /myschema
-
-CREATE SCHEMA /foo/myschema
-
-CREATE SCHEMA /foo
-NEXT CREATE SCHEMA /fee
diff --git a/developer/test/opengql_grammar_samples_20240801/insert_statement.gql b/developer/test/opengql_grammar_samples_20240801/insert_statement.gql
deleted file mode 100644 (file)
index 82e14eb..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT (:Person { firstname: 'Firstname', lastname: 'Lastname', joined: DATE '2023-01-01' })
-        -[:MEMBER_SINCE { since: "2023-03-20" }]->
-        (:Team { name: 'Teamname' })
diff --git a/developer/test/opengql_grammar_samples_20240801/match_and_insert_example.gql b/developer/test/opengql_grammar_samples_20240801/match_and_insert_example.gql
deleted file mode 100644 (file)
index 0e36828..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-MATCH (a { firstname: 'Robert' }), (b { lastname: 'Kowalski' })
-INSERT (a)-[:GRADUATED]->(b)
diff --git a/developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_braces).gql b/developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_braces).gql
deleted file mode 100644 (file)
index 86a8dd2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-MATCH (p:Person)-[r:IS_FRIENDS_WITH]->(friend:Person)
-WHERE EXISTS (MATCH (p)-[:WORKS_FOR]->(:Company {name: "GQL, Inc."}))
-RETURN p, r, friend
diff --git a/developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_parentheses).gql b/developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_parentheses).gql
deleted file mode 100644 (file)
index e4cb493..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-MATCH (p:Person)-[r:IS_FRIENDS_WITH]->(friend:Person)
-WHERE EXISTS (MATCH (p)-[:WORKS_FOR]->(:Company { name: "GQL, Inc."}) )
-RETURN p, r, friend
diff --git a/developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(nested_match_statement).gql b/developer/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(nested_match_statement).gql
deleted file mode 100644 (file)
index 9e461d8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-MATCH (p:Person)-[r:IS_FRIENDS_WITH]->(friend:Person)
-WHERE EXISTS { MATCH (p)-[:WORKS_FOR]->(:Company { name: "GQL, Inc." }) RETURN p }
-RETURN p, r, friend
diff --git a/developer/test/opengql_grammar_samples_20240801/session_set_graph_to_current_graph.gql b/developer/test/opengql_grammar_samples_20240801/session_set_graph_to_current_graph.gql
deleted file mode 100644 (file)
index 4b0e3fd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SESSION SET GRAPH CURRENT_GRAPH
diff --git a/developer/test/opengql_grammar_samples_20240801/session_set_graph_to_current_property_graph.gql b/developer/test/opengql_grammar_samples_20240801/session_set_graph_to_current_property_graph.gql
deleted file mode 100644 (file)
index 0565fda..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SESSION SET GRAPH CURRENT_PROPERTY_GRAPH
diff --git a/developer/test/opengql_grammar_samples_20240801/session_set_property_as_value.gql b/developer/test/opengql_grammar_samples_20240801/session_set_property_as_value.gql
deleted file mode 100644 (file)
index 7107a66..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SESSION SET VALUE IF NOT EXISTS $exampleProperty = DATE '2022-10-10'
diff --git a/developer/test/opengql_grammar_samples_20240801/session_set_time_zone.gql b/developer/test/opengql_grammar_samples_20240801/session_set_time_zone.gql
deleted file mode 100644 (file)
index f590e9b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SESSION SET TIME ZONE "utc"
diff --git a/developer/test/transcript_Arithmetic_Syntax__Test.sh b/developer/test/transcript_Arithmetic_Syntax__Test.sh
deleted file mode 100644 (file)
index d05b814..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-2024-09-05T01:46:03Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> make Arithmetic_Syntax__Test
-mkdir -p ANTLR javac jvm
-mkdir -p executor test deprecated experiment ologist temporary
-/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
-make[1]: Nothing to be done for 'all'.
-/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Syntax__Test
-ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
-making grammar from: ANTLR/Arithmetic.g4
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
-/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Syntax__Test
-ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
-Compiling javac/Arithmetic_Syntax__Test.java...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Syntax__Test.java
-Created jvm/Arithmetic_Syntax__Test.class
-Building Arithmetic_Syntax__Test...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Syntax__Test.jar -C jvm Arithmetic_Syntax__Test.class
-Created jvm/Arithmetic_Syntax__Test.jar
-Creating script for Arithmetic_Syntax__Test...
-chmod +x executor/Arithmetic_Syntax__Test
-Created script executor/Arithmetic_Syntax__Test
-
-2024-09-05T01:46:11Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax__Test
-Total tests run: 5
-Total tests passed: 5
-Total tests failed: 0
-
-2024-09-05T01:46:16Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> 
diff --git a/developer/test/transcript_RuleNameList.sh b/developer/test/transcript_RuleNameList.sh
deleted file mode 100644 (file)
index e2d089a..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-2024-09-05T07:24:43Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
-> make Arithmetic_Echo
-mkdir -p ANTLR javac jvm executor test deprecated experiment ologist temporary
-/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
-make[1]: Nothing to be done for 'all'.
-/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Echo
-copiling grammar from: ANTLR/Arithmetic.g4
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
-/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Echo
-Compiling javac/Arithmetic_Echo.java...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Echo.java
-Created jvm/Arithmetic_Echo.class
-Building Arithmetic_Echo...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Echo.jar -C jvm Arithmetic_Echo.class
-Created jvm/Arithmetic_Echo.jar
-Creating script for Arithmetic_Echo...
-chmod +x executor/Arithmetic_Echo
-Created script executor/Arithmetic_Echo
-
- [cut]
-
-2024-09-05T07:26:04Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
-> make RuleNameList
-mkdir -p ANTLR javac jvm executor test deprecated experiment ologist temporary
-/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
-make[1]: Nothing to be done for 'all'.
-/bin/make -f executor/makefile-project.mk -r --no-print-directory RuleNameList
-Compiling javac/RuleNameList.java...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/RuleNameList.java
-Created jvm/RuleNameList.class
-Building RuleNameList...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/RuleNameList.jar -C jvm RuleNameList.class
-Created jvm/RuleNameList.jar
-Creating script for RuleNameList...
-chmod +x executor/RuleNameList
-Created script executor/RuleNameList
-
-2024-09-05T07:28:47Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
-> RuleNameList Arithmetic
-Rule names found in the grammar:
-program
-expression
-
-2024-09-05T07:29:09Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
-> make ANTLRv4_Syntax
-mkdir -p ANTLR javac jvm executor test deprecated experiment ologist temporary
-/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
-make[1]: Nothing to be done for 'all'.
-/bin/make -f executor/makefile-project.mk -r --no-print-directory ANTLRv4_Syntax
-making lexer grammar from: ANTLR/ANTLRv4Lexer.g4
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/ANTLRv4Lexer.g4
-making other grammar files from: ANTLR/ANTLRv4Parser.g4
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -lib javac/ANTLR -o javac ANTLR/ANTLRv4Parser.g4
-executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4Visitor.java'.
-executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4BaseVisitor.java'.
-executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4Listener.java'.
-executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4BaseListener.java'.
-/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/ANTLRv4_Syntax
-Compiling javac/ANTLRv4_Syntax.java...
-
- [ had errors, but we only need the grammar to be made ]
-
-2024-09-05T07:31:03Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
-> RuleNameList ANTLRv4
-Rule names found in the grammar:
-grammarSpec
-grammarDecl
-grammarType
-prequelConstruct
-optionsSpec
-option
-optionValue
-delegateGrammars
-delegateGrammar
-tokensSpec
-channelsSpec
-idList
-action_
-actionScopeName
-actionBlock
-argActionBlock
-modeSpec
-rules
-ruleSpec
-parserRuleSpec
-exceptionGroup
-exceptionHandler
-finallyClause
-rulePrequel
-ruleReturns
-throwsSpec
-localsSpec
-ruleAction
-ruleModifiers
-ruleModifier
-ruleBlock
-ruleAltList
-labeledAlt
-lexerRuleSpec
-lexerRuleBlock
-lexerAltList
-lexerAlt
-lexerElements
-lexerElement
-lexerBlock
-lexerCommands
-lexerCommand
-lexerCommandName
-lexerCommandExpr
-altList
-alternative
-element
-predicateOptions
-predicateOption
-labeledElement
-ebnf
-blockSuffix
-ebnfSuffix
-lexerAtom
-atom
-notSet
-blockSet
-setElement
-block
-ruleref
-characterRange
-terminalDef
-elementOptions
-elementOption
-identifier
-
-2024-09-05T07:31:24Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
-> 
diff --git a/developer/test/transcript_notes.txt b/developer/test/transcript_notes.txt
deleted file mode 100644 (file)
index 2d48a3f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-2024-09-06T01:27:05Z[GQL_to_Cypher] In test file names the word `Syntax` was
-changed to `SyntaxAnnotate`.
-
diff --git a/developer/test/transcript_test_Arithmetic_Echo.sh b/developer/test/transcript_test_Arithmetic_Echo.sh
deleted file mode 100644 (file)
index 005a636..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-2024-09-05T01:03:35Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> make Arithmetic_Echo
-mkdir -p ANTLR javac jvm
-mkdir -p executor test deprecated experiment ologist temporary
-/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
-make[1]: Nothing to be done for 'all'.
-/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Echo
-ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
-making grammar from: ANTLR/Arithmetic.g4
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
-/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Echo
-ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
-Compiling javac/Arithmetic_Echo.java...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Echo.java
-Created jvm/Arithmetic_Echo.class
-Building Arithmetic_Echo...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Echo.jar -C jvm Arithmetic_Echo.class
-Created jvm/Arithmetic_Echo.jar
-Creating script for Arithmetic_Echo...
-chmod +x executor/Arithmetic_Echo
-Created script executor/Arithmetic_Echo
-
-2024-09-05T01:03:43Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Echo Arithmetic_Syntax__Test_0.txt
-(3 + 5)
-
-2024-09-05T01:04:01Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Echo Arithmetic_Syntax__Test_1.txt
-(3 + 5)
-
-2024-09-05T01:04:05Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Echo Arithmetic_Syntax__Test_2.txt
-(2 * (3 + 4))
-
-2024-09-05T01:04:11Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Echo Arithmetic_Syntax__Test_3.txt
-(10 / 2)
-
-2024-09-05T01:04:14Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Echo Arithmetic_Syntax__Test_4.txt
-(3 + (5 * (10 - 4)))
-
-2024-09-05T01:05:11Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> clean program Arithmetic_Echo
-Deleting program files for 'Arithmetic_Echo'
-
-2024-09-05T01:05:23Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
->
diff --git a/developer/test/transcript_test_Arithmetic_Syntax.sh b/developer/test/transcript_test_Arithmetic_Syntax.sh
deleted file mode 100644 (file)
index a46c4b1..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-2024-09-05T01:05:48Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> make Arithmetic_Syntax
-mkdir -p ANTLR javac jvm
-mkdir -p executor test deprecated experiment ologist temporary
-/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
-make[1]: Nothing to be done for 'all'.
-/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Syntax
-ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
-making grammar from: ANTLR/Arithmetic.g4
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
-/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Syntax
-ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
-Compiling javac/Arithmetic_Syntax.java...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Syntax.java
-Created jvm/Arithmetic_Syntax.class
-Building Arithmetic_Syntax...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Syntax.jar -C jvm Arithmetic_Syntax.class
-Created jvm/Arithmetic_Syntax.jar
-Creating script for Arithmetic_Syntax...
-chmod +x executor/Arithmetic_Syntax
-Created script executor/Arithmetic_Syntax
-
-2024-09-05T01:06:00Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_0.txt 
-program
-  expression(
-    expression(
-      INT(3)
-    )
-    operator(+)
-    expression(
-      INT(5)
-    )
-  )
-
-
-2024-09-05T01:06:28Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_1.txt 
-program
-  expression(
-    expression(
-      INT(3)
-    )
-    operator(+)
-    expression(
-      INT(5)
-    )
-  )
-
-
-2024-09-05T01:06:41Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_2.txt 
-program
-  expression(
-    expression(
-      INT(2)
-    )
-    operator(*)
-    expression(
-      (
-        expression(
-          expression(
-            INT(3)
-          )
-          operator(+)
-          expression(
-            INT(4)
-          )
-        )
-      )
-    )
-  )
-
-
-2024-09-05T01:06:46Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_3.txt 
-program
-  expression(
-    expression(
-      INT(10)
-    )
-    operator(/)
-    expression(
-      INT(2)
-    )
-  )
-
-
-2024-09-05T01:06:50Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_4.txt 
-program
-  expression(
-    expression(
-      INT(3)
-    )
-    operator(+)
-    expression(
-      expression(
-        INT(5)
-      )
-      operator(*)
-      expression(
-        (
-          expression(
-            expression(
-              INT(10)
-            )
-            operator(-)
-            expression(
-              INT(4)
-            )
-          )
-        )
-      )
-    )
-  )
-
-
-2024-09-05T01:06:57Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax Arithmetic_Syntax__Test_0.txt 
-program(expression(INT(3) operator(+) INT(5)))
-
-2024-09-05T01:07:12Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax Arithmetic_Syntax__Test_1.txt 
-program(expression(INT(3) operator(+) INT(5)))
-
-2024-09-05T01:07:17Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax Arithmetic_Syntax__Test_2.txt 
-program(expression(INT(2) operator(*) (expression(INT(3) operator(+) INT(4)))))
-
-2024-09-05T01:07:21Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax Arithmetic_Syntax__Test_3.txt 
-program(expression(INT(10) operator(/) INT(2)))
-
-2024-09-05T01:07:24Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> Arithmetic_Syntax Arithmetic_Syntax__Test_4.txt 
-program(expression(INT(3) operator(+) expression(INT(5) operator(*) (expression(INT(10) operator(-) INT(4))))))
-
-2024-09-05T01:07:29Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> clean program Arithmetic_Syntax
-Deleting program files for 'Arithmetic_Syntax'
-
-2024-09-05T01:07:53Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> 
diff --git a/developer/test/transcript_test_PrintRuleNameListRegx.sh b/developer/test/transcript_test_PrintRuleNameListRegx.sh
deleted file mode 100644 (file)
index f374647..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-2024-09-05T02:06:09Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
-> cd test
-
-2024-09-05T02:06:11Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> PrintRuleNameListRegx
-bash: /var/user_data/Thomas-developer/GQL_to_Cypher/developer/executor/PrintRuleNameListRegx: No such file or directory
-
-2024-09-05T02:06:18Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> make PrintRuleNameListRegx
-mkdir -p ANTLR javac jvm
-mkdir -p executor test deprecated experiment ologist temporary
-/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
-make[1]: Nothing to be done for 'all'.
-/bin/make -f executor/makefile-project.mk -r --no-print-directory PrintRuleNameListRegx
-Compiling javac/PrintRuleNameListRegx.java...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/PrintRuleNameListRegx.java
-Created jvm/PrintRuleNameListRegx.class
-Building PrintRuleNameListRegx...
-/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/PrintRuleNameListRegx.jar -C jvm PrintRuleNameListRegx.class
-Created jvm/PrintRuleNameListRegx.jar
-Creating script for PrintRuleNameListRegx...
-chmod +x executor/PrintRuleNameListRegx
-Created script executor/PrintRuleNameListRegx
-
-2024-09-05T02:06:39Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> PrintRuleNameListRegx
-Usage: PrintRuleNameListRegx <path-to-g4-file>
-
-2024-09-05T02:06:44Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> PrintRuleNameListRegx ../ANTLR/Arithmetic.g4 
-Extracted Rules:
-expression
-program
-WS
-INT
-
-2024-09-05T02:06:53Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> clean PrintRuleNameListRegx
-Unknown clean option: PrintRuleNameListRegx
-
-2024-09-05T02:07:18Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
-> clean program PrintRuleNameListRegx
-Deleting program files for 'PrintRuleNameListRegx'
-
-2024-09-05T02:07:25Z[GQL_to_Cypher]
-Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
->
-
diff --git a/developers/ANTLR/ANTLRv4Lexer.g4 b/developers/ANTLR/ANTLRv4Lexer.g4
new file mode 100644 (file)
index 0000000..bf389d0
--- /dev/null
@@ -0,0 +1,437 @@
+/*
+ * [The "BSD license"]
+ *  Copyright (c) 2012-2015 Terence Parr
+ *  Copyright (c) 2012-2015 Sam Harwell
+ *  Copyright (c) 2015 Gerald Rosenberg
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *  3. The name of the author may not be used to endorse or promote products
+ *     derived from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ *     A grammar for ANTLR v4 implemented using v4 syntax
+ *
+ *     Modified 2015.06.16 gbr
+ *     -- update for compatibility with Antlr v4.5
+ */
+
+// $antlr-format alignTrailingComments on, columnLimit 130, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments off
+// $antlr-format useTab off, allowShortRulesOnASingleLine off, allowShortBlocksOnASingleLine on, alignSemicolons hanging
+// $antlr-format alignColons hanging
+
+// ======================================================
+// Lexer specification
+// ======================================================
+
+lexer grammar ANTLRv4Lexer;
+
+options {
+    superClass = LexerAdaptor;
+}
+
+import LexBasic;
+
+// Standard set of fragments
+tokens {
+    TOKEN_REF,
+    RULE_REF,
+    LEXER_CHAR_SET
+}
+
+channels {
+    OFF_CHANNEL,
+    COMMENT
+}
+
+// -------------------------
+// Comments
+DOC_COMMENT
+    : DocComment -> channel (COMMENT)
+    ;
+
+BLOCK_COMMENT
+    : BlockComment -> channel (COMMENT)
+    ;
+
+LINE_COMMENT
+    : LineComment -> channel (COMMENT)
+    ;
+
+// -------------------------
+// Integer
+
+INT
+    : DecimalNumeral
+    ;
+
+// -------------------------
+// Literal string
+//
+// ANTLR makes no distinction between a single character literal and a
+// multi-character string. All literals are single quote delimited and
+// may contain unicode escape sequences of the form \uxxxx, where x
+// is a valid hexadecimal number (per Unicode standard).
+STRING_LITERAL
+    : SQuoteLiteral
+    ;
+
+UNTERMINATED_STRING_LITERAL
+    : USQuoteLiteral
+    ;
+
+// -------------------------
+// Arguments
+//
+// Certain argument lists, such as those specifying call parameters
+// to a rule invocation, or input parameters to a rule specification
+// are contained within square brackets.
+BEGIN_ARGUMENT
+    : LBrack { this.handleBeginArgument(); }
+    ;
+
+// -------------------------
+// Target Language Actions
+BEGIN_ACTION
+    : LBrace -> pushMode (TargetLanguageAction)
+    ;
+
+// -------------------------
+// Keywords
+//
+// 'options', 'tokens', and 'channels' are considered keywords
+// but only when followed by '{', and considered as a single token.
+// Otherwise, the symbols are tokenized as RULE_REF and allowed as
+// an identifier in a labeledElement.
+OPTIONS
+    : 'options' WSNLCHARS* '{'
+    ;
+
+TOKENS
+    : 'tokens' WSNLCHARS* '{'
+    ;
+
+CHANNELS
+    : 'channels' WSNLCHARS* '{'
+    ;
+
+fragment WSNLCHARS
+    : ' '
+    | '\t'
+    | '\f'
+    | '\n'
+    | '\r'
+    ;
+
+IMPORT
+    : 'import'
+    ;
+
+FRAGMENT
+    : 'fragment'
+    ;
+
+LEXER
+    : 'lexer'
+    ;
+
+PARSER
+    : 'parser'
+    ;
+
+GRAMMAR
+    : 'grammar'
+    ;
+
+PROTECTED
+    : 'protected'
+    ;
+
+PUBLIC
+    : 'public'
+    ;
+
+PRIVATE
+    : 'private'
+    ;
+
+RETURNS
+    : 'returns'
+    ;
+
+LOCALS
+    : 'locals'
+    ;
+
+THROWS
+    : 'throws'
+    ;
+
+CATCH
+    : 'catch'
+    ;
+
+FINALLY
+    : 'finally'
+    ;
+
+MODE
+    : 'mode'
+    ;
+
+// -------------------------
+// Punctuation
+
+COLON
+    : Colon
+    ;
+
+COLONCOLON
+    : DColon
+    ;
+
+COMMA
+    : Comma
+    ;
+
+SEMI
+    : Semi
+    ;
+
+LPAREN
+    : LParen
+    ;
+
+RPAREN
+    : RParen
+    ;
+
+LBRACE
+    : LBrace
+    ;
+
+RBRACE
+    : RBrace
+    ;
+
+RARROW
+    : RArrow
+    ;
+
+LT
+    : Lt
+    ;
+
+GT
+    : Gt
+    ;
+
+ASSIGN
+    : Equal
+    ;
+
+QUESTION
+    : Question
+    ;
+
+STAR
+    : Star
+    ;
+
+PLUS_ASSIGN
+    : PlusAssign
+    ;
+
+PLUS
+    : Plus
+    ;
+
+OR
+    : Pipe
+    ;
+
+DOLLAR
+    : Dollar
+    ;
+
+RANGE
+    : Range
+    ;
+
+DOT
+    : Dot
+    ;
+
+AT
+    : At
+    ;
+
+POUND
+    : Pound
+    ;
+
+NOT
+    : Tilde
+    ;
+
+// -------------------------
+// Identifiers - allows unicode rule/token names
+
+ID
+    : Id
+    ;
+
+// -------------------------
+// Whitespace
+
+WS
+    : Ws+ -> channel (OFF_CHANNEL)
+    ;
+
+// -------------------------
+// Illegal Characters
+//
+// This is an illegal character trap which is always the last rule in the
+// lexer specification. It matches a single character of any value and being
+// the last rule in the file will match when no other rule knows what to do
+// about the character. It is reported as an error but is not passed on to the
+// parser. This means that the parser to deal with the gramamr file anyway
+// but we will not try to analyse or code generate from a file with lexical
+// errors.
+
+// Comment this rule out to allow the error to be propagated to the parser
+ERRCHAR
+    : . -> channel (HIDDEN)
+    ;
+
+// ======================================================
+// Lexer modes
+// -------------------------
+// Arguments
+mode Argument;
+
+// E.g., [int x, List<String> a[]]
+NESTED_ARGUMENT
+    : LBrack -> type (ARGUMENT_CONTENT), pushMode (Argument)
+    ;
+
+ARGUMENT_ESCAPE
+    : EscAny -> type (ARGUMENT_CONTENT)
+    ;
+
+ARGUMENT_STRING_LITERAL
+    : DQuoteLiteral -> type (ARGUMENT_CONTENT)
+    ;
+
+ARGUMENT_CHAR_LITERAL
+    : SQuoteLiteral -> type (ARGUMENT_CONTENT)
+    ;
+
+END_ARGUMENT
+    : RBrack { this.handleEndArgument(); }
+    ;
+
+// added this to return non-EOF token type here. EOF does something weird
+UNTERMINATED_ARGUMENT
+    : EOF -> popMode
+    ;
+
+ARGUMENT_CONTENT
+    : .
+    ;
+
+// TODO: This grammar and the one used in the Intellij Antlr4 plugin differ
+// for "actions". This needs to be resolved at some point.
+// The Intellij Antlr4 grammar is here:
+// https://github.com/antlr/intellij-plugin-v4/blob/1f36fde17f7fa63cb18d7eeb9cb213815ac658fb/src/main/antlr/org/antlr/intellij/plugin/parser/ANTLRv4Lexer.g4#L587
+
+// -------------------------
+// Target Language Actions
+//
+// Many language targets use {} as block delimiters and so we
+// must recursively match {} delimited blocks to balance the
+// braces. Additionally, we must make some assumptions about
+// literal string representation in the target language. We assume
+// that they are delimited by ' or " and so consume these
+// in their own alts so as not to inadvertantly match {}.
+mode TargetLanguageAction;
+
+NESTED_ACTION
+    : LBrace -> type (ACTION_CONTENT), pushMode (TargetLanguageAction)
+    ;
+
+ACTION_ESCAPE
+    : EscAny -> type (ACTION_CONTENT)
+    ;
+
+ACTION_STRING_LITERAL
+    : DQuoteLiteral -> type (ACTION_CONTENT)
+    ;
+
+ACTION_CHAR_LITERAL
+    : SQuoteLiteral -> type (ACTION_CONTENT)
+    ;
+
+ACTION_DOC_COMMENT
+    : DocComment -> type (ACTION_CONTENT)
+    ;
+
+ACTION_BLOCK_COMMENT
+    : BlockComment -> type (ACTION_CONTENT)
+    ;
+
+ACTION_LINE_COMMENT
+    : LineComment -> type (ACTION_CONTENT)
+    ;
+
+END_ACTION
+    : RBrace { this.handleEndAction(); }
+    ;
+
+UNTERMINATED_ACTION
+    : EOF -> popMode
+    ;
+
+ACTION_CONTENT
+    : .
+    ;
+
+// -------------------------
+mode LexerCharSet;
+
+LEXER_CHAR_SET_BODY
+    : (~ [\]\\] | EscAny)+ -> more
+    ;
+
+LEXER_CHAR_SET
+    : RBrack -> popMode
+    ;
+
+UNTERMINATED_CHAR_SET
+    : EOF -> popMode
+    ;
+
+// ------------------------------------------------------------------------------
+// Grammar specific Keywords, Punctuation, etc.
+fragment Id
+    : NameStartChar NameChar*
+    ;
\ No newline at end of file
diff --git a/developers/ANTLR/ANTLRv4Parser.g4 b/developers/ANTLR/ANTLRv4Parser.g4
new file mode 100644 (file)
index 0000000..a4ff765
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * [The "BSD license"]
+ *  Copyright (c) 2012-2014 Terence Parr
+ *  Copyright (c) 2012-2014 Sam Harwell
+ *  Copyright (c) 2015 Gerald Rosenberg
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *  3. The name of the author may not be used to endorse or promote products
+ *     derived from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*     A grammar for ANTLR v4 written in ANTLR v4.
+ *
+ *     Modified 2015.06.16 gbr
+ *     -- update for compatibility with Antlr v4.5
+ *     -- add mode for channels
+ *     -- moved members to LexerAdaptor
+ *     -- move fragments to imports
+ */
+
+// $antlr-format alignTrailingComments on, columnLimit 130, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments off
+// $antlr-format useTab off, allowShortRulesOnASingleLine off, allowShortBlocksOnASingleLine on, alignSemicolons hanging
+// $antlr-format alignColons hanging
+
+parser grammar ANTLRv4Parser;
+
+options {
+    tokenVocab = ANTLRv4Lexer;
+}
+
+// The main entry point for parsing a v4 grammar.
+grammarSpec
+    : grammarDecl prequelConstruct* rules modeSpec* EOF
+    ;
+
+grammarDecl
+    : grammarType identifier SEMI
+    ;
+
+grammarType
+    : LEXER GRAMMAR
+    | PARSER GRAMMAR
+    | GRAMMAR
+    ;
+
+// This is the list of all constructs that can be declared before
+// the set of rules that compose the grammar, and is invoked 0..n
+// times by the grammarPrequel rule.
+
+prequelConstruct
+    : optionsSpec
+    | delegateGrammars
+    | tokensSpec
+    | channelsSpec
+    | action_
+    ;
+
+// ------------
+// Options - things that affect analysis and/or code generation
+
+optionsSpec
+    : OPTIONS (option SEMI)* RBRACE
+    ;
+
+option
+    : identifier ASSIGN optionValue
+    ;
+
+optionValue
+    : identifier (DOT identifier)*
+    | STRING_LITERAL
+    | actionBlock
+    | INT
+    ;
+
+// ------------
+// Delegates
+
+delegateGrammars
+    : IMPORT delegateGrammar (COMMA delegateGrammar)* SEMI
+    ;
+
+delegateGrammar
+    : identifier ASSIGN identifier
+    | identifier
+    ;
+
+// ------------
+// Tokens & Channels
+
+tokensSpec
+    : TOKENS idList? RBRACE
+    ;
+
+channelsSpec
+    : CHANNELS idList? RBRACE
+    ;
+
+idList
+    : identifier (COMMA identifier)* COMMA?
+    ;
+
+// Match stuff like @parser::members {int i;}
+
+action_
+    : AT (actionScopeName COLONCOLON)? identifier actionBlock
+    ;
+
+// Scope names could collide with keywords; allow them as ids for action scopes
+
+actionScopeName
+    : identifier
+    | LEXER
+    | PARSER
+    ;
+
+actionBlock
+    : BEGIN_ACTION ACTION_CONTENT* END_ACTION
+    ;
+
+argActionBlock
+    : BEGIN_ARGUMENT ARGUMENT_CONTENT* END_ARGUMENT
+    ;
+
+modeSpec
+    : MODE identifier SEMI lexerRuleSpec*
+    ;
+
+rules
+    : ruleSpec*
+    ;
+
+ruleSpec
+    : parserRuleSpec
+    | lexerRuleSpec
+    ;
+
+parserRuleSpec
+    : ruleModifiers? RULE_REF argActionBlock? ruleReturns? throwsSpec? localsSpec? rulePrequel* COLON ruleBlock SEMI
+        exceptionGroup
+    ;
+
+exceptionGroup
+    : exceptionHandler* finallyClause?
+    ;
+
+exceptionHandler
+    : CATCH argActionBlock actionBlock
+    ;
+
+finallyClause
+    : FINALLY actionBlock
+    ;
+
+rulePrequel
+    : optionsSpec
+    | ruleAction
+    ;
+
+ruleReturns
+    : RETURNS argActionBlock
+    ;
+
+// --------------
+// Exception spec
+throwsSpec
+    : THROWS identifier (COMMA identifier)*
+    ;
+
+localsSpec
+    : LOCALS argActionBlock
+    ;
+
+/** Match stuff like @init {int i;} */
+ruleAction
+    : AT identifier actionBlock
+    ;
+
+ruleModifiers
+    : ruleModifier+
+    ;
+
+// An individual access modifier for a rule. The 'fragment' modifier
+// is an internal indication for lexer rules that they do not match
+// from the input but are like subroutines for other lexer rules to
+// reuse for certain lexical patterns. The other modifiers are passed
+// to the code generation templates and may be ignored by the template
+// if they are of no use in that language.
+
+ruleModifier
+    : PUBLIC
+    | PRIVATE
+    | PROTECTED
+    | FRAGMENT
+    ;
+
+ruleBlock
+    : ruleAltList
+    ;
+
+ruleAltList
+    : labeledAlt (OR labeledAlt)*
+    ;
+
+labeledAlt
+    : alternative (POUND identifier)?
+    ;
+
+// --------------------
+// Lexer rules
+
+lexerRuleSpec
+    : FRAGMENT? TOKEN_REF optionsSpec? COLON lexerRuleBlock SEMI
+    ;
+
+lexerRuleBlock
+    : lexerAltList
+    ;
+
+lexerAltList
+    : lexerAlt (OR lexerAlt)*
+    ;
+
+lexerAlt
+    : lexerElements lexerCommands?
+    |
+    // explicitly allow empty alts
+    ;
+
+lexerElements
+    : lexerElement+
+    |
+    ;
+
+lexerElement
+    : lexerAtom ebnfSuffix?
+    | lexerBlock ebnfSuffix?
+    | actionBlock QUESTION?
+    ;
+
+// but preds can be anywhere
+
+lexerBlock
+    : LPAREN lexerAltList RPAREN
+    ;
+
+// E.g., channel(HIDDEN), skip, more, mode(INSIDE), push(INSIDE), pop
+
+lexerCommands
+    : RARROW lexerCommand (COMMA lexerCommand)*
+    ;
+
+lexerCommand
+    : lexerCommandName LPAREN lexerCommandExpr RPAREN
+    | lexerCommandName
+    ;
+
+lexerCommandName
+    : identifier
+    | MODE
+    ;
+
+lexerCommandExpr
+    : identifier
+    | INT
+    ;
+
+// --------------------
+// Rule Alts
+
+altList
+    : alternative (OR alternative)*
+    ;
+
+alternative
+    : elementOptions? element+
+    |
+    // explicitly allow empty alts
+    ;
+
+element
+    : labeledElement (ebnfSuffix |)
+    | atom (ebnfSuffix |)
+    | ebnf
+    | actionBlock (QUESTION predicateOptions?)?
+    ;
+
+predicateOptions
+    : LT predicateOption (COMMA predicateOption)* GT
+    ;
+
+predicateOption
+    : elementOption
+    | identifier ASSIGN actionBlock
+    ;
+
+labeledElement
+    : identifier (ASSIGN | PLUS_ASSIGN) (atom | block)
+    ;
+
+// --------------------
+// EBNF and blocks
+
+ebnf
+    : block blockSuffix?
+    ;
+
+blockSuffix
+    : ebnfSuffix
+    ;
+
+ebnfSuffix
+    : QUESTION QUESTION?
+    | STAR QUESTION?
+    | PLUS QUESTION?
+    ;
+
+lexerAtom
+    : characterRange
+    | terminalDef
+    | notSet
+    | LEXER_CHAR_SET
+    | DOT elementOptions?
+    ;
+
+atom
+    : terminalDef
+    | ruleref
+    | notSet
+    | DOT elementOptions?
+    ;
+
+// --------------------
+// Inverted element set
+notSet
+    : NOT setElement
+    | NOT blockSet
+    ;
+
+blockSet
+    : LPAREN setElement (OR setElement)* RPAREN
+    ;
+
+setElement
+    : TOKEN_REF elementOptions?
+    | STRING_LITERAL elementOptions?
+    | characterRange
+    | LEXER_CHAR_SET
+    ;
+
+// -------------
+// Grammar Block
+block
+    : LPAREN (optionsSpec? ruleAction* COLON)? altList RPAREN
+    ;
+
+// ----------------
+// Parser rule ref
+ruleref
+    : RULE_REF argActionBlock? elementOptions?
+    ;
+
+// ---------------
+// Character Range
+characterRange
+    : STRING_LITERAL RANGE STRING_LITERAL
+    ;
+
+terminalDef
+    : TOKEN_REF elementOptions?
+    | STRING_LITERAL elementOptions?
+    ;
+
+// Terminals may be adorned with certain options when
+// reference in the grammar: TOK<,,,>
+elementOptions
+    : LT elementOption (COMMA elementOption)* GT
+    ;
+
+elementOption
+    : identifier
+    | identifier ASSIGN (identifier | STRING_LITERAL)
+    ;
+
+identifier
+    : RULE_REF
+    | TOKEN_REF
+    ;
\ No newline at end of file
diff --git a/developers/ANTLR/Arithmetic.g4 b/developers/ANTLR/Arithmetic.g4
new file mode 100644 (file)
index 0000000..4a61ec4
--- /dev/null
@@ -0,0 +1,14 @@
+grammar Arithmetic;
+
+program:   expression EOF;
+
+expression
+    : expression ('*'|'/') expression
+    | expression ('+'|'-') expression
+    | '(' expression ')'
+    | INT
+    ;
+
+INT: [0-9]+;
+
+WS: [ \t\r\n]+ -> skip;
diff --git a/developers/ANTLR/Arithmetic2.g4 b/developers/ANTLR/Arithmetic2.g4
new file mode 100644 (file)
index 0000000..88fea64
--- /dev/null
@@ -0,0 +1,24 @@
+grammar Arithmetic2;
+
+program:   statement+ EOF;
+
+statement
+    : expression
+    | variable '=' expression
+    ;
+
+expression
+    : expression ('*'|'/') expression
+    | expression ('+'|'-') expression
+    | '(' expression ')'
+    | variable
+    | INT
+    ;
+
+variable: VARIABLE;
+
+INT: [0-9]+;
+
+VARIABLE: [a-zA-Z]+;
+
+WS: [ \t\r\n]+ -> skip;
diff --git a/developers/ANTLR/GQL_20240412.g4 b/developers/ANTLR/GQL_20240412.g4
new file mode 100644 (file)
index 0000000..ea8517c
--- /dev/null
@@ -0,0 +1,3778 @@
+grammar GQL_20240412;
+        
+options { caseInsensitive = true; }
+
+// 6 <GQL-program>
+
+gqlProgram
+    : programActivity sessionCloseCommand? EOF
+    | sessionCloseCommand EOF
+    ;
+
+programActivity
+    : sessionActivity
+    | transactionActivity
+    ;
+
+sessionActivity
+    : sessionResetCommand+
+    | sessionSetCommand+ sessionResetCommand*
+    ;
+
+transactionActivity
+    : startTransactionCommand (procedureSpecification endTransactionCommand?)?
+    | procedureSpecification endTransactionCommand?
+    | endTransactionCommand
+    ;
+
+endTransactionCommand
+    : rollbackCommand
+    | commitCommand
+    ;
+
+// 7.1 <session set command>
+
+sessionSetCommand
+    : SESSION SET (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
+    ;
+
+sessionSetSchemaClause
+    : SCHEMA schemaReference
+    ;
+
+sessionSetGraphClause
+    : PROPERTY? GRAPH graphExpression
+    ;
+
+sessionSetTimeZoneClause
+    : TIME ZONE setTimeZoneValue
+    ;
+
+setTimeZoneValue
+    : timeZoneString
+    ;
+
+sessionSetParameterClause
+    : sessionSetGraphParameterClause
+    | sessionSetBindingTableParameterClause
+    | sessionSetValueParameterClause
+    ;
+
+sessionSetGraphParameterClause
+    : PROPERTY? GRAPH sessionSetParameterName optTypedGraphInitializer
+    ;
+
+sessionSetBindingTableParameterClause
+    : BINDING? TABLE sessionSetParameterName optTypedBindingTableInitializer
+    ;
+
+sessionSetValueParameterClause
+    : VALUE sessionSetParameterName optTypedValueInitializer
+    ;
+
+sessionSetParameterName
+    : (IF NOT EXISTS)? sessionParameterSpecification
+    ;
+
+// 7.2 <session reset command>
+
+sessionResetCommand
+    : SESSION RESET sessionResetArguments?
+    ;
+
+sessionResetArguments
+    : ALL? (PARAMETERS | CHARACTERISTICS)
+    | SCHEMA
+    | PROPERTY? GRAPH
+    | TIME ZONE
+    | PARAMETER? sessionParameterSpecification
+    ;
+
+// 7.3 <session close command>
+
+sessionCloseCommand
+    : SESSION CLOSE
+    ;
+
+// 7.4 <session parameter specification>
+
+sessionParameterSpecification
+    : GENERAL_PARAMETER_REFERENCE
+    ;
+
+// 8.1 <start transaction command>
+
+startTransactionCommand
+    : START TRANSACTION transactionCharacteristics?
+    ;
+
+// 8.2 <transaction characteristics>
+
+transactionCharacteristics
+    : transactionMode (COMMA transactionMode)*
+    ;
+
+transactionMode
+    : transactionAccessMode
+    ;
+
+transactionAccessMode
+    : READ ONLY
+    | READ WRITE
+    ;
+
+// 8.3 <rollback command>
+
+rollbackCommand
+    : ROLLBACK
+    ;
+
+// 8.4 <commit command>
+
+commitCommand
+    : COMMIT
+    ;
+
+// 9.1 <nested procedure specification>
+
+nestedProcedureSpecification
+    : LEFT_BRACE procedureSpecification RIGHT_BRACE
+    ;
+
+// <catalog-modifying procedure specification>, <data-modifying procedure specification> and <query specification> are
+// identical productions. The specification distinguishes them in the BNF, but in the implementation, the distinction
+// has to be made sematically, in code, based on the kind of statements contained in the <procedure specification>.
+procedureSpecification
+    : procedureBody
+//    : catalogModifyingProcedureSpecification
+//    | dataModifyingProcedureSpecification
+//    | querySpecification
+    ;
+
+//catalogModifyingProcedureSpecification
+//    : procedureBody
+//    ;
+
+nestedDataModifyingProcedureSpecification
+    : LEFT_BRACE procedureBody RIGHT_BRACE
+    ;
+
+//dataModifyingProcedureSpecification
+//    : procedureBody
+//    ;
+
+nestedQuerySpecification
+    : LEFT_BRACE procedureBody RIGHT_BRACE
+    ;
+
+//querySpecification
+//    : procedureBody
+//    ;
+
+// 9.2 <procedure body>
+
+procedureBody
+    : atSchemaClause? bindingVariableDefinitionBlock? statementBlock
+    ;
+
+bindingVariableDefinitionBlock
+    : bindingVariableDefinition+
+    ;
+
+bindingVariableDefinition
+    : graphVariableDefinition
+    | bindingTableVariableDefinition
+    | valueVariableDefinition
+    ;
+
+statementBlock
+    : statement nextStatement*
+    ;
+
+statement
+    : linearCatalogModifyingStatement
+    | linearDataModifyingStatement
+    | compositeQueryStatement
+    ;
+
+nextStatement
+    : NEXT yieldClause? statement
+    ;
+
+// 10.1 <graph variable definition>
+
+graphVariableDefinition
+    : PROPERTY? GRAPH bindingVariable optTypedGraphInitializer
+    ;
+
+optTypedGraphInitializer
+    : (typed? graphReferenceValueType)? graphInitializer
+    ;
+
+graphInitializer
+    : EQUALS_OPERATOR graphExpression
+    ;
+
+// 10.2 <binding table variable definition>
+
+bindingTableVariableDefinition
+    : BINDING? TABLE bindingVariable optTypedBindingTableInitializer
+    ;
+
+optTypedBindingTableInitializer
+    : (typed? bindingTableReferenceValueType)? bindingTableInitializer
+    ;
+
+bindingTableInitializer
+    : EQUALS_OPERATOR bindingTableExpression
+    ;
+
+// 10.3 <value variable definition>
+
+valueVariableDefinition
+    : VALUE bindingVariable optTypedValueInitializer
+    ;
+
+optTypedValueInitializer
+    : (typed? valueType)? valueInitializer
+    ;
+
+valueInitializer
+    : EQUALS_OPERATOR valueExpression
+    ;
+
+// 11.1 <graph expression>
+
+graphExpression
+    : objectExpressionPrimary
+    | graphReference
+    | objectNameOrBindingVariable
+    | currentGraph
+    ;
+
+currentGraph
+    : CURRENT_PROPERTY_GRAPH
+    | CURRENT_GRAPH
+    ;
+
+// 11.2 <binding table expression>
+
+bindingTableExpression
+    : nestedBindingTableQuerySpecification
+    | objectExpressionPrimary
+    | bindingTableReference
+    | objectNameOrBindingVariable
+    ;
+
+nestedBindingTableQuerySpecification
+    : nestedQuerySpecification
+    ;
+
+// 11.3 <object expression primary>
+
+objectExpressionPrimary
+    : VARIABLE valueExpressionPrimary
+    | parenthesizedValueExpression
+    | nonParenthesizedValueExpressionPrimarySpecialCase
+    ;
+
+// 12.1 <linear catalog-modifying statement>
+
+linearCatalogModifyingStatement
+    : simpleCatalogModifyingStatement+
+    ;
+
+simpleCatalogModifyingStatement
+    : primitiveCatalogModifyingStatement
+    | callCatalogModifyingProcedureStatement
+    ;
+
+primitiveCatalogModifyingStatement
+    : createSchemaStatement
+    | dropSchemaStatement
+    | createGraphStatement
+    | dropGraphStatement
+    | createGraphTypeStatement
+    | dropGraphTypeStatement
+    ;
+
+// 12.2 <insert schema statement>
+
+createSchemaStatement
+    : CREATE SCHEMA (IF NOT EXISTS)? catalogSchemaParentAndName
+    ;
+
+// 12.3 <drop schema statement>
+
+dropSchemaStatement
+    : DROP SCHEMA (IF EXISTS)? catalogSchemaParentAndName
+    ;
+
+// 12.4 <insert graph statement>
+
+createGraphStatement
+    : CREATE (PROPERTY? GRAPH (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+    ;
+
+openGraphType
+    : typed? ANY (PROPERTY? GRAPH)?
+    ;
+
+ofGraphType
+    : graphTypeLikeGraph
+    | typed? graphTypeReference
+    | typed? (PROPERTY? GRAPH)? nestedGraphTypeSpecification
+    ;
+
+graphTypeLikeGraph
+    : LIKE graphExpression
+    ;
+
+graphSource
+    : AS COPY OF graphExpression
+    ;
+
+// 12.5 <drop graph statement>
+
+dropGraphStatement
+    : DROP PROPERTY? GRAPH (IF EXISTS)? catalogGraphParentAndName
+    ;
+
+// 12.6 <graph type statement>
+
+createGraphTypeStatement
+    : CREATE (PROPERTY? GRAPH TYPE (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH TYPE) catalogGraphTypeParentAndName graphTypeSource
+    ;
+
+graphTypeSource
+    : AS? copyOfGraphType
+    | graphTypeLikeGraph
+    | AS? nestedGraphTypeSpecification
+    ;
+
+copyOfGraphType
+    : COPY OF graphTypeReference
+    ;
+
+// 12.7 <drop graph statement>
+
+dropGraphTypeStatement
+    : DROP PROPERTY? GRAPH TYPE (IF EXISTS)? catalogGraphTypeParentAndName
+    ;
+
+// 12.8 <call catalog-modifying statement>
+
+callCatalogModifyingProcedureStatement
+    : callProcedureStatement
+    ;
+
+// 13.1 <linear data-modifying statement>
+
+linearDataModifyingStatement
+    : focusedLinearDataModifyingStatement
+    | ambientLinearDataModifyingStatement
+    ;
+
+focusedLinearDataModifyingStatement
+    : focusedLinearDataModifyingStatementBody
+    | focusedNestedDataModifyingProcedureSpecification
+    ;
+
+focusedLinearDataModifyingStatementBody
+    : useGraphClause simpleLinearDataAccessingStatement primitiveResultStatement?
+    ;
+
+focusedNestedDataModifyingProcedureSpecification
+    : useGraphClause nestedDataModifyingProcedureSpecification
+    ;
+
+ambientLinearDataModifyingStatement
+    : ambientLinearDataModifyingStatementBody
+    | nestedDataModifyingProcedureSpecification
+    ;
+
+ambientLinearDataModifyingStatementBody
+    : simpleLinearDataAccessingStatement primitiveResultStatement?
+    ;
+
+simpleLinearDataAccessingStatement
+    : simpleQueryStatement* simpleDataModifyingStatement+
+    ;
+
+// Subsumed by previous rule to enforce 13.1 SR 5
+//simpleDataAccessingStatement
+//    : simpleQueryStatement
+//    | simpleDataModifyingStatement
+//    ;
+
+simpleDataModifyingStatement
+    : primitiveDataModifyingStatement
+    | callDataModifyingProcedureStatement
+    ;
+
+primitiveDataModifyingStatement
+    : insertStatement
+    | setStatement
+    | removeStatement
+    | deleteStatement
+    ;
+
+// 13.2 <insertStatement>
+
+insertStatement
+    : INSERT insertGraphPattern
+    ;
+
+// 13.3 <set statement>
+
+setStatement
+    : SET setItemList
+    ;
+
+setItemList
+    : setItem (COMMA setItem)*
+    ;
+
+setItem
+    : setPropertyItem
+    | setAllPropertiesItem
+    | setLabelItem
+    ;
+
+setPropertyItem
+    : bindingVariableReference PERIOD propertyName EQUALS_OPERATOR valueExpression
+    ;
+
+setAllPropertiesItem
+    : bindingVariableReference EQUALS_OPERATOR LEFT_BRACE propertyKeyValuePairList? RIGHT_BRACE
+    ;
+
+setLabelItem
+    : bindingVariableReference isOrColon labelName
+    ;
+
+// 13.4 <remove statement>
+
+removeStatement
+    : REMOVE removeItemList
+    ;
+
+removeItemList
+    : removeItem (COMMA removeItem)*
+    ;
+
+removeItem
+    : removePropertyItem
+    | removeLabelItem
+    ;
+
+removePropertyItem
+    : bindingVariableReference PERIOD propertyName
+    ;
+
+removeLabelItem
+    : bindingVariableReference isOrColon labelName
+    ;
+
+// 13.5 <delete statement>
+
+deleteStatement
+    : (DETACH | NODETACH)? DELETE deleteItemList
+    ;
+
+deleteItemList
+    : deleteItem (COMMA deleteItem)*
+    ;
+
+deleteItem
+    : valueExpression
+    ;
+
+// 13.6 <call data-modifying procedure statement>
+
+callDataModifyingProcedureStatement
+    : callProcedureStatement
+    ;
+
+// 14.1 <composite query statement>
+
+compositeQueryStatement
+    : compositeQueryExpression
+    ;
+
+// 14.2 <composite query expression>
+
+compositeQueryExpression
+    : compositeQueryExpression queryConjunction compositeQueryPrimary
+    | compositeQueryPrimary
+    ;
+
+queryConjunction
+    : setOperator
+    | OTHERWISE
+    ;
+
+setOperator
+    : UNION setQuantifier?
+    | EXCEPT setQuantifier?
+    | INTERSECT setQuantifier?
+    ;
+
+compositeQueryPrimary
+    : linearQueryStatement
+    ;
+
+// 14.3 <linear query statement> and <simple query statement>
+
+linearQueryStatement
+    : focusedLinearQueryStatement
+    | ambientLinearQueryStatement
+    ;
+
+focusedLinearQueryStatement
+    : focusedLinearQueryStatementPart* focusedLinearQueryAndPrimitiveResultStatementPart
+    | focusedPrimitiveResultStatement
+    | focusedNestedQuerySpecification
+    | selectStatement
+    ;
+
+focusedLinearQueryStatementPart
+    : useGraphClause simpleLinearQueryStatement
+    ;
+
+focusedLinearQueryAndPrimitiveResultStatementPart
+    : useGraphClause simpleLinearQueryStatement primitiveResultStatement
+    ;
+
+focusedPrimitiveResultStatement
+    : useGraphClause primitiveResultStatement
+    ;
+
+focusedNestedQuerySpecification
+    : useGraphClause nestedQuerySpecification
+    ;
+
+ambientLinearQueryStatement
+    : simpleLinearQueryStatement? primitiveResultStatement
+    | nestedQuerySpecification
+    ;
+
+simpleLinearQueryStatement
+    : simpleQueryStatement+
+    ;
+
+simpleQueryStatement
+    : primitiveQueryStatement
+    | callQueryStatement
+    ;
+
+primitiveQueryStatement
+    : matchStatement
+    | letStatement
+    | forStatement
+    | filterStatement
+    | orderByAndPageStatement
+    ;
+
+// 14.4 <match statement>
+
+matchStatement
+    : simpleMatchStatement
+    | optionalMatchStatement
+    ;
+
+simpleMatchStatement
+    : MATCH graphPatternBindingTable
+    ;
+
+optionalMatchStatement
+    : OPTIONAL optionalOperand
+    ;
+
+optionalOperand
+    : simpleMatchStatement
+    | LEFT_BRACE matchStatementBlock RIGHT_BRACE
+    | LEFT_PAREN matchStatementBlock RIGHT_PAREN
+    ;
+
+matchStatementBlock
+    : matchStatement+
+    ;
+
+// 14.5 <call query statement>
+
+callQueryStatement
+    : callProcedureStatement
+    ;
+
+// 14.6 <filter statement>
+
+filterStatement
+    : FILTER (whereClause | searchCondition)
+    ;
+
+// 14.7 <let statement>
+
+letStatement
+    : LET letVariableDefinitionList
+    ;
+
+letVariableDefinitionList
+    : letVariableDefinition (COMMA letVariableDefinition)*
+    ;
+
+letVariableDefinition
+    : valueVariableDefinition
+    | bindingVariable EQUALS_OPERATOR valueExpression
+    ;
+
+// 14.8 <for statement>
+
+forStatement
+    : FOR forItem forOrdinalityOrOffset?
+    ;
+
+forItem
+    : forItemAlias forItemSource
+    ;
+
+forItemAlias
+    : bindingVariable IN
+    ;
+
+forItemSource
+    : valueExpression
+    ;
+
+forOrdinalityOrOffset
+    : WITH (ORDINALITY | OFFSET) bindingVariable
+    ;
+
+// 14.9 <order by and page statement>
+
+orderByAndPageStatement
+    : orderByClause offsetClause? limitClause?
+    | offsetClause limitClause?
+    | limitClause
+    ;
+
+// 14.10 <primitive result statement>
+
+primitiveResultStatement
+    : returnStatement orderByAndPageStatement?
+    | FINISH
+    ;
+
+// 14.11 <return statement>
+
+returnStatement
+    : RETURN returnStatementBody
+    ;
+
+returnStatementBody
+    : setQuantifier? (ASTERISK | returnItemList) groupByClause?
+    | NO BINDINGS
+    ;
+
+returnItemList
+    : returnItem (COMMA returnItem)*
+    ;
+
+returnItem
+    : aggregatingValueExpression returnItemAlias?
+    ;
+
+returnItemAlias
+    : AS identifier
+    ;
+
+// 14.12 <select statement>
+
+selectStatement
+    : SELECT setQuantifier? (ASTERISK | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
+    ;
+
+selectItemList
+    : selectItem (COMMA selectItem)*
+    ;
+
+selectItem
+    : aggregatingValueExpression selectItemAlias?
+    ;
+
+selectItemAlias
+    : AS identifier
+    ;
+
+havingClause
+    : HAVING searchCondition
+    ;
+
+selectStatementBody
+    : FROM (selectGraphMatchList | selectQuerySpecification)
+    ;
+
+selectGraphMatchList
+    : selectGraphMatch (COMMA selectGraphMatch)*
+    ;
+
+selectGraphMatch
+    : graphExpression matchStatement
+    ;
+
+selectQuerySpecification
+    : nestedQuerySpecification
+    | graphExpression nestedQuerySpecification
+    ;
+
+// 15.1 <call procedure statement> and <procedure call>
+
+callProcedureStatement
+    : OPTIONAL? CALL procedureCall
+    ;
+
+procedureCall
+    : inlineProcedureCall
+    | namedProcedureCall
+    ;
+
+// 15.2 <inline procedure call>
+
+inlineProcedureCall
+    : variableScopeClause? nestedProcedureSpecification
+    ;
+
+variableScopeClause
+    : LEFT_PAREN bindingVariableReferenceList? RIGHT_PAREN
+    ;
+
+bindingVariableReferenceList
+    : bindingVariableReference (COMMA bindingVariableReference)*
+    ;
+
+// 15.3 <named procedure call>
+
+namedProcedureCall
+    : procedureReference LEFT_PAREN procedureArgumentList? RIGHT_PAREN yieldClause?
+    ;
+
+procedureArgumentList
+    : procedureArgument (COMMA procedureArgument)*
+    ;
+
+procedureArgument
+    : valueExpression
+    ;
+
+// 16.1 <at schema clasue>
+
+atSchemaClause
+    : AT schemaReference
+    ;
+
+// 16.2 <use graph clause>
+
+useGraphClause
+    : USE graphExpression
+    ;
+
+// 16.3 <graph pattern binding table>
+
+graphPatternBindingTable
+    : graphPattern graphPatternYieldClause?
+    ;
+
+graphPatternYieldClause
+    : YIELD graphPatternYieldItemList
+    ;
+
+graphPatternYieldItemList
+    : graphPatternYieldItem (COMMA graphPatternYieldItem)*
+    | NO BINDINGS
+    ;
+
+// <elemement variable reference> and <path variable reference> are identical productions, both consisting
+// of a single non-terminal <binding variable reference>. Thus <graph pattern yield item> is ambiguous
+// from a parsing standpoint. So here we simply use bindingVariableReference. Post parsing code must
+// apply the semantics assocaited with each type of <binding variable reference>.
+graphPatternYieldItem
+    : bindingVariableReference
+//    : elementVariableReference
+//    | pathVariableReference
+    ;
+
+// 16.4 <graph pattern>
+
+graphPattern
+    : matchMode? pathPatternList keepClause? graphPatternWhereClause?
+    ;
+
+matchMode
+    : repeatableElementsMatchMode
+    | differentEdgesMatchMode
+    ;
+
+repeatableElementsMatchMode
+    : REPEATABLE elementBindingsOrElements
+    ;
+
+differentEdgesMatchMode
+    : DIFFERENT edgeBindingsOrEdges
+    ;
+
+elementBindingsOrElements
+    : ELEMENT BINDINGS?
+    | ELEMENTS
+    ;
+
+edgeBindingsOrEdges
+    : edgeSynonym BINDINGS?
+    | edgesSynonym
+    ;
+
+pathPatternList
+    : pathPattern (COMMA pathPattern)*
+    ;
+
+pathPattern
+    : pathVariableDeclaration? pathPatternPrefix? pathPatternExpression
+    ;
+
+pathVariableDeclaration
+    : pathVariable EQUALS_OPERATOR
+    ;
+
+keepClause
+    : KEEP pathPatternPrefix
+    ;
+
+graphPatternWhereClause
+    : WHERE searchCondition
+    ;
+
+// 16.5 <insert graph pattern>
+
+insertGraphPattern
+    : insertPathPatternList
+    ;
+
+insertPathPatternList
+    : insertPathPattern (COMMA insertPathPattern)*
+    ;
+
+insertPathPattern
+    : insertNodePattern (insertEdgePattern insertNodePattern)*
+    ;
+
+insertNodePattern
+    : LEFT_PAREN insertElementPatternFiller? RIGHT_PAREN
+    ;
+
+insertEdgePattern
+    : insertEdgePointingLeft
+    | insertEdgePointingRight
+    | insertEdgeUndirected
+    ;
+
+insertEdgePointingLeft
+    : LEFT_ARROW_BRACKET insertElementPatternFiller? RIGHT_BRACKET_MINUS
+    ;
+
+insertEdgePointingRight
+    : MINUS_LEFT_BRACKET insertElementPatternFiller? BRACKET_RIGHT_ARROW
+    ;
+
+insertEdgeUndirected
+    : TILDE_LEFT_BRACKET insertElementPatternFiller? RIGHT_BRACKET_TILDE
+    ;
+
+insertElementPatternFiller
+    : elementVariableDeclaration labelAndPropertySetSpecification?
+    | elementVariableDeclaration? labelAndPropertySetSpecification
+    ;
+
+labelAndPropertySetSpecification
+    : isOrColon labelSetSpecification elementPropertySpecification?
+    | (isOrColon labelSetSpecification)? elementPropertySpecification
+    ;
+
+// 16.6 <path pattern prefix>
+
+pathPatternPrefix
+    : pathModePrefix
+    | pathSearchPrefix
+    ;
+
+pathModePrefix
+    : pathMode pathOrPaths?
+    ;
+
+pathMode
+    : WALK
+    | TRAIL
+    | SIMPLE
+    | ACYCLIC
+    ;
+
+pathSearchPrefix
+    : allPathSearch
+    | anyPathSearch
+    | shortestPathSearch
+    ;
+
+allPathSearch
+    : ALL pathMode? pathOrPaths?
+    ;
+
+pathOrPaths
+    : PATH
+    | PATHS
+    ;
+
+anyPathSearch
+    : ANY numberOfPaths? pathMode? pathOrPaths?
+    ;
+
+numberOfPaths
+    : nonNegativeIntegerSpecification
+    ;
+
+shortestPathSearch
+    : allShortestPathSearch
+    | anyShortestPathSearch
+    | countedShortestPathSearch
+    | countedShortestGroupSearch
+    ;
+
+allShortestPathSearch
+    : ALL SHORTEST pathMode? pathOrPaths?
+    ;
+
+anyShortestPathSearch
+    : ANY SHORTEST pathMode? pathOrPaths?
+    ;
+
+countedShortestPathSearch
+    : SHORTEST numberOfPaths pathMode? pathOrPaths?
+    ;
+
+countedShortestGroupSearch
+    : SHORTEST numberOfGroups? pathMode? pathOrPaths? (GROUP | GROUPS)
+    ;
+
+numberOfGroups
+    : nonNegativeIntegerSpecification
+    ;
+
+// 16.7 <path pattern expression>
+
+pathPatternExpression
+    : pathTerm                                              #ppePathTerm
+    | pathTerm (MULTISET_ALTERNATION_OPERATOR pathTerm)+    #ppeMultisetAlternation
+    | pathTerm (VERTICAL_BAR pathTerm)+                     #ppePatternUnion
+    ;
+
+pathTerm
+    : pathFactor+
+    ;
+
+pathFactor
+    : pathPrimary                           #pfPathPrimary
+    | pathPrimary graphPatternQuantifier    #pfQuantifiedPathPrimary
+    | pathPrimary QUESTION_MARK             #pfQuestionedPathPrimary
+    ;
+
+pathPrimary
+    : elementPattern                        #ppElementPattern
+    | parenthesizedPathPatternExpression    #ppParenthesizedPathPatternExpression
+    | simplifiedPathPatternExpression       #ppSimplifiedPathPatternExpression
+    ;
+
+elementPattern
+    : nodePattern
+    | edgePattern
+    ;
+
+nodePattern
+    : LEFT_PAREN elementPatternFiller RIGHT_PAREN
+    ;
+
+elementPatternFiller
+    : elementVariableDeclaration? isLabelExpression? elementPatternPredicate?
+    ;
+
+elementVariableDeclaration
+    : TEMP? elementVariable
+    ;
+
+isLabelExpression
+    : isOrColon labelExpression
+    ;
+
+isOrColon
+    : IS
+    | COLON
+    ;
+
+elementPatternPredicate
+    : elementPatternWhereClause
+    | elementPropertySpecification
+    ;
+
+elementPatternWhereClause
+    : WHERE searchCondition
+    ;
+
+elementPropertySpecification
+    : LEFT_BRACE propertyKeyValuePairList RIGHT_BRACE
+    ;
+
+propertyKeyValuePairList
+    : propertyKeyValuePair (COMMA propertyKeyValuePair)*
+    ;
+
+propertyKeyValuePair
+    : propertyName COLON valueExpression
+    ;
+
+edgePattern
+    : fullEdgePattern
+    | abbreviatedEdgePattern
+    ;
+
+fullEdgePattern
+    : fullEdgePointingLeft
+    | fullEdgeUndirected
+    | fullEdgePointingRight
+    | fullEdgeLeftOrUndirected
+    | fullEdgeUndirectedOrRight
+    | fullEdgeLeftOrRight
+    | fullEdgeAnyDirection
+    ;
+
+fullEdgePointingLeft
+    : LEFT_ARROW_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
+    ;
+
+fullEdgeUndirected
+    : TILDE_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
+    ;
+
+fullEdgePointingRight
+    : MINUS_LEFT_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
+    ;
+
+fullEdgeLeftOrUndirected
+    : LEFT_ARROW_TILDE_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
+    ;
+
+fullEdgeUndirectedOrRight
+    : TILDE_LEFT_BRACKET elementPatternFiller BRACKET_TILDE_RIGHT_ARROW
+    ;
+
+fullEdgeLeftOrRight
+    : LEFT_ARROW_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
+    ;
+
+fullEdgeAnyDirection
+    : MINUS_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
+    ;
+
+abbreviatedEdgePattern
+    : LEFT_ARROW
+    | TILDE
+    | RIGHT_ARROW
+    | LEFT_ARROW_TILDE
+    | TILDE_RIGHT_ARROW
+    | LEFT_MINUS_RIGHT
+    | MINUS_SIGN
+    ;
+
+parenthesizedPathPatternExpression
+    : LEFT_PAREN subpathVariableDeclaration? pathModePrefix? pathPatternExpression parenthesizedPathPatternWhereClause? RIGHT_PAREN
+    ;
+
+subpathVariableDeclaration
+    : subpathVariable EQUALS_OPERATOR
+    ;
+
+parenthesizedPathPatternWhereClause
+    : WHERE searchCondition
+    ;
+
+// 16.8 <label expression>
+
+labelExpression
+    : EXCLAMATION_MARK labelExpression                  #labelExpressionNegation
+    | labelExpression AMPERSAND labelExpression         #labelExpressionConjunction
+    | labelExpression VERTICAL_BAR labelExpression      #labelExpressionDisjunction
+    | labelName                                         #labelExpressionName
+    | PERCENT                                           #labelExpressionWildcard
+    | LEFT_PAREN labelExpression RIGHT_PAREN            #labelExpressionParenthesized
+    ;
+
+// 16.9 <path variable reference>
+
+pathVariableReference
+    : bindingVariableReference
+    ;
+
+// 16.10 <element variable reference>
+
+elementVariableReference
+    : bindingVariableReference
+    ;
+
+// 16.11 <graph pattern quantifier>
+
+graphPatternQuantifier
+    : ASTERISK
+    | PLUS_SIGN
+    | fixedQuantifier
+    | generalQuantifier
+    ;
+
+fixedQuantifier
+    : LEFT_BRACE unsignedInteger RIGHT_BRACE
+    ;
+
+generalQuantifier
+    : LEFT_BRACE lowerBound? COMMA upperBound? RIGHT_BRACE
+    ;
+
+lowerBound
+    : unsignedInteger
+    ;
+
+upperBound
+    : unsignedInteger
+    ;
+
+// 16.12 <simplified path pattern expression>
+
+simplifiedPathPatternExpression
+    : simplifiedDefaultingLeft
+    | simplifiedDefaultingUndirected
+    | simplifiedDefaultingRight
+    | simplifiedDefaultingLeftOrUndirected
+    | simplifiedDefaultingUndirectedOrRight
+    | simplifiedDefaultingLeftOrRight
+    | simplifiedDefaultingAnyDirection
+    ;
+
+simplifiedDefaultingLeft
+    : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS
+    ;
+
+simplifiedDefaultingUndirected
+    : TILDE_SLASH simplifiedContents SLASH_TILDE
+    ;
+
+simplifiedDefaultingRight
+    : MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
+    ;
+
+simplifiedDefaultingLeftOrUndirected
+    : LEFT_TILDE_SLASH simplifiedContents SLASH_TILDE
+    ;
+
+simplifiedDefaultingUndirectedOrRight
+    : TILDE_SLASH simplifiedContents SLASH_TILDE_RIGHT
+    ;
+
+simplifiedDefaultingLeftOrRight
+    : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
+    ;
+
+simplifiedDefaultingAnyDirection
+    : MINUS_SLASH simplifiedContents SLASH_MINUS
+    ;
+
+simplifiedContents
+    : simplifiedTerm
+    | simplifiedPathUnion
+    | simplifiedMultisetAlternation
+    ;
+
+simplifiedPathUnion
+    : simplifiedTerm VERTICAL_BAR simplifiedTerm (VERTICAL_BAR simplifiedTerm)*
+    ;
+
+simplifiedMultisetAlternation
+    : simplifiedTerm MULTISET_ALTERNATION_OPERATOR simplifiedTerm (MULTISET_ALTERNATION_OPERATOR simplifiedTerm)*
+    ;
+
+simplifiedTerm
+    : simplifiedFactorLow                        #simplifiedFactorLowLabel
+    | simplifiedTerm simplifiedFactorLow      #simplifiedConcatenationLabel
+    ;
+
+simplifiedFactorLow
+    : simplifiedFactorHigh                                     #simplifiedFactorHighLabel
+    | simplifiedFactorLow AMPERSAND simplifiedFactorHigh #simplifiedConjunctionLabel
+    ;
+
+simplifiedFactorHigh
+    : simplifiedTertiary
+    | simplifiedQuantified
+    | simplifiedQuestioned
+    ;
+
+simplifiedQuantified
+    : simplifiedTertiary graphPatternQuantifier
+    ;
+
+simplifiedQuestioned
+    : simplifiedTertiary QUESTION_MARK
+    ;
+
+simplifiedTertiary
+    : simplifiedDirectionOverride
+    | simplifiedSecondary
+    ;
+
+simplifiedDirectionOverride
+    : simplifiedOverrideLeft
+    | simplifiedOverrideUndirected
+    | simplifiedOverrideRight
+    | simplifiedOverrideLeftOrUndirected
+    | simplifiedOverrideUndirectedOrRight
+    | simplifiedOverrideLeftOrRight
+    | simplifiedOverrideAnyDirection
+    ;
+
+simplifiedOverrideLeft
+    : LEFT_ANGLE_BRACKET simplifiedSecondary
+    ;
+
+simplifiedOverrideUndirected
+    : TILDE simplifiedSecondary
+    ;
+
+simplifiedOverrideRight
+    : simplifiedSecondary RIGHT_ANGLE_BRACKET
+    ;
+
+simplifiedOverrideLeftOrUndirected
+    : LEFT_ARROW_TILDE simplifiedSecondary
+    ;
+
+simplifiedOverrideUndirectedOrRight
+    : TILDE simplifiedSecondary RIGHT_ANGLE_BRACKET
+    ;
+
+simplifiedOverrideLeftOrRight
+    : LEFT_ANGLE_BRACKET simplifiedSecondary RIGHT_ANGLE_BRACKET
+    ;
+
+simplifiedOverrideAnyDirection
+    : MINUS_SIGN simplifiedSecondary
+    ;
+
+simplifiedSecondary
+    : simplifiedPrimary
+    | simplifiedNegation
+    ;
+
+simplifiedNegation
+    : EXCLAMATION_MARK simplifiedPrimary
+    ;
+
+simplifiedPrimary
+    : labelName
+    | LEFT_PAREN simplifiedContents RIGHT_PAREN
+    ;
+
+// 16.13 <where clause>
+
+whereClause
+    : WHERE searchCondition
+    ;
+
+// 16.14 <yield clause>
+
+yieldClause
+    : YIELD yieldItemList
+    ;
+
+yieldItemList
+    : yieldItem (COMMA yieldItem)*
+    ;
+
+yieldItem
+    : (yieldItemName yieldItemAlias?)
+    ;
+
+yieldItemName
+    : fieldName
+    ;
+
+yieldItemAlias
+    : AS bindingVariable
+    ;
+
+// 16.15 <group by clasue>
+
+groupByClause
+    : GROUP BY groupingElementList
+    ;
+
+groupingElementList
+    : groupingElement (COMMA groupingElement)*
+    | emptyGroupingSet
+    ;
+
+groupingElement
+    : bindingVariableReference
+    ;
+
+emptyGroupingSet
+    : LEFT_PAREN RIGHT_PAREN
+    ;
+
+// 16.16 <order by clasue>
+
+orderByClause
+    : ORDER BY sortSpecificationList
+    ;
+
+// 16.17 <sort specification list>
+
+sortSpecificationList
+    : sortSpecification (COMMA sortSpecification)*
+    ;
+
+sortSpecification
+    : sortKey orderingSpecification? nullOrdering?
+    ;
+
+sortKey
+    : aggregatingValueExpression
+    ;
+
+orderingSpecification
+    : ASC
+    | ASCENDING
+    | DESC
+    | DESCENDING
+    ;
+
+nullOrdering
+    : NULLS FIRST
+    | NULLS LAST
+    ;
+
+// 16.18 <limit clause>
+
+limitClause
+    : LIMIT nonNegativeIntegerSpecification
+    ;
+
+// 16.19 <offset clause>
+
+offsetClause
+    : offsetSynonym nonNegativeIntegerSpecification
+    ;
+
+offsetSynonym
+    : OFFSET
+    | SKIP_RESERVED_WORD
+    ;
+
+// 17.1 <schema reference> and <catalog schema parent name>
+
+schemaReference
+    : absoluteCatalogSchemaReference
+    | relativeCatalogSchemaReference
+    | referenceParameterSpecification
+    ;
+
+absoluteCatalogSchemaReference
+    : SOLIDUS
+    | absoluteDirectoryPath schemaName
+    ;
+
+catalogSchemaParentAndName
+    : absoluteDirectoryPath schemaName
+    ;
+
+relativeCatalogSchemaReference
+    : predefinedSchemaReference
+    | relativeDirectoryPath schemaName
+    ;
+
+predefinedSchemaReference
+    : HOME_SCHEMA
+    | CURRENT_SCHEMA
+    | PERIOD
+    ;
+
+absoluteDirectoryPath
+    : SOLIDUS simpleDirectoryPath?
+    ;
+
+relativeDirectoryPath
+    : DOUBLE_PERIOD (SOLIDUS DOUBLE_PERIOD)* SOLIDUS simpleDirectoryPath?
+    ;
+
+simpleDirectoryPath
+    : (directoryName SOLIDUS)+
+    ;
+
+// 17.2 <graph reference> and <catalog graph parent and name>
+
+graphReference
+    : catalogObjectParentReference graphName
+    | delimitedGraphName
+    | homeGraph
+    | referenceParameterSpecification
+    ;
+
+catalogGraphParentAndName
+    : catalogObjectParentReference? graphName
+    ;
+
+homeGraph
+    : HOME_PROPERTY_GRAPH
+    | HOME_GRAPH
+    ;
+
+// 17.3 <graph type reference> and <catalog graph type parent and name>
+
+graphTypeReference
+    : catalogGraphTypeParentAndName
+    | referenceParameterSpecification
+    ;
+
+catalogGraphTypeParentAndName
+    : catalogObjectParentReference? graphTypeName
+    ;
+
+// 17.4 <binding table reference> and <catalog binding table parent name>
+
+bindingTableReference
+    : catalogObjectParentReference bindingTableName
+    | delimitedBindingTableName
+    | referenceParameterSpecification
+    ;
+
+// 17.5 <procedure reference> and <catalog procedure parent and name>
+
+procedureReference
+    : catalogProcedureParentAndName
+    | referenceParameterSpecification
+    ;
+
+catalogProcedureParentAndName
+    : catalogObjectParentReference? procedureName
+    ;
+
+// 17.6 <catalog object parent reference>
+
+catalogObjectParentReference
+    : schemaReference SOLIDUS? (objectName PERIOD)*
+    |  (objectName PERIOD)+
+    ;
+
+// 17.7 <reference parameter specification>
+
+referenceParameterSpecification
+    : SUBSTITUTED_PARAMETER_REFERENCE
+    ;
+
+// 18.1 <nested graph type specification>
+
+nestedGraphTypeSpecification
+    : LEFT_BRACE graphTypeSpecificationBody RIGHT_BRACE
+    ;
+
+graphTypeSpecificationBody
+    : elementTypeList
+    ;
+
+elementTypeList
+    : elementTypeSpecification (COMMA elementTypeSpecification)*
+    ;
+
+elementTypeSpecification
+    : nodeTypeSpecification
+    | edgeTypeSpecification
+    ;
+
+// 18.2 <node type specification>
+
+nodeTypeSpecification
+    : nodeTypePattern
+    | nodeTypePhrase
+    ;
+
+nodeTypePattern
+    : (nodeSynonym TYPE? nodeTypeName)? LEFT_PAREN localNodeTypeAlias? nodeTypeFiller? RIGHT_PAREN
+    ;
+
+nodeTypePhrase
+    : nodeSynonym TYPE? nodeTypePhraseFiller (AS localNodeTypeAlias)?
+    ;
+
+nodeTypePhraseFiller
+    : nodeTypeName nodeTypeFiller?
+    | nodeTypeFiller
+    ;
+
+nodeTypeFiller
+    : nodeTypeKeyLabelSet nodeTypeImpliedContent?
+    | nodeTypeImpliedContent
+    ;
+
+localNodeTypeAlias
+    : regularIdentifier
+    ;
+
+nodeTypeImpliedContent
+    : nodeTypeLabelSet
+    | nodeTypePropertyTypes
+    | nodeTypeLabelSet nodeTypePropertyTypes
+    ;
+
+nodeTypeKeyLabelSet
+    : labelSetPhrase? IMPLIES
+    ;
+
+nodeTypeLabelSet
+    : labelSetPhrase
+    ;
+
+nodeTypePropertyTypes
+    : propertyTypesSpecification
+    ;
+
+// 18.3 <edge type specification>
+
+edgeTypeSpecification
+    : edgeTypePattern
+    | edgeTypePhrase
+    ;
+
+edgeTypePattern
+    : (edgeKind? edgeSynonym TYPE? edgeTypeName)? (edgeTypePatternDirected | edgeTypePatternUndirected)
+    ;
+
+edgeTypePhrase
+    : edgeKind edgeSynonym TYPE? edgeTypePhraseFiller endpointPairPhrase
+    ;
+
+edgeTypePhraseFiller
+    : edgeTypeName edgeTypeFiller?
+    | edgeTypeFiller
+    ;
+
+edgeTypeFiller
+    : edgeTypeKeyLabelSet edgeTypeImpliedContent?
+    | edgeTypeImpliedContent
+    ;
+
+edgeTypeImpliedContent
+    : edgeTypeLabelSet
+    | edgeTypePropertyTypes
+    | edgeTypeLabelSet edgeTypePropertyTypes
+    ;
+
+edgeTypeKeyLabelSet
+    : labelSetPhrase? IMPLIES
+    ;
+
+edgeTypeLabelSet
+    : labelSetPhrase
+    ;
+
+edgeTypePropertyTypes
+    : propertyTypesSpecification
+    ;
+
+edgeTypePatternDirected
+    : edgeTypePatternPointingRight
+    | edgeTypePatternPointingLeft
+    ;
+
+edgeTypePatternPointingRight
+    : sourceNodeTypeReference arcTypePointingRight destinationNodeTypeReference
+    ;
+
+edgeTypePatternPointingLeft
+    : destinationNodeTypeReference arcTypePointingLeft sourceNodeTypeReference
+    ;
+
+edgeTypePatternUndirected
+    : sourceNodeTypeReference arcTypeUndirected destinationNodeTypeReference
+    ;
+
+arcTypePointingRight
+    : MINUS_LEFT_BRACKET edgeTypeFiller BRACKET_RIGHT_ARROW
+    ;
+
+arcTypePointingLeft
+    : LEFT_ARROW_BRACKET edgeTypeFiller RIGHT_BRACKET_MINUS
+    ;
+
+arcTypeUndirected
+    : TILDE_LEFT_BRACKET edgeTypeFiller RIGHT_BRACKET_TILDE
+    ;
+
+sourceNodeTypeReference
+    : LEFT_PAREN sourceNodeTypeAlias RIGHT_PAREN
+    | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
+    ;
+
+destinationNodeTypeReference
+    : LEFT_PAREN destinationNodeTypeAlias RIGHT_PAREN
+    | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
+    ;
+
+edgeKind
+    : DIRECTED
+    | UNDIRECTED
+    ;
+
+endpointPairPhrase
+    : CONNECTING endpointPair
+    ;
+
+endpointPair
+    : endpointPairDirected
+    | endpointPairUndirected
+    ;
+
+endpointPairDirected
+    : endpointPairPointingRight
+    | endpointPairPointingLeft
+    ;
+
+endpointPairPointingRight
+    : LEFT_PAREN sourceNodeTypeAlias connectorPointingRight destinationNodeTypeAlias RIGHT_PAREN
+    ;
+
+endpointPairPointingLeft
+    : LEFT_PAREN destinationNodeTypeAlias LEFT_ARROW sourceNodeTypeAlias RIGHT_PAREN
+    ;
+
+endpointPairUndirected
+    : LEFT_PAREN sourceNodeTypeAlias connectorUndirected destinationNodeTypeAlias RIGHT_PAREN
+    ;
+
+connectorPointingRight
+    : TO
+    | RIGHT_ARROW
+    ;
+
+connectorUndirected
+    : TO
+    | TILDE
+    ;
+
+sourceNodeTypeAlias
+    : regularIdentifier
+    ;
+
+destinationNodeTypeAlias
+    : regularIdentifier
+    ;
+
+// 18.4 <label set phrase> and <label set specification>
+
+labelSetPhrase
+    : LABEL labelName
+    | LABELS labelSetSpecification
+    | isOrColon labelSetSpecification
+    ;
+
+labelSetSpecification
+    : labelName (AMPERSAND labelName)*
+    ;
+
+// 18.5 <property types specification>
+
+propertyTypesSpecification
+    : LEFT_BRACE propertyTypeList? RIGHT_BRACE
+    ;
+
+propertyTypeList
+    : propertyType (COMMA propertyType)*
+    ;
+
+// 18.6 <property type>
+
+propertyType
+    : propertyName typed? propertyValueType
+    ;
+
+// 18.7 <property value type>
+
+propertyValueType
+    : valueType
+    ;
+
+// 18.8 <binding table type>
+
+bindingTableType
+    : BINDING? TABLE fieldTypesSpecification
+    ;
+
+// 18.9 <value type>
+
+valueType
+    : predefinedType                                                                                                                              #predefinedTypeLabel
+    // <constructed value type>
+    | pathValueType                                                                                                                               #pathValueTypeLabel
+    | listValueTypeName LEFT_ANGLE_BRACKET valueType RIGHT_ANGLE_BRACKET (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
+    | valueType listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                    #listValueTypeAlt2
+    | listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                                #listValueTypeAlt3
+    | recordType                                                                                                                                   #recordTypeLabel
+    // <dynamic union type>
+    | ANY VALUE? notNull?                                                                                                                        #openDynamicUnionTypeLabel
+    | ANY? PROPERTY VALUE notNull?                                                                                                             #dynamicPropertyValueTypeLabel
+    // <closed dynamic union type>
+    | ANY VALUE? LEFT_ANGLE_BRACKET valueType (VERTICAL_BAR valueType)* RIGHT_ANGLE_BRACKET                                         #closedDynamicUnionTypeAtl1
+    | valueType VERTICAL_BAR valueType                                                                                                        #closedDynamicUnionTypeAtl2
+    ;
+
+typed
+    : DOUBLE_COLON
+    | TYPED
+    ;
+
+predefinedType
+    : booleanType
+    | characterStringType
+    | byteStringType
+    | numericType
+    | temporalType
+    | referenceValueType
+    | immaterialValueType
+    ;
+
+booleanType
+    : (BOOL | BOOLEAN) notNull?
+    ;
+
+characterStringType
+    : STRING (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
+    | CHAR (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
+    | VARCHAR (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
+    ;
+
+byteStringType
+    : BYTES (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
+    | BINARY (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
+    | VARBINARY (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
+    ;
+
+minLength
+    : unsignedInteger
+    ;
+
+maxLength
+    : unsignedInteger
+    ;
+
+fixedLength
+    : unsignedInteger
+    ;
+
+numericType
+    : exactNumericType
+    | approximateNumericType
+    ;
+
+exactNumericType
+    : binaryExactNumericType
+    | decimalExactNumericType
+    ;
+
+binaryExactNumericType
+    : signedBinaryExactNumericType
+    | unsignedBinaryExactNumericType
+    ;
+
+signedBinaryExactNumericType
+    : INT8 notNull?
+    | INT16 notNull?
+    | INT32 notNull?
+    | INT64 notNull?
+    | INT128 notNull?
+    | INT256 notNull?
+    | SMALLINT notNull?
+    | INT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
+    | BIGINT notNull?
+    | SIGNED? verboseBinaryExactNumericType
+    ;
+
+unsignedBinaryExactNumericType
+    : UINT8 notNull?
+    | UINT16 notNull?
+    | UINT32 notNull?
+    | UINT64 notNull?
+    | UINT128 notNull?
+    | UINT256 notNull?
+    | USMALLINT notNull?
+    | UINT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
+    | UBIGINT notNull?
+    | UNSIGNED verboseBinaryExactNumericType
+    ;
+
+verboseBinaryExactNumericType
+    : INTEGER8 notNull?
+    | INTEGER16 notNull?
+    | INTEGER32 notNull?
+    | INTEGER64 notNull?
+    | INTEGER128 notNull?
+    | INTEGER256 notNull?
+    | SMALL INTEGER notNull?
+    | INTEGER (LEFT_PAREN precision RIGHT_PAREN)? notNull?
+    | BIG INTEGER notNull?
+    ;
+
+decimalExactNumericType
+    : (DECIMAL | DEC) (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN notNull?)?
+    ;
+
+precision
+    : unsignedDecimalInteger
+    ;
+
+scale
+    : unsignedDecimalInteger
+    ;
+
+approximateNumericType
+    : FLOAT16 notNull?
+    | FLOAT32 notNull?
+    | FLOAT64 notNull?
+    | FLOAT128 notNull?
+    | FLOAT256 notNull?
+    | FLOAT (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN)? notNull?
+    | REAL notNull?
+    | DOUBLE PRECISION? notNull?
+    ;
+
+temporalType
+    : temporalInstantType
+    | temporalDurationType
+    ;
+
+temporalInstantType
+    : datetimeType
+    | localdatetimeType
+    | dateType
+    | timeType
+    | localtimeType
+    ;
+
+datetimeType
+    : ZONED DATETIME notNull?
+    | TIMESTAMP WITH TIME ZONE notNull?
+    ;
+
+localdatetimeType
+    : LOCAL DATETIME notNull?
+    | TIMESTAMP (WITHOUT TIME ZONE)? notNull?
+    ;
+
+dateType
+    : DATE notNull?
+    ;
+
+timeType
+    : ZONED TIME notNull?
+    | TIME WITH TIME ZONE notNull?
+    ;
+
+localtimeType
+    : LOCAL TIME notNull?
+    | TIME WITHOUT TIME ZONE notNull?
+    ;
+
+temporalDurationType
+    : DURATION LEFT_PAREN temporalDurationQualifier RIGHT_PAREN notNull?
+    ;
+
+temporalDurationQualifier
+    : YEAR TO MONTH
+    | DAY TO SECOND
+    ;
+
+referenceValueType
+    : graphReferenceValueType
+    | bindingTableReferenceValueType
+    | nodeReferenceValueType
+    | edgeReferenceValueType
+    ;
+
+immaterialValueType
+    : nullType
+    | emptyType
+    ;
+
+nullType
+    : NULL
+    ;
+
+emptyType
+    : NULL notNull
+    | NOTHING
+    ;
+
+graphReferenceValueType
+    : openGraphReferenceValueType
+    | closedGraphReferenceValueType
+    ;
+
+closedGraphReferenceValueType
+    : PROPERTY? GRAPH nestedGraphTypeSpecification notNull?
+    ;
+
+openGraphReferenceValueType
+    : ANY PROPERTY? GRAPH notNull?
+    ;
+
+bindingTableReferenceValueType
+    : bindingTableType notNull?
+    ;
+
+nodeReferenceValueType
+    : openNodeReferenceValueType
+    | closedNodeReferenceValueType
+    ;
+
+closedNodeReferenceValueType
+    : nodeTypeSpecification notNull?
+    ;
+
+openNodeReferenceValueType
+    : ANY? nodeSynonym notNull?
+    ;
+
+edgeReferenceValueType
+    : openEdgeReferenceValueType
+    | closedEdgeReferenceValueType
+    ;
+
+closedEdgeReferenceValueType
+    : edgeTypeSpecification notNull?
+    ;
+
+openEdgeReferenceValueType
+    : ANY? edgeSynonym notNull?
+    ;
+
+pathValueType
+    : PATH notNull?
+    ;
+
+listValueTypeName
+    : GROUP? listValueTypeNameSynonym
+    ;
+
+listValueTypeNameSynonym
+    : LIST
+    | ARRAY
+    ;
+
+recordType
+    : ANY? RECORD notNull?
+    | RECORD? fieldTypesSpecification notNull?
+    ;
+
+fieldTypesSpecification
+    : LEFT_BRACE fieldTypeList? RIGHT_BRACE
+    ;
+
+fieldTypeList
+    : fieldType (COMMA fieldType)*
+    ;
+
+notNull
+    :  NOT NULL
+    ;
+
+// 18.10 <field type>
+
+fieldType
+    : fieldName typed? valueType
+    ;
+
+// 19.1 <search condition>
+
+searchCondition
+    : booleanValueExpression
+    ;
+
+// 19.2 <predicate>
+
+predicate
+    : existsPredicate
+    | nullPredicate
+    | valueTypePredicate
+    | directedPredicate
+    | labeledPredicate
+    | sourceDestinationPredicate
+    | all_differentPredicate
+    | samePredicate
+    | property_existsPredicate
+    ;
+
+// 19.3 <comparison predicate>
+
+// The <comparison predicate> productions moved to valueExpression
+// to avoid left mutually recursive productions.
+
+comparisonPredicatePart2
+    : compOp valueExpression
+    ;
+
+compOp
+    : EQUALS_OPERATOR
+    | NOT_EQUALS_OPERATOR
+    | LEFT_ANGLE_BRACKET
+    | RIGHT_ANGLE_BRACKET
+    | LESS_THAN_OR_EQUALS_OPERATOR
+    | GREATER_THAN_OR_EQUALS_OPERATOR
+    ;
+
+// 19.4 <exists predicate>
+
+existsPredicate
+    : EXISTS (LEFT_BRACE graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern RIGHT_PAREN | LEFT_BRACE matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock RIGHT_PAREN | nestedQuerySpecification)
+    ;
+
+// 19.5 <null predicate>
+
+nullPredicate
+    : valueExpressionPrimary nullPredicatePart2
+    ;
+
+nullPredicatePart2
+    : IS NOT? NULL
+    ;
+
+// 19.6 <value type predicate>
+
+valueTypePredicate
+    : valueExpressionPrimary valueTypePredicatePart2
+    ;
+
+valueTypePredicatePart2
+    : IS NOT? typed valueType
+    ;
+
+// 19.7 <normalized predicate>
+
+normalizedPredicatePart2
+    : IS NOT? normalForm? NORMALIZED
+    ;
+
+// 19.8 <directed predicate>
+
+directedPredicate
+    : elementVariableReference directedPredicatePart2
+    ;
+
+directedPredicatePart2
+    : IS NOT? DIRECTED
+    ;
+
+// 19.9 <labled predicate>
+
+labeledPredicate
+    : elementVariableReference labeledPredicatePart2
+    ;
+
+labeledPredicatePart2
+    : isLabeledOrColon labelExpression
+    ;
+
+isLabeledOrColon
+    : IS NOT? LABELED
+    | COLON
+    ;
+
+// 19.10 <source/destination predicate>
+
+sourceDestinationPredicate
+    : nodeReference sourcePredicatePart2
+    | nodeReference destinationPredicatePart2
+    ;
+
+nodeReference
+    : elementVariableReference
+    ;
+
+sourcePredicatePart2
+    : IS NOT? SOURCE OF edgeReference
+    ;
+
+destinationPredicatePart2
+    : IS NOT? DESTINATION OF edgeReference
+    ;
+
+edgeReference
+    : elementVariableReference
+    ;
+
+// 19.11 <all different predicate>
+
+all_differentPredicate
+    : ALL_DIFFERENT LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
+    ;
+
+// 19.12 <same predicate>
+
+samePredicate
+    : SAME LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
+    ;
+
+// 19.13 <property exists predicate>
+
+property_existsPredicate
+    : PROPERTY_EXISTS LEFT_PAREN elementVariableReference COMMA propertyName RIGHT_PAREN
+    ;
+
+// 20.1 <value expression>
+
+// This version of valueExpression sucks up rules broken out in the standard to a single production. This
+// eliminates ambiguity in multiple rules specifying valueExpressionPrimary.
+
+valueExpression
+    // Numeric, datetime and duration types all support roughly the same expressions. So here
+    // we define a rule that deals with all of them. It is up to the implementation to post
+    // process the sytnax tree and flag invalid type and function combinations.
+    : sign = (PLUS_SIGN | MINUS_SIGN) valueExpression                       #signedExprAlt
+    | valueExpression operator = (ASTERISK | SOLIDUS) valueExpression       #multDivExprAlt
+    | valueExpression operator = (PLUS_SIGN | MINUS_SIGN) valueExpression   #addSubtractExprAlt
+    // Character strings, byte strings, lists and paths all support the same concatenation
+    // operator. So here we define a rule that deals with all of them. Of course the types
+    // cannot be combined. So it is up to implementation to post process the sytax tree
+    // and flag invalid type and function combinations.
+    | valueExpression CONCATENATION_OPERATOR valueExpression                #concatenationExprAlt
+    // Boolean value expression included here.
+    | NOT valueExpression                                                   #notExprAlt
+    | valueExpression IS NOT? truthValue                                    #isNotExprAlt
+    | valueExpression AND valueExpression                                   #conjunctiveExprAlt
+    | valueExpression operator = (OR | XOR) valueExpression                 #disjunctiveExprAlt
+    // The comparisonPredicate productions moved here to eliminate left mutual recursion.
+    | valueExpression comparisonPredicatePart2                              #comparisonExprAlt
+    | predicate                                                             #predicateExprAlt
+    // The normalizedPredicate productions moved here to eliminate left mutual recursion.
+    | valueExpression normalizedPredicatePart2                              #normalizedPredicateExprAlt
+    | PROPERTY? GRAPH graphExpression                                       #propertyGraphExprAlt
+    | BINDING? TABLE bindingTableExpression                                 #bindingTableExprAlt
+    | valueFunction                                                         #valueFunctionExprAlt
+    | valueExpressionPrimary                                                #primaryExprAlt
+    ;
+
+valueFunction
+    : numericValueFunction
+    | datetimeSubtraction
+    | datetimeValueFunction
+    | durationValueFunction
+    | characterOrByteStringFunction
+    | listValueFunction
+    ;
+
+booleanValueExpression
+    : valueExpression
+    ;
+
+characterOrByteStringFunction
+    : subCharacterOrByteString
+    | trimSingleCharacterOrByteString
+    | foldCharacterString
+    | trimMultiCharacterCharacterString
+    | normalizeCharacterString
+    ;
+
+subCharacterOrByteString
+    : (LEFT | RIGHT) LEFT_PAREN valueExpression COMMA stringLength RIGHT_PAREN
+    ;
+
+trimSingleCharacterOrByteString
+    : TRIM LEFT_PAREN trimOperands RIGHT_PAREN
+    ;
+
+foldCharacterString
+    : (UPPER | LOWER) LEFT_PAREN valueExpression RIGHT_PAREN
+    ;
+
+trimMultiCharacterCharacterString
+    : (BTRIM | LTRIM | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? RIGHT_PAREN
+    ;
+
+normalizeCharacterString
+    : NORMALIZE LEFT_PAREN valueExpression (COMMA normalForm)? RIGHT_PAREN
+    ;
+
+nodeReferenceValueExpression
+    : valueExpressionPrimary
+    ;
+
+edgeReferenceValueExpression
+    : valueExpressionPrimary
+    ;
+
+aggregatingValueExpression
+    : valueExpression
+    ;
+
+// 20.2 <value expression primary>
+
+valueExpressionPrimary
+    : parenthesizedValueExpression
+    | aggregateFunction
+    | unsignedValueSpecification
+// List and Record literals are reduntantly/abiguously part of the literal production
+//    | listValueConstructor
+//    | recordConstructor
+    | pathValueConstructor
+    | valueExpressionPrimary PERIOD propertyName      // <propertyReference
+    | valueQueryExpression
+    | caseExpression
+    | castSpecification
+    | element_idFunction
+    | letValueExpression
+    | bindingVariableReference
+    ;
+
+parenthesizedValueExpression
+    : LEFT_PAREN valueExpression RIGHT_PAREN
+    ;
+
+nonParenthesizedValueExpressionPrimary
+    : nonParenthesizedValueExpressionPrimarySpecialCase
+    | bindingVariableReference
+    ;
+
+nonParenthesizedValueExpressionPrimarySpecialCase
+    : aggregateFunction
+    | unsignedValueSpecification
+// List and Record literals are reduntantly/abiguously part of the literal production
+//    | listValueConstructor
+//    | recordConstructor
+    | pathValueConstructor
+    | valueExpressionPrimary PERIOD propertyName      // <property reference>
+    | valueQueryExpression
+    | caseExpression
+    | castSpecification
+    | element_idFunction
+    | letValueExpression
+    ;
+
+// 20.3 <value specification>
+
+unsignedValueSpecification
+    : unsignedLiteral
+    | generalValueSpecification
+    ;
+
+nonNegativeIntegerSpecification
+    : unsignedInteger
+    | dynamicParameterSpecification
+    ;
+
+generalValueSpecification
+    : dynamicParameterSpecification
+    | SESSION_USER
+    ;
+
+// 20.4 <dynamic parameter specification>
+
+dynamicParameterSpecification
+    : GENERAL_PARAMETER_REFERENCE
+    ;
+
+// 20.5 <let value expression>
+
+letValueExpression
+    : LET letVariableDefinitionList IN valueExpression END
+    ;
+
+// 20.6 <value query expression>
+
+valueQueryExpression
+    : VALUE nestedQuerySpecification
+    ;
+
+// 20.7 <case expression>
+
+caseExpression
+    : caseAbbreviation
+    | caseSpecification
+    ;
+
+caseAbbreviation
+    : NULLIF LEFT_PAREN valueExpression COMMA valueExpression RIGHT_PAREN
+    | COALESCE LEFT_PAREN valueExpression (COMMA valueExpression)+ RIGHT_PAREN
+    ;
+
+caseSpecification
+    : simpleCase
+    | searchedCase
+    ;
+
+simpleCase
+    : CASE caseOperand simpleWhenClause+ elseClause? END
+    ;
+
+searchedCase
+    : CASE searchedWhenClause+ elseClause? END
+    ;
+
+simpleWhenClause
+    : WHEN whenOperandList THEN result
+    ;
+
+searchedWhenClause
+    : WHEN searchCondition THEN result
+    ;
+
+elseClause
+    : ELSE result
+    ;
+
+caseOperand
+    : nonParenthesizedValueExpressionPrimary
+    | elementVariableReference
+    ;
+
+whenOperandList
+    : whenOperand (COMMA whenOperand)*
+    ;
+
+whenOperand
+    : nonParenthesizedValueExpressionPrimary
+    | comparisonPredicatePart2
+    | nullPredicatePart2
+    | valueTypePredicatePart2
+    | normalizedPredicatePart2
+    | directedPredicatePart2
+    | labeledPredicatePart2
+    | sourcePredicatePart2
+    | destinationPredicatePart2
+    ;
+
+result
+    : resultExpression
+    | nullLiteral
+    ;
+
+resultExpression
+    : valueExpression
+    ;
+
+// 20.8 <cast specification>
+
+castSpecification
+    : CAST LEFT_PAREN castOperand AS castTarget RIGHT_PAREN
+    ;
+
+castOperand
+    : valueExpression
+    | nullLiteral
+    ;
+
+castTarget
+    : valueType
+    ;
+
+// 20.9 <aggregate function>
+
+aggregateFunction
+    : COUNT LEFT_PAREN ASTERISK RIGHT_PAREN
+    | generalSetFunction
+    | binarySetFunction
+    ;
+
+generalSetFunction
+    : generalSetFunctionType LEFT_PAREN setQuantifier? valueExpression RIGHT_PAREN
+    ;
+
+binarySetFunction
+    : binarySetFunctionType LEFT_PAREN dependentValueExpression COMMA independentValueExpression RIGHT_PAREN
+    ;
+
+generalSetFunctionType
+    : AVG
+    | COUNT
+    | MAX
+    | MIN
+    | SUM
+    | COLLECT_LIST
+    | STDDEV_SAMP
+    | STDDEV_POP
+    ;
+
+setQuantifier
+    : DISTINCT
+    | ALL
+    ;
+
+binarySetFunctionType
+    : PERCENTILE_CONT
+    | PERCENTILE_DISC
+    ;
+
+dependentValueExpression
+    : setQuantifier? numericValueExpression
+    ;
+
+independentValueExpression
+    : numericValueExpression
+    ;
+
+// 20.10 <element_id function>
+
+element_idFunction
+    : ELEMENT_ID LEFT_PAREN elementVariableReference RIGHT_PAREN
+    ;
+
+// 20.11 <property reference>
+
+// 20.12 <binding variable reference>
+
+bindingVariableReference
+    : bindingVariable
+    ;
+
+// The path value expression was combined with list and string value expressions.
+// See listStringOrPathValueExpression.
+
+pathValueExpression
+    : valueExpression
+    ;
+
+// 20.14 <path value constructor>
+
+pathValueConstructor
+    : pathValueConstructorByEnumeration
+    ;
+
+pathValueConstructorByEnumeration
+    : PATH LEFT_BRACKET pathElementList RIGHT_BRACKET
+    ;
+
+pathElementList
+    : pathElementListStart pathElementListStep*
+    ;
+
+pathElementListStart
+    : nodeReferenceValueExpression
+    ;
+
+pathElementListStep
+    : COMMA edgeReferenceValueExpression COMMA nodeReferenceValueExpression
+    ;
+
+// 20.15 <list value expression>
+
+// The list value expression was combined with path and string value expressions.
+// See listStringOrPathValueExpression.
+
+listValueExpression
+    : valueExpression
+    ;
+
+// 20.16 <list value function>
+
+// Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
+// apply to characterString, byteString and list. Breaking them out separately resulted in
+// ambiguity.
+
+listValueFunction
+    : trimListFunction
+    | elementsFunction
+    ;
+
+trimListFunction
+    : TRIM LEFT_PAREN listValueExpression COMMA numericValueExpression RIGHT_PAREN
+    ;
+
+elementsFunction
+    : ELEMENTS LEFT_PAREN pathValueExpression RIGHT_PAREN
+    ;
+
+// 20.17 <list value constructor>
+
+listValueConstructor
+    : listValueConstructorByEnumeration
+    ;
+
+listValueConstructorByEnumeration
+    : listValueTypeName? LEFT_BRACKET listElementList? RIGHT_BRACKET
+    ;
+
+listElementList
+    : listElement (COMMA listElement)*
+    ;
+
+listElement
+    : valueExpression
+    ;
+
+// 20.18 <record constructor>
+
+recordConstructor
+    : RECORD? fieldsSpecification
+    ;
+
+fieldsSpecification
+    : LEFT_BRACE fieldList? RIGHT_BRACE
+    ;
+
+fieldList
+    : field (COMMA field)*
+    ;
+
+// 20.19 <field>
+
+field
+    : fieldName COLON valueExpression
+    ;
+
+// 20.20 <boolean value expression>
+
+// Most of <boolean value expression> is incorporated in valueExpression
+
+truthValue
+    : BOOLEAN_LITERAL
+    ;
+
+// 20.21 <numeric value expression>
+
+numericValueExpression
+    : sign = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
+    | numericValueExpression operator = (ASTERISK | SOLIDUS) numericValueExpression
+    | numericValueExpression operator = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
+    | valueExpressionPrimary
+    | numericValueFunction
+    ;
+
+// 20.22 <numeric value function>
+
+numericValueFunction
+    : lengthExpression
+    | cardinalityExpression
+    | absoluteValueExpression
+    | modulusExpression
+    | trigonometricFunction
+    | generalLogarithmFunction
+    | commonLogarithm
+    | naturalLogarithm
+    | exponentialFunction
+    | powerFunction
+    | squareRoot
+    | floorFunction
+    | ceilingFunction
+    ;
+
+lengthExpression
+    : charLengthExpression
+    | byteLengthExpression
+    | pathLengthExpression
+    ;
+
+cardinalityExpression
+    : CARDINALITY LEFT_PAREN cardinalityExpressionArgument RIGHT_PAREN
+    | SIZE LEFT_PAREN listValueExpression RIGHT_PAREN
+    ;
+
+cardinalityExpressionArgument
+    : valueExpression
+    ;
+
+charLengthExpression
+    : (CHAR_LENGTH | CHARACTER_LENGTH) LEFT_PAREN characterStringValueExpression RIGHT_PAREN
+    ;
+
+byteLengthExpression
+    : (BYTE_LENGTH | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression RIGHT_PAREN
+    ;
+
+pathLengthExpression
+    : PATH_LENGTH LEFT_PAREN pathValueExpression RIGHT_PAREN
+    ;
+
+// absoluteValueExpression applies to both numeric types and duration types. They have the same syntax.
+absoluteValueExpression
+    : ABS LEFT_PAREN valueExpression RIGHT_PAREN
+    ;
+
+modulusExpression
+    : MOD LEFT_PAREN numericValueExpressionDividend COMMA numericValueExpressionDivisor RIGHT_PAREN
+    ;
+
+numericValueExpressionDividend
+    : numericValueExpression
+    ;
+
+numericValueExpressionDivisor
+    : numericValueExpression
+    ;
+
+trigonometricFunction
+    : trigonometricFunctionName LEFT_PAREN numericValueExpression RIGHT_PAREN
+    ;
+
+trigonometricFunctionName
+    : SIN
+    | COS
+    | TAN
+    | COT
+    | SINH
+    | COSH
+    | TANH
+    | ASIN
+    | ACOS
+    | ATAN
+    | DEGREES
+    | RADIANS
+    ;
+
+generalLogarithmFunction
+    : LOG LEFT_PAREN generalLogarithmBase COMMA generalLogarithmArgument RIGHT_PAREN
+    ;
+
+generalLogarithmBase
+    : numericValueExpression
+    ;
+
+generalLogarithmArgument
+    : numericValueExpression
+    ;
+
+commonLogarithm
+    : LOG10 LEFT_PAREN numericValueExpression RIGHT_PAREN
+    ;
+
+naturalLogarithm
+    : LN LEFT_PAREN numericValueExpression RIGHT_PAREN
+    ;
+
+exponentialFunction
+    : EXP LEFT_PAREN numericValueExpression RIGHT_PAREN
+    ;
+
+powerFunction
+    : POWER LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent RIGHT_PAREN
+    ;
+
+numericValueExpressionBase
+    : numericValueExpression
+    ;
+
+numericValueExpressionExponent
+    : numericValueExpression
+    ;
+
+squareRoot
+    : SQRT LEFT_PAREN numericValueExpression RIGHT_PAREN
+    ;
+
+floorFunction
+    : FLOOR LEFT_PAREN numericValueExpression RIGHT_PAREN
+    ;
+
+ceilingFunction
+    : (CEIL | CEILING) LEFT_PAREN numericValueExpression RIGHT_PAREN
+    ;
+
+// 20.23 <string value expression>
+
+// The string value expressions were combined with list and path value expressions.
+
+characterStringValueExpression
+    : valueExpression
+    ;
+
+byteStringValueExpression
+    : valueExpression
+    ;
+
+// 20.24 <string value function>
+
+// Note: String functions were moved to characterByteStringOrListFunction, some alternatives
+// apply to characterString, byteString and list. Breaking them out separately resulted in
+// ambiguity.
+
+trimOperands
+    : (trimSpecification? trimCharacterOrByteString? FROM)? trimCharacterOrByteStringSource
+    ;
+
+trimCharacterOrByteStringSource
+    : valueExpression
+    ;
+
+trimSpecification
+    : LEADING
+    | TRAILING
+    | BOTH
+    ;
+
+trimCharacterOrByteString
+    : valueExpression
+    ;
+
+normalForm
+    : NFC
+    | NFD
+    | NFKC
+    | NFKD
+    ;
+
+stringLength
+    : numericValueExpression
+    ;
+
+// 20.25 <byte string function>
+
+// Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
+// apply to characterString, byteString and list. Breaking them out separately resulted in
+// ambiguity.
+
+// 20.26 <datetime value expression>
+
+// The implementation should enforce that the data type is a datetime value.
+datetimeValueExpression
+     : valueExpression
+     ;
+
+// 20.27 <datetime value function>
+
+datetimeValueFunction
+    : dateFunction
+    | timeFunction
+    | datetimeFunction
+    | localtimeFunction
+    | localdatetimeFunction
+    ;
+
+dateFunction
+    : CURRENT_DATE
+    | DATE LEFT_PAREN dateFunctionParameters? RIGHT_PAREN
+    ;
+
+timeFunction
+    : CURRENT_TIME
+    | ZONED_TIME LEFT_PAREN timeFunctionParameters? RIGHT_PAREN
+    ;
+
+localtimeFunction
+    : LOCAL_TIME (LEFT_PAREN timeFunctionParameters? RIGHT_PAREN)?
+    ;
+
+datetimeFunction
+    : CURRENT_TIMESTAMP
+    | ZONED_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
+    ;
+
+localdatetimeFunction
+    : LOCAL_TIMESTAMP
+    | LOCAL_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
+    ;
+
+dateFunctionParameters
+    : dateString
+    | recordConstructor
+    ;
+
+timeFunctionParameters
+    : timeString
+    | recordConstructor
+    ;
+
+datetimeFunctionParameters
+    : datetimeString
+    | recordConstructor
+    ;
+
+// 20.28 <duration value expression>
+
+// The implemenation should enforce that the data type is a duration value.
+durationValueExpression
+    : valueExpression
+    ;
+
+datetimeSubtraction
+    : DURATION_BETWEEN LEFT_PAREN datetimeSubtractionParameters RIGHT_PAREN temporalDurationQualifier?
+    ;
+
+datetimeSubtractionParameters
+    : datetimeValueExpression1 COMMA datetimeValueExpression2
+    ;
+
+datetimeValueExpression1
+    : datetimeValueExpression
+    ;
+
+datetimeValueExpression2
+    : datetimeValueExpression
+    ;
+
+// 20.29 <duration value function>
+
+durationValueFunction
+    : durationFunction
+    | absoluteValueExpression
+    ;
+
+durationFunction
+    : DURATION LEFT_PAREN durationFunctionParameters RIGHT_PAREN
+    ;
+
+durationFunctionParameters
+    : durationString
+    | recordConstructor
+    ;
+
+// 21.1 Names and Variables
+
+objectName
+    : identifier
+    ;
+
+objectNameOrBindingVariable
+    : regularIdentifier
+    ;
+
+directoryName
+    : identifier
+    ;
+
+schemaName
+    : identifier
+    ;
+
+graphName
+    : regularIdentifier
+    | delimitedGraphName
+    ;
+
+delimitedGraphName
+    // DELIMITED_IDENTIFIER
+    : DOUBLE_QUOTED_CHARACTER_SEQUENCE
+    | ACCENT_QUOTED_CHARACTER_SEQUENCE
+    ;
+
+graphTypeName
+    : identifier
+    ;
+
+nodeTypeName
+    : identifier
+    ;
+
+edgeTypeName
+    : identifier
+    ;
+
+bindingTableName
+    : regularIdentifier
+    | delimitedBindingTableName
+    ;
+
+delimitedBindingTableName
+     // DELIMITED_IDENTIFIER
+     : DOUBLE_QUOTED_CHARACTER_SEQUENCE
+     | ACCENT_QUOTED_CHARACTER_SEQUENCE
+     ;
+
+procedureName
+    : identifier
+    ;
+
+labelName
+    : identifier
+    ;
+
+propertyName
+    : identifier
+    ;
+
+fieldName
+    : identifier
+    ;
+
+elementVariable
+    : bindingVariable
+    ;
+
+pathVariable
+    : bindingVariable
+    ;
+
+subpathVariable
+    : regularIdentifier
+    ;
+
+bindingVariable
+    : regularIdentifier
+    ;
+
+// 21.2 <literal>
+
+unsignedLiteral
+    : unsignedNumericLiteral
+    | generalLiteral
+    ;
+
+generalLiteral
+    : BOOLEAN_LITERAL
+    | characterStringLiteral
+    | BYTE_STRING_LITERAL
+    | temporalLiteral
+    | durationLiteral
+    | nullLiteral
+    | listLiteral
+    | recordLiteral
+    ;
+
+temporalLiteral
+    : dateLiteral
+    | timeLiteral
+    | datetimeLiteral
+//    | sqlDatetimeLiteral
+    ;
+
+dateLiteral
+    : DATE dateString
+    ;
+
+timeLiteral
+    : TIME timeString
+    ;
+
+datetimeLiteral
+    : (DATETIME | TIMESTAMP) datetimeString
+    ;
+
+listLiteral
+    : listValueConstructorByEnumeration
+    ;
+
+recordLiteral
+    : recordConstructor
+    ;
+
+identifier
+    : regularIdentifier
+    // DELIMITED_IDENTIFIER
+    | DOUBLE_QUOTED_CHARACTER_SEQUENCE
+    | ACCENT_QUOTED_CHARACTER_SEQUENCE
+    ;
+
+regularIdentifier
+    : REGULAR_IDENTIFIER
+    | nonReservedWords
+    ;
+
+timeZoneString
+    : characterStringLiteral
+    ;
+
+characterStringLiteral
+    : SINGLE_QUOTED_CHARACTER_SEQUENCE
+    | DOUBLE_QUOTED_CHARACTER_SEQUENCE
+    ;
+
+unsignedNumericLiteral
+    : exactNumericLiteral
+    | approximateNumericLiteral
+    ;
+
+exactNumericLiteral
+    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+    | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+    | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
+    | UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
+    | unsignedInteger
+    ;
+
+approximateNumericLiteral
+    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+    | UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
+    | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+    | UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
+    ;
+
+unsignedInteger
+    : UNSIGNED_DECIMAL_INTEGER
+    | UNSIGNED_HEXADECIMAL_INTEGER
+    | UNSIGNED_OCTAL_INTEGER
+    | UNSIGNED_BINARY_INTEGER
+    ;
+
+unsignedDecimalInteger
+    : UNSIGNED_DECIMAL_INTEGER
+    ;
+
+nullLiteral
+    : NULL
+    ;
+
+dateString
+    : characterStringLiteral
+    ;
+
+timeString
+    : characterStringLiteral
+    ;
+
+datetimeString
+    : characterStringLiteral
+    ;
+
+durationLiteral
+    : DURATION durationString
+//    | sqlIntervalLiteral
+    ;
+
+durationString
+    : characterStringLiteral
+    ;
+
+nodeSynonym
+    : NODE
+    | VERTEX
+    ;
+
+edgesSynonym
+    : EDGES
+    | RELATIONSHIPS
+    ;
+
+edgeSynonym
+    : EDGE
+    | RELATIONSHIP
+    ;
+
+// 21.1 Names and Variables
+
+IMPLIES
+    : RIGHT_DOUBLE_ARROW
+    | 'IMPLIES'
+    ;
+
+fragment PARAMETER_NAME
+    : SEPARATED_IDENTIFIER
+    ;
+
+// 21.2 <literal>
+
+nonReservedWords
+    : ACYCLIC
+    | BINDING
+    | BINDINGS
+    | CONNECTING
+    | DESTINATION
+    | DIFFERENT
+    | DIRECTED
+    | EDGE
+    | EDGES
+    | ELEMENT
+    | ELEMENTS
+    | FIRST
+    | GRAPH
+    | GROUPS
+    | KEEP
+    | LABEL
+    | LABELED
+    | LABELS
+    | LAST
+    | NFC
+    | NFD
+    | NFKC
+    | NFKD
+    | NO
+    | NODE
+    | NORMALIZED
+    | ONLY
+    | ORDINALITY
+    | PROPERTY
+    | READ
+    | RELATIONSHIP
+    | RELATIONSHIPS
+    | REPEATABLE
+    | SHORTEST
+    | SIMPLE
+    | SOURCE
+    | TABLE
+    | TEMP
+    | TO
+    | TRAIL
+    | TRANSACTION
+    | TYPE
+    | UNDIRECTED
+    | VERTEX
+    | WALK
+    | WITHOUT
+    | WRITE
+    | ZONE
+    ;
+
+BOOLEAN_LITERAL
+    : 'TRUE'
+    | 'FALSE'
+    | 'UNKNOWN'
+    ;
+
+SINGLE_QUOTED_CHARACTER_SEQUENCE
+    : NO_ESCAPE? UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
+    ;
+
+DOUBLE_QUOTED_CHARACTER_SEQUENCE
+    : NO_ESCAPE? UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
+    ;
+
+ACCENT_QUOTED_CHARACTER_SEQUENCE
+    :NO_ESCAPE? UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
+    ;
+
+NO_ESCAPE
+    : COMMERCIAL_AT
+    ;
+
+fragment UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
+    : QUOTE SINGLE_QUOTED_CHARACTER_REPRESENTATION* QUOTE
+    ;
+
+fragment UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
+    : DOUBLE_QUOTE DOUBLE_QUOTED_CHARACTER_REPRESENTATION* DOUBLE_QUOTE
+    ;
+
+fragment UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
+    : GRAVE_ACCENT ACCENT_QUOTED_CHARACTER_REPRESENTATION* GRAVE_ACCENT
+    ;
+
+fragment SINGLE_QUOTED_CHARACTER_REPRESENTATION:
+       (ESCAPED_CHARACTER | ~['\\\r\n])+
+       ;
+
+fragment DOUBLE_QUOTED_CHARACTER_REPRESENTATION:
+       (ESCAPED_CHARACTER | ~["\\\r\n])+
+       ;
+
+fragment ACCENT_QUOTED_CHARACTER_REPRESENTATION:
+       (ESCAPED_CHARACTER | ~[`\\\r\n])+
+       ;
+
+fragment ESCAPED_CHARACTER
+    : ESCAPED_REVERSE_SOLIDUS
+       | ESCAPED_QUOTE
+       | ESCAPED_DOUBLE_QUOTE
+       | ESCAPED_GRAVE_ACCENT
+       | ESCAPED_TAB
+       | ESCAPED_BACKSPACE
+       | ESCAPED_NEW_LINE
+       | ESCAPED_CARRIAGE_RETURN
+       | ESCAPED_FORM_FEED
+       | ESCAPED_UNICODE4_DIGIT_VALUE
+       | ESCAPED_UNICODE6_DIGIT_VALUE
+       ;
+
+fragment ESCAPED_REVERSE_SOLIDUS: REVERSE_SOLIDUS REVERSE_SOLIDUS;
+fragment ESCAPED_QUOTE: REVERSE_SOLIDUS QUOTE;
+fragment ESCAPED_DOUBLE_QUOTE: REVERSE_SOLIDUS DOUBLE_QUOTE;
+fragment ESCAPED_GRAVE_ACCENT: REVERSE_SOLIDUS GRAVE_ACCENT;
+fragment ESCAPED_TAB: REVERSE_SOLIDUS 't';
+fragment ESCAPED_BACKSPACE: REVERSE_SOLIDUS 'b';
+fragment ESCAPED_NEW_LINE: REVERSE_SOLIDUS 'n';
+fragment ESCAPED_CARRIAGE_RETURN: REVERSE_SOLIDUS 'r';
+fragment ESCAPED_FORM_FEED: REVERSE_SOLIDUS 'f';
+fragment ESCAPED_UNICODE4_DIGIT_VALUE:
+       REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+fragment ESCAPED_UNICODE6_DIGIT_VALUE:
+       REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+
+// Todo: Finish this. It is tricky how it interacts with <separator>
+BYTE_STRING_LITERAL
+    : 'X' QUOTE SPACE* (HEX_DIGIT SPACE* HEX_DIGIT SPACE*)* QUOTE
+    ;
+
+UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION EXACT_NUMBER_SUFFIX
+    ;
+
+UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
+    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
+    ;
+
+UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+    : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION APPROXIMATE_NUMBER_SUFFIX
+    ;
+
+UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION EXACT_NUMBER_SUFFIX
+    ;
+
+UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
+    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
+    ;
+
+UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION APPROXIMATE_NUMBER_SUFFIX
+    ;
+
+UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
+    : UNSIGNED_DECIMAL_INTEGER EXACT_NUMBER_SUFFIX
+    ;
+
+UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
+    : UNSIGNED_DECIMAL_INTEGER APPROXIMATE_NUMBER_SUFFIX
+    ;
+
+UNSIGNED_DECIMAL_INTEGER
+    : DIGIT (UNDERSCORE? DIGIT)*
+    ;
+
+fragment EXACT_NUMBER_SUFFIX
+    : 'M'
+    ;
+
+fragment UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
+    : MANTISSA 'E' EXPONENT
+    ;
+
+fragment MANTISSA
+    : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
+    | UNSIGNED_DECIMAL_INTEGER
+    ;
+
+fragment EXPONENT
+    : SIGNED_DECIMAL_INTEGER
+    ;
+
+fragment UNSIGNED_DECIMAL_IN_COMMON_NOTATION
+    : UNSIGNED_DECIMAL_INTEGER (PERIOD UNSIGNED_DECIMAL_INTEGER?)
+    | PERIOD UNSIGNED_DECIMAL_INTEGER
+    ;
+
+fragment SIGNED_DECIMAL_INTEGER
+    : (PLUS_SIGN | MINUS_SIGN)? UNSIGNED_DECIMAL_INTEGER
+    ;
+
+UNSIGNED_HEXADECIMAL_INTEGER
+    : '0x' ('_'? HEX_DIGIT)+
+    ;
+
+UNSIGNED_OCTAL_INTEGER
+    : '0o' ('_'? OCTAL_DIGIT)+
+    ;
+
+UNSIGNED_BINARY_INTEGER
+    : '0b' ('_'? BINARY_DIGIT)+
+    ;
+
+fragment APPROXIMATE_NUMBER_SUFFIX
+    : 'F'
+    | 'D'
+    ;
+
+// 21.3 <token>, <separator>, and <identifier>
+
+// Reserved words
+ABS: 'ABS';
+ACOS: 'ACOS';
+ALL: 'ALL';
+ALL_DIFFERENT: 'ALL_DIFFERENT';
+AND: 'AND';
+ANY: 'ANY';
+ARRAY: 'ARRAY';
+AS: 'AS';
+ASC: 'ASC';
+ASCENDING: 'ASCENDING';
+ASIN: 'ASIN';
+AT: 'AT';
+ATAN: 'ATAN';
+AVG: 'AVG';
+BIG: 'BIG';
+BIGINT: 'BIGINT';
+BINARY: 'BINARY';
+BOOL: 'BOOL';
+BOOLEAN: 'BOOLEAN';
+BOTH: 'BOTH';
+BTRIM: 'BTRIM';
+BY: 'BY';
+BYTE_LENGTH: 'BYTE_LENGTH';
+BYTES: 'BYTES';
+CALL: 'CALL';
+CARDINALITY: 'CARDINALITY';
+CASE: 'CASE';
+CAST: 'CAST';
+CEIL: 'CEIL';
+CEILING: 'CEILING';
+CHAR: 'CHAR';
+CHAR_LENGTH: 'CHAR_LENGTH';
+CHARACTER_LENGTH: 'CHARACTER_LENGTH';
+CHARACTERISTICS: 'CHARACTERISTICS';
+CLOSE: 'CLOSE';
+COALESCE: 'COALESCE';
+COLLECT_LIST: 'COLLECT_LIST';
+COMMIT: 'COMMIT';
+COPY: 'COPY';
+COS: 'COS';
+COSH: 'COSH';
+COT: 'COT';
+COUNT: 'COUNT';
+CREATE: 'CREATE';
+CURRENT_DATE: 'CURRENT_DATE';
+CURRENT_GRAPH: 'CURRENT_GRAPH';
+CURRENT_PROPERTY_GRAPH: 'CURRENT_PROPERTY_GRAPH';
+CURRENT_SCHEMA: 'CURRENT_SCHEMA';
+CURRENT_TIME: 'CURRENT_TIME';
+CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
+DATE: 'DATE';
+DATETIME: 'DATETIME';
+DAY: 'DAY';
+DEC: 'DEC';
+DECIMAL: 'DECIMAL';
+DEGREES: 'DEGREES';
+DELETE: 'DELETE';
+DESC: 'DESC';
+DESCENDING: 'DESCENDING';
+DETACH: 'DETACH';
+DISTINCT: 'DISTINCT';
+DOUBLE: 'DOUBLE';
+DROP: 'DROP';
+DURATION: 'DURATION';
+DURATION_BETWEEN: 'DURATION_BETWEEN';
+ELEMENT_ID: 'ELEMENT_ID';
+ELSE: 'ELSE';
+END: 'END';
+EXCEPT: 'EXCEPT';
+EXISTS: 'EXISTS';
+EXP: 'EXP';
+FILTER: 'FILTER';
+FINISH: 'FINISH';
+FLOAT: 'FLOAT';
+FLOAT16: 'FLOAT16';
+FLOAT32: 'FLOAT32';
+FLOAT64: 'FLOAT64';
+FLOAT128: 'FLOAT128';
+FLOAT256: 'FLOAT256';
+FLOOR: 'FLOOR';
+FOR: 'FOR';
+FROM: 'FROM';
+GROUP: 'GROUP';
+HAVING: 'HAVING';
+HOME_GRAPH: 'HOME_GRAPH';
+HOME_PROPERTY_GRAPH: 'HOME_PROPERTY_GRAPH';
+HOME_SCHEMA: 'HOME_SCHEMA';
+HOUR: 'HOUR';
+IF: 'IF';
+IN: 'IN';
+INSERT: 'INSERT';
+INT: 'INT';
+INTEGER: 'INTEGER';
+INT8: 'INT8';
+INTEGER8: 'INTEGER8';
+INT16: 'INT16';
+INTEGER16: 'INTEGER16';
+INT32: 'INT32';
+INTEGER32: 'INTEGER32';
+INT64: 'INT64';
+INTEGER64: 'INTEGER64';
+INT128: 'INT128';
+INTEGER128: 'INTEGER128';
+INT256: 'INT256';
+INTEGER256: 'INTEGER256';
+INTERSECT: 'INTERSECT';
+INTERVAL: 'INTERVAL';
+IS: 'IS';
+LEADING: 'LEADING';
+LEFT: 'LEFT';
+LET: 'LET';
+LIKE: 'LIKE';
+LIMIT: 'LIMIT';
+LIST: 'LIST';
+LN: 'LN';
+LOCAL: 'LOCAL';
+LOCAL_DATETIME: 'LOCAL_DATETIME';
+LOCAL_TIME: 'LOCAL_TIME';
+LOCAL_TIMESTAMP: 'LOCAL_TIMESTAMP';
+LOG: 'LOG';
+LOG10: 'LOG10';
+LOWER: 'LOWER';
+LTRIM: 'LTRIM';
+MATCH: 'MATCH';
+MAX: 'MAX';
+MIN: 'MIN';
+MINUTE: 'MINUTE';
+MOD: 'MOD';
+MONTH: 'MONTH';
+NEXT: 'NEXT';
+NODETACH: 'NODETACH';
+NORMALIZE: 'NORMALIZE';
+NOT: 'NOT';
+NOTHING: 'NOTHING';
+NULL: 'NULL';
+NULLS: 'NULLS';
+NULLIF: 'NULLIF';
+OCTET_LENGTH: 'OCTET_LENGTH';
+OF: 'OF';
+OFFSET: 'OFFSET';
+OPTIONAL: 'OPTIONAL';
+OR: 'OR';
+ORDER: 'ORDER';
+OTHERWISE: 'OTHERWISE';
+PARAMETER: 'PARAMETER';
+PARAMETERS: 'PARAMETERS';
+PATH: 'PATH';
+PATH_LENGTH: 'PATH_LENGTH';
+PATHS: 'PATHS';
+PERCENTILE_CONT: 'PERCENTILE_CONT';
+PERCENTILE_DISC: 'PERCENTILE_DISC';
+POWER: 'POWER';
+PRECISION: 'PRECISION';
+PROPERTY_EXISTS: 'PROPERTY_EXISTS';
+RADIANS: 'RADIANS';
+REAL: 'REAL';
+RECORD: 'RECORD';
+REMOVE: 'REMOVE';
+REPLACE: 'REPLACE';
+RESET: 'RESET';
+RETURN: 'RETURN';
+RIGHT: 'RIGHT';
+ROLLBACK: 'ROLLBACK';
+RTRIM: 'RTRIM';
+SAME: 'SAME';
+SCHEMA: 'SCHEMA';
+SECOND: 'SECOND';
+SELECT: 'SELECT';
+SESSION: 'SESSION';
+SESSION_USER: 'SESSION_USER';
+SET: 'SET';
+SIGNED: 'SIGNED';
+SIN: 'SIN';
+SINH: 'SINH';
+SIZE: 'SIZE';
+SKIP_RESERVED_WORD: 'SKIP';
+SMALL: 'SMALL';
+SMALLINT: 'SMALLINT';
+SQRT: 'SQRT';
+START: 'START';
+STDDEV_POP: 'STDDEV_POP';
+STDDEV_SAMP: 'STDDEV_SAMP';
+STRING: 'STRING';
+SUM: 'SUM';
+TAN: 'TAN';
+TANH: 'TANH';
+THEN: 'THEN';
+TIME: 'TIME';
+TIMESTAMP: 'TIMESTAMP';
+TRAILING: 'TRAILING';
+TRIM: 'TRIM';
+TYPED: 'TYPED';
+UBIGINT: 'UBIGINT';
+UINT: 'UINT';
+UINT8: 'UINT8';
+UINT16: 'UINT16';
+UINT32: 'UINT32';
+UINT64: 'UINT64';
+UINT128: 'UINT128';
+UINT256: 'UINT256';
+UNION: 'UNION';
+UNSIGNED: 'UNSIGNED';
+UPPER: 'UPPER';
+USE: 'USE';
+USMALLINT: 'USMALLINT';
+VALUE: 'VALUE';
+VARBINARY: 'VARBINARY';
+VARCHAR: 'VARCHAR';
+VARIABLE: 'VARIABLE';
+WHEN: 'WHEN';
+WHERE: 'WHERE';
+WITH: 'WITH';
+XOR: 'XOR';
+YEAR: 'YEAR';
+YIELD: 'YIELD';
+ZONED: 'ZONED';
+ZONED_DATETIME: 'ZONED_DATETIME';
+ZONED_TIME: 'ZONED_TIME';
+
+// Prereserved words
+ABSTRACT: 'ABSTRACT';
+AGGREGATE: 'AGGREGATE';
+AGGREGATES: 'AGGREGATES';
+ALTER: 'ALTER';
+CATALOG: 'CATALOG';
+CLEAR: 'CLEAR';
+CLONE: 'CLONE';
+CONSTRAINT: 'CONSTRAINT';
+CURRENT_ROLE: 'CURRENT_ROLE';
+CURRENT_USER: 'CURRENT_USER';
+DATA: 'DATA';
+DIRECTORY: 'DIRECTORY';
+DRYRUN: 'DRYRUN';
+EXACT: 'EXACT';
+EXISTING: 'EXISTING';
+FUNCTION: 'FUNCTION';
+GQLSTATUS: 'GQLSTATUS';
+GRANT: 'GRANT';
+INSTANT: 'INSTANT';
+INFINITY: 'INFINITY';
+NUMBER: 'NUMBER';
+NUMERIC: 'NUMERIC';
+ON: 'ON';
+OPEN: 'OPEN';
+PARTITION: 'PARTITION';
+PROCEDURE: 'PROCEDURE';
+PRODUCT: 'PRODUCT';
+PROJECT: 'PROJECT';
+QUERY: 'QUERY';
+RECORDS: 'RECORDS';
+REFERENCE: 'REFERENCE';
+RENAME: 'RENAME';
+REVOKE: 'REVOKE';
+SUBSTRING: 'SUBSTRING';
+SYSTEM_USER: 'SYSTEM_USER';
+TEMPORAL: 'TEMPORAL';
+UNIQUE: 'UNIQUE';
+UNIT: 'UNIT';
+VALUES: 'VALUES';
+
+// Nonreserved words
+ACYCLIC: 'ACYCLIC';
+BINDING: 'BINDING';
+BINDINGS: 'BINDINGS';
+CONNECTING: 'CONNECTING';
+DESTINATION: 'DESTINATION';
+DIFFERENT: 'DIFFERENT';
+DIRECTED: 'DIRECTED';
+EDGE: 'EDGE';
+EDGES: 'EDGES';
+ELEMENT: 'ELEMENT';
+ELEMENTS: 'ELEMENTS';
+FIRST: 'FIRST';
+GRAPH: 'GRAPH';
+GROUPS: 'GROUPS';
+KEEP: 'KEEP';
+LABEL: 'LABEL';
+LABELED: 'LABELED';
+LABELS: 'LABELS';
+LAST: 'LAST';
+NFC: 'NFC';
+NFD: 'NFD';
+NFKC: 'NFKC';
+NFKD: 'NFKD';
+NO: 'NO';
+NODE: 'NODE';
+NORMALIZED: 'NORMALIZED';
+ONLY: 'ONLY';
+ORDINALITY: 'ORDINALITY';
+PROPERTY: 'PROPERTY';
+READ: 'READ';
+RELATIONSHIP: 'RELATIONSHIP';
+RELATIONSHIPS: 'RELATIONSHIPS';
+REPEATABLE: 'REPEATABLE';
+SHORTEST: 'SHORTEST';
+SIMPLE: 'SIMPLE';
+SOURCE: 'SOURCE';
+TABLE: 'TABLE';
+TEMP: 'TEMP';
+TO: 'TO';
+TRAIL: 'TRAIL';
+TRANSACTION: 'TRANSACTION';
+TYPE: 'TYPE';
+UNDIRECTED: 'UNDIRECTED';
+VERTEX: 'VERTEX';
+WALK: 'WALK';
+WITHOUT: 'WITHOUT';
+WRITE: 'WRITE';
+ZONE: 'ZONE';
+
+fragment SEPARATED_IDENTIFIER
+    : DELIMITED_IDENTIFIER
+    | EXTENDED_IDENTIFIER
+    ;
+
+REGULAR_IDENTIFIER
+    : IDENTIFIER_START IDENTIFIER_EXTEND*
+    ;
+
+fragment EXTENDED_IDENTIFIER
+    : IDENTIFIER_EXTEND+
+    ;
+
+fragment DELIMITED_IDENTIFIER
+    : DOUBLE_QUOTED_CHARACTER_SEQUENCE
+    | ACCENT_QUOTED_CHARACTER_SEQUENCE
+    ;
+
+SUBSTITUTED_PARAMETER_REFERENCE
+    : DOUBLE_DOLLAR_SIGN PARAMETER_NAME
+    ;
+
+GENERAL_PARAMETER_REFERENCE
+    : DOLLAR_SIGN PARAMETER_NAME
+    ;
+
+fragment IDENTIFIER_START
+    : ID_Start
+    | Pc
+    ;
+
+fragment IDENTIFIER_EXTEND
+    : ID_Continue
+    ;
+
+fragment ID_Start
+    : [\p{ID_Start}]
+    ;
+
+fragment ID_Continue
+    : [\p{ID_Continue}]
+    ;
+
+MULTISET_ALTERNATION_OPERATOR: '|+|';
+
+BRACKET_RIGHT_ARROW: ']->';
+BRACKET_TILDE_RIGHT_ARROW: ']~>';
+CONCATENATION_OPERATOR: '||';
+DOUBLE_COLON: '::';
+DOUBLE_DOLLAR_SIGN: '$$';
+DOUBLE_PERIOD: '..';
+GREATER_THAN_OR_EQUALS_OPERATOR: '>=';
+LEFT_ARROW: '<-';
+LEFT_ARROW_TILDE: '<~';
+LEFT_ARROW_BRACKET: '<-[';
+LEFT_ARROW_TILDE_BRACKET: '<~[';
+LEFT_MINUS_RIGHT: '<->';
+LEFT_MINUS_SLASH: '<-/';
+LEFT_TILDE_SLASH: '<~/';
+LESS_THAN_OR_EQUALS_OPERATOR: '<=';
+MINUS_LEFT_BRACKET: '-[';
+MINUS_SLASH: '-/';
+NOT_EQUALS_OPERATOR: '<>';
+RIGHT_ARROW: '->';
+RIGHT_BRACKET_MINUS: ']-';
+RIGHT_BRACKET_TILDE: ']~';
+RIGHT_DOUBLE_ARROW: '=>';
+SLASH_MINUS: '/-';
+SLASH_MINUS_RIGHT: '/->';
+SLASH_TILDE: '/~';
+SLASH_TILDE_RIGHT: '/~>';
+TILDE_LEFT_BRACKET: '~[';
+TILDE_RIGHT_ARROW: '~>';
+TILDE_SLASH: '~/';
+
+// 21.4 GQL terminal characters
+
+AMPERSAND: '&';
+ASTERISK: '*';
+COLON: ':';
+COMMA: ',';
+COMMERCIAL_AT: '@';
+DOLLAR_SIGN: '$';
+DOUBLE_QUOTE: '"';
+EQUALS_OPERATOR: '=';
+EXCLAMATION_MARK: '!';
+RIGHT_ANGLE_BRACKET: '>';
+GRAVE_ACCENT: '`';
+LEFT_BRACE: '{';
+LEFT_BRACKET: '[';
+LEFT_PAREN: '(';
+LEFT_ANGLE_BRACKET: '<';
+MINUS_SIGN: '-';
+PERCENT: '%';
+PERIOD: '.';
+PLUS_SIGN: '+';
+QUESTION_MARK: '?';
+QUOTE: '\'';
+REVERSE_SOLIDUS: '\\';
+RIGHT_BRACE: '}';
+RIGHT_BRACKET: ']';
+RIGHT_PAREN: ')';
+SOLIDUS: '/';
+TILDE: '~';
+UNDERSCORE: '_';
+VERTICAL_BAR: '|';
+
+fragment HEX_DIGIT
+    : [0-9a-f]
+    ;
+
+fragment DIGIT
+    : [0-9]
+    ;
+
+fragment OCTAL_DIGIT
+    : [0-7]
+    ;
+
+fragment BINARY_DIGIT
+    : [0-1]
+    ;
+
+SP
+  : (WHITESPACE)+
+  -> channel(HIDDEN)
+  ;
+
+WHITESPACE
+    : SPACE
+    | TAB
+    | LF
+    | VT
+    | FF
+    | CR
+    | FS
+    | GS
+    | RS
+    | US
+    | '\u1680'
+    | '\u180e'
+    | '\u2000'
+    | '\u2001'
+    | '\u2002'
+    | '\u2003'
+    | '\u2004'
+    | '\u2005'
+    | '\u2006'
+    | '\u2008'
+    | '\u2009'
+    | '\u200a'
+    | '\u2028'
+    | '\u2029'
+    | '\u205f'
+    | '\u3000'
+    | '\u00a0'
+    | '\u2007'
+    | '\u202f'
+    ;
+
+BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
+
+SIMPLE_COMMENT_SOLIDUS: '//' ~[\r\n]* -> channel(HIDDEN);
+
+SIMPLE_COMMENT_MINUS: '--' ~[\r\n]* -> channel(HIDDEN);
+
+fragment GS : [\u001D];
+
+fragment FS : [\u001C];
+
+fragment CR : [\r];
+
+fragment Sc : [\p{Sc}];
+
+fragment SPACE : [ ];
+
+fragment Pc : [\p{Pc}];
+
+fragment TAB : [\t];
+
+fragment LF : [\n];
+
+fragment VT : [\u000B];
+
+fragment US : [\u001F];
+
+fragment FF: [\f];
+
+fragment RS: [\u001E];
diff --git a/developers/ANTLR/GQL_20240412_rf1_literals.g4 b/developers/ANTLR/GQL_20240412_rf1_literals.g4
new file mode 100644 (file)
index 0000000..e9ac41e
--- /dev/null
@@ -0,0 +1,66 @@
+// Define tokens for each category
+
+// Data Types
+DATA_TYPE: BOOL | BOOLEAN | BYTE_STRING_LITERAL | CHAR | DATETIME | DECIMAL | FLOAT | 
+            INTEGER | INT | REAL | SMALLINT | STRING | TIME | TIMESTAMP | UBIGINT | 
+            UNSIGNED_BINARY_INTEGER | UNSIGNED_DECIMAL_INTEGER | UNSIGNED_HEXADECIMAL_INTEGER | 
+            UNSIGNED_OCTAL_INTEGER | VARBINARY | VARCHAR | INT8 | INT16 | INT32 | INT64 | 
+            INT128 | INT256 | BIGINT | UINT8 | UINT16 | UINT32 | UINT64 | UINT128 | UINT256 |
+            BYTE_LENGTH | BYTES | CARDINALITY | DATE | DAY | DEC | DOUBLE | DURATION | 
+            DURATION_BETWEEN | ELEMENT | ELEMENT_ID | FLOAT | INSTANT | INTERVAL | MAX | MIN | 
+            MINUTE | MODULUS | MONTH | NUMERIC | SIZE | TEMP | TEMPORAL | TIME | UINT | 
+            VALUE | VALUES | YEAR | ZONED | ZONED_DATETIME | ZONED_TIME | USMALLINT ;
+
+// Functions
+FUNCTION: ABS | ACOS | ASIN | ATAN | AVG | CEIL | CEILING | COS | COSH | EXP | FLOOR | 
+          LOG | LOG10 | MOD | POWER | RADIANS | SIN | SINH | SQRT | TAN | TANH | TRIM | 
+          LTRIM | RTRIM | BTRIM | CONCATENATION_OPERATOR | CHARACTER_LENGTH | OCTET_LENGTH | 
+          POSITION | SUBSTRING | UPPER | LOWER | AGGREGATE | AGGREGATES | ALL_DIFFERENT | 
+          CAST | COT | COUNT | STDDEV_POP | STDDEV_SAMP | SUM ;
+
+// Punctuation and Operators
+PUNCTUATION_OPERATOR: AMPERSAND | ASTERISK | COLON | COMMA | CONCATENATION_OPERATOR | 
+                      DOLLAR_SIGN | DOUBLE_COLON | DOUBLE_PERIOD | DOUBLE_QUOTE | 
+                      DOUBLE_DOLLAR_SIGN | EQUALS_OPERATOR | EXCLAMATION_MARK | 
+                      GREATER_THAN_OR_EQUALS_OPERATOR | LEFT_ANGLE_BRACKET | LEFT_ARROW | 
+                      LEFT_BRACE | LEFT_BRACKET | LEFT_MINUS_RIGHT | LEFT_MINUS_SLASH | 
+                      LEFT_PAREN | LEFT_TILDE_SLASH | LESS_THAN_OR_EQUALS_OPERATOR | 
+                      MINUS_LEFT_BRACKET | MINUS_SIGN | PERIOD | PLUS_SIGN | RIGHT_ANGLE_BRACKET | 
+                      RIGHT_ARROW | RIGHT_BRACE | RIGHT_BRACKET | RIGHT_BRACKET_MINUS | 
+                      RIGHT_BRACKET_TILDE | RIGHT_DOUBLE_ARROW | RIGHT_PAREN | SOLIDUS | 
+                      TILDE | TILDE_LEFT_BRACKET | TILDE_RIGHT_ARROW | TILDE_SLASH | VERTICAL_BAR |
+                      BRACKETED_COMMENT | BRACKET_RIGHT_ARROW | BRACKET_TILDE_RIGHT_ARROW | 
+                      COMMERCIAL_AT | DOUBLE_QUOTED_CHARACTER_SEQUENCE | SINGLE_QUOTED_CHARACTER_SEQUENCE | 
+                      SLASH_MINUS | SLASH_MINUS_RIGHT | SLASH_TILDE | SLASH_TILDE_RIGHT | 
+                      REVERSE_SOLIDUS | UNDERSCORE ;
+
+// Keywords
+KEYWORD: ALL | AND | ANY | ARRAY | AS | ASC | DESC | DISTINCT | EXISTS | FALSE | FROM | 
+         GROUP | HAVING | IN | IS | LIKE | MATCH | NOT | NULL | ON | OR | ORDER | 
+         RETURN | SELECT | TRUE | UNION | USING | WHERE | WITH | ABSTRACT | ALTER | 
+         ASCENDING | AT | BIG | BINARY | BINDING | BINDINGS | BOTH | CALL | CATALOG | 
+         CLEAR | CLONE | CLOSE | COMMIT | CONSTRAINT | CREATE | CURRENT_PROPERTY_GRAPH | 
+         CURRENT_SCHEMA | DELETE | DESCENDING | DETACH | DIFFERENT | DIRECTED | DIRECTORY | 
+         DROP | DRYRUN | ELEMENTS | EXCEPT | EXISTING | FILTER | FINISH | FIRST | FUNCTION | 
+         GENERAL_PARAMETER_REFERENCE | GRANT | GROUPS | HOME_GRAPH | HOME_PROPERTY_GRAPH | 
+         HOME_SCHEMA | INSERT | INTERSECT | KEEP | LABELED | LAST | LEADING | LEFT | 
+         LEFT_ARROW_BRACKET | LEFT_ARROW_TILDE | LIST | NOTHING | NULLIF | OF | ONLY | 
+         OPEN | OPTIONAL | ORDINALITY | OTHERWISE | PARENT | PARENTHESIZED | PATH | 
+         PATHS | PRECISION | PRIMARY | PRIORITY | PROCEDURE | PRODUCT | PROPERTIES | 
+         PROPERTY | PROPERTY_EXISTS | QUANTIFIER | REFERENCE | REFERENCES | REFLECT | 
+         REGULAR | REMOVE | RENAME | REPEATABLE | REPLACE | RESET | REVOKE | RIGHT | 
+         ROLLBACK | SAME | SCHEMA | SESSION | SET | SHORTEST | SIGNED | SIMPLE | 
+         SIMPLE_COMMENT_MINUS | SIMPLE_COMMENT_SOLIDUS | SOURCE | SP | START | 
+         SUBSTITUTED_PARAMETER_REFERENCE | TABLE | TO | TRAIL | TRAILING | TRANSACTION | 
+         TYPED | UNDIRECTED | UNIQUE | UNIT | UNSIGNED | USE | VERTEX | WALK | WHITESPACE | 
+         WITHOUT | WRITE | XOR | YIELD | ZONE ;
+
+// Literals
+LITERAL: NULL | TRUE | FALSE | NUMBER | BOOLEAN_LITERAL ;
+
+// Control Flow
+CONTROL_FLOW: CASE | WHEN | THEN | ELSE | END | IF | FOR | WHILE | DO | LOOP | 
+              BREAK | CONTINUE | RETURN | IMPLIES ;
+
+// Miscellaneous
+MISC: ACCENT_QUOTED_CHARACTER_SEQUENCE | ACYCLIC | GRAVE_ACCENT ;
diff --git a/developers/ANTLR/GQL_20240412_substituted.g4 b/developers/ANTLR/GQL_20240412_substituted.g4
new file mode 100644 (file)
index 0000000..25de3e2
--- /dev/null
@@ -0,0 +1,5783 @@
+// Original: grammar GQL_20240412;
+CONTROL_FLOWgrammarCONTROL_FLOW CONTROL_FLOWGQL_20240412CONTROL_FLOW;
+
+// Original: options { caseInsensitive = true; }
+CONTROL_FLOWoptionsCONTROL_FLOW { CONTROL_FLOWcaseInsensitiveCONTROL_FLOW = CONTROL_FLOWtrueCONTROL_FLOW; }
+
+// 6 <GQL-program>
+
+// Original: gqlProgram
+CONTROL_FLOWgqlProgramCONTROL_FLOW
+// Original: : programActivity sessionCloseCommand? EOF
+: CONTROL_FLOWprogramActivityCONTROL_FLOW CONTROL_FLOWsessionCloseCommandCONTROL_FLOW? CONTROL_FLOWEOFCONTROL_FLOW
+// Original: | sessionCloseCommand EOF
+| CONTROL_FLOWsessionCloseCommandCONTROL_FLOW CONTROL_FLOWEOFCONTROL_FLOW
+;
+
+// Original: programActivity
+CONTROL_FLOWprogramActivityCONTROL_FLOW
+// Original: : sessionActivity
+: CONTROL_FLOWsessionActivityCONTROL_FLOW
+// Original: | transactionActivity
+| CONTROL_FLOWtransactionActivityCONTROL_FLOW
+;
+
+// Original: sessionActivity
+CONTROL_FLOWsessionActivityCONTROL_FLOW
+: sessionResetCommand+
+| sessionSetCommand+ sessionResetCommand*
+;
+
+// Original: transactionActivity
+CONTROL_FLOWtransactionActivityCONTROL_FLOW
+: startTransactionCommand (procedureSpecification endTransactionCommand?)?
+| procedureSpecification endTransactionCommand?
+// Original: | endTransactionCommand
+| CONTROL_FLOWendTransactionCommandCONTROL_FLOW
+;
+
+// Original: endTransactionCommand
+CONTROL_FLOWendTransactionCommandCONTROL_FLOW
+// Original: : rollbackCommand
+: CONTROL_FLOWrollbackCommandCONTROL_FLOW
+// Original: | commitCommand
+| CONTROL_FLOWcommitCommandCONTROL_FLOW
+;
+
+// 7.1 <session set command>
+
+// Original: sessionSetCommand
+CONTROL_FLOWsessionSetCommandCONTROL_FLOW
+// Original: : SESSION SET (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
+// Original: : SESSION KEYWORD (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
+: KEYWORD KEYWORD (sessionSetSchemaClause | sessionSetGraphClause | sessionSetTimeZoneClause | sessionSetParameterClause)
+;
+
+// Original: sessionSetSchemaClause
+CONTROL_FLOWsessionSetSchemaClauseCONTROL_FLOW
+// Original: : SCHEMA schemaReference
+: CONTROL_FLOWSCHEMACONTROL_FLOW CONTROL_FLOWschemaReferenceCONTROL_FLOW
+;
+
+// Original: sessionSetGraphClause
+CONTROL_FLOWsessionSetGraphClauseCONTROL_FLOW
+// Original: : PROPERTY? GRAPH graphExpression
+: CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
+;
+
+// Original: sessionSetTimeZoneClause
+CONTROL_FLOWsessionSetTimeZoneClauseCONTROL_FLOW
+// Original: : TIME ZONE setTimeZoneValue
+: CONTROL_FLOWTIMECONTROL_FLOW CONTROL_FLOWZONECONTROL_FLOW CONTROL_FLOWsetTimeZoneValueCONTROL_FLOW
+;
+
+// Original: setTimeZoneValue
+CONTROL_FLOWsetTimeZoneValueCONTROL_FLOW
+// Original: : timeZoneString
+: CONTROL_FLOWtimeZoneStringCONTROL_FLOW
+;
+
+// Original: sessionSetParameterClause
+CONTROL_FLOWsessionSetParameterClauseCONTROL_FLOW
+// Original: : sessionSetGraphParameterClause
+: CONTROL_FLOWsessionSetGraphParameterClauseCONTROL_FLOW
+// Original: | sessionSetBindingTableParameterClause
+| CONTROL_FLOWsessionSetBindingTableParameterClauseCONTROL_FLOW
+// Original: | sessionSetValueParameterClause
+| CONTROL_FLOWsessionSetValueParameterClauseCONTROL_FLOW
+;
+
+// Original: sessionSetGraphParameterClause
+CONTROL_FLOWsessionSetGraphParameterClauseCONTROL_FLOW
+// Original: : PROPERTY? GRAPH sessionSetParameterName optTypedGraphInitializer
+: CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW CONTROL_FLOWoptTypedGraphInitializerCONTROL_FLOW
+;
+
+// Original: sessionSetBindingTableParameterClause
+CONTROL_FLOWsessionSetBindingTableParameterClauseCONTROL_FLOW
+// Original: : BINDING? TABLE sessionSetParameterName optTypedBindingTableInitializer
+// Original: : KEYWORD? TABLE sessionSetParameterName optTypedBindingTableInitializer
+: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW CONTROL_FLOWoptTypedBindingTableInitializerCONTROL_FLOW
+;
+
+// Original: sessionSetValueParameterClause
+CONTROL_FLOWsessionSetValueParameterClauseCONTROL_FLOW
+// Original: : VALUE sessionSetParameterName optTypedValueInitializer
+: CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW CONTROL_FLOWoptTypedValueInitializerCONTROL_FLOW
+;
+
+// Original: sessionSetParameterName
+CONTROL_FLOWsessionSetParameterNameCONTROL_FLOW
+// Original: : (IF NOT EXISTS)? sessionParameterSpecification
+: (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWsessionParameterSpecificationCONTROL_FLOW
+;
+
+// 7.2 <session reset command>
+
+// Original: sessionResetCommand
+CONTROL_FLOWsessionResetCommandCONTROL_FLOW
+// Original: : SESSION RESET sessionResetArguments?
+// Original: : KEYWORD RESET sessionResetArguments?
+: KEYWORD KEYWORD sessionResetArguments?
+;
+
+// Original: sessionResetArguments
+CONTROL_FLOWsessionResetArgumentsCONTROL_FLOW
+// Original: : ALL? (PARAMETERS | CHARACTERISTICS)
+: KEYWORD? (PARAMETERS | CHARACTERISTICS)
+// Original: | SCHEMA
+| CONTROL_FLOWSCHEMACONTROL_FLOW
+// Original: | PROPERTY? GRAPH
+| CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW
+// Original: | TIME ZONE
+| CONTROL_FLOWTIMECONTROL_FLOW CONTROL_FLOWZONECONTROL_FLOW
+// Original: | PARAMETER? sessionParameterSpecification
+| CONTROL_FLOWPARAMETERCONTROL_FLOW? CONTROL_FLOWsessionParameterSpecificationCONTROL_FLOW
+;
+
+// 7.3 <session close command>
+
+// Original: sessionCloseCommand
+CONTROL_FLOWsessionCloseCommandCONTROL_FLOW
+// Original: : SESSION CLOSE
+// Original: : SESSION KEYWORD
+: CONTROL_FLOWSESSIONCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW
+;
+
+// 7.4 <session parameter specification>
+
+// Original: sessionParameterSpecification
+CONTROL_FLOWsessionParameterSpecificationCONTROL_FLOW
+// Original: : GENERAL_PARAMETER_REFERENCE
+: CONTROL_FLOWGENERAL_PARAMETER_REFERENCECONTROL_FLOW
+;
+
+// 8.1 <start transaction command>
+
+// Original: startTransactionCommand
+CONTROL_FLOWstartTransactionCommandCONTROL_FLOW
+// Original: : START TRANSACTION transactionCharacteristics?
+// Original: : KEYWORD TRANSACTION transactionCharacteristics?
+: KEYWORD KEYWORD transactionCharacteristics?
+;
+
+// 8.2 <transaction characteristics>
+
+// Original: transactionCharacteristics
+CONTROL_FLOWtransactionCharacteristicsCONTROL_FLOW
+// Original: : transactionMode (COMMA transactionMode)*
+: transactionMode (PUNCTUATION_OPERATOR transactionMode)*
+;
+
+// Original: transactionMode
+CONTROL_FLOWtransactionModeCONTROL_FLOW
+// Original: : transactionAccessMode
+: CONTROL_FLOWtransactionAccessModeCONTROL_FLOW
+;
+
+// Original: transactionAccessMode
+CONTROL_FLOWtransactionAccessModeCONTROL_FLOW
+// Original: : READ ONLY
+: CONTROL_FLOWREADCONTROL_FLOW CONTROL_FLOWONLYCONTROL_FLOW
+// Original: | READ WRITE
+| CONTROL_FLOWREADCONTROL_FLOW CONTROL_FLOWWRITECONTROL_FLOW
+;
+
+// 8.3 <rollback command>
+
+// Original: rollbackCommand
+CONTROL_FLOWrollbackCommandCONTROL_FLOW
+// Original: : ROLLBACK
+: CONTROL_FLOWROLLBACKCONTROL_FLOW
+;
+
+// 8.4 <commit command>
+
+// Original: commitCommand
+CONTROL_FLOWcommitCommandCONTROL_FLOW
+// Original: : COMMIT
+: CONTROL_FLOWCOMMITCONTROL_FLOW
+;
+
+// 9.1 <nested procedure specification>
+
+// Original: nestedProcedureSpecification
+CONTROL_FLOWnestedProcedureSpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE procedureSpecification RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWprocedureSpecificationCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: // <catalog-modifying procedure specification>, <data-modifying procedure specification> and <query specification> are
+// <CONTROL_FLOWcatalogCONTROL_FLOW-CONTROL_FLOWmodifyingCONTROL_FLOW CONTROL_FLOWprocedureCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW>, <CONTROL_FLOWdataCONTROL_FLOW-CONTROL_FLOWmodifyingCONTROL_FLOW CONTROL_FLOWprocedureCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW> CONTROL_FLOWandCONTROL_FLOW <CONTROL_FLOWqueryCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW> CONTROL_FLOWareCONTROL_FLOW
+// Original: // identical productions. The specification distinguishes them in the BNF, but in the implementation, the distinction
+// CONTROL_FLOWidenticalCONTROL_FLOW CONTROL_FLOWproductionsCONTROL_FLOW. CONTROL_FLOWTheCONTROL_FLOW CONTROL_FLOWspecificationCONTROL_FLOW CONTROL_FLOWdistinguishesCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWBNFCONTROL_FLOW, CONTROL_FLOWbutCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWimplementationCONTROL_FLOW, CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWdistinctionCONTROL_FLOW
+// has to be made sematically, in code, based on the kind of statements contained in the <procedure specification>.
+// Original: procedureSpecification
+CONTROL_FLOWprocedureSpecificationCONTROL_FLOW
+// Original: : procedureBody
+: CONTROL_FLOWprocedureBodyCONTROL_FLOW
+// Original: //    : catalogModifyingProcedureSpecification
+//    : CONTROL_FLOWcatalogModifyingProcedureSpecificationCONTROL_FLOW
+// Original: //    | dataModifyingProcedureSpecification
+//    | CONTROL_FLOWdataModifyingProcedureSpecificationCONTROL_FLOW
+// Original: //    | querySpecification
+//    | CONTROL_FLOWquerySpecificationCONTROL_FLOW
+;
+
+// Original: //catalogModifyingProcedureSpecification
+//CONTROL_FLOWcatalogModifyingProcedureSpecificationCONTROL_FLOW
+// Original: //    : procedureBody
+//    : CONTROL_FLOWprocedureBodyCONTROL_FLOW
+//    ;
+
+// Original: nestedDataModifyingProcedureSpecification
+CONTROL_FLOWnestedDataModifyingProcedureSpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE procedureBody RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWprocedureBodyCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: //dataModifyingProcedureSpecification
+//CONTROL_FLOWdataModifyingProcedureSpecificationCONTROL_FLOW
+// Original: //    : procedureBody
+//    : CONTROL_FLOWprocedureBodyCONTROL_FLOW
+//    ;
+
+// Original: nestedQuerySpecification
+CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE procedureBody RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWprocedureBodyCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: //querySpecification
+//CONTROL_FLOWquerySpecificationCONTROL_FLOW
+// Original: //    : procedureBody
+//    : CONTROL_FLOWprocedureBodyCONTROL_FLOW
+//    ;
+
+// 9.2 <procedure body>
+
+// Original: procedureBody
+CONTROL_FLOWprocedureBodyCONTROL_FLOW
+// Original: : atSchemaClause? bindingVariableDefinitionBlock? statementBlock
+: CONTROL_FLOWatSchemaClauseCONTROL_FLOW? CONTROL_FLOWbindingVariableDefinitionBlockCONTROL_FLOW? CONTROL_FLOWstatementBlockCONTROL_FLOW
+;
+
+// Original: bindingVariableDefinitionBlock
+CONTROL_FLOWbindingVariableDefinitionBlockCONTROL_FLOW
+: bindingVariableDefinition+
+;
+
+// Original: bindingVariableDefinition
+CONTROL_FLOWbindingVariableDefinitionCONTROL_FLOW
+// Original: : graphVariableDefinition
+: CONTROL_FLOWgraphVariableDefinitionCONTROL_FLOW
+// Original: | bindingTableVariableDefinition
+| CONTROL_FLOWbindingTableVariableDefinitionCONTROL_FLOW
+// Original: | valueVariableDefinition
+| CONTROL_FLOWvalueVariableDefinitionCONTROL_FLOW
+;
+
+// Original: statementBlock
+CONTROL_FLOWstatementBlockCONTROL_FLOW
+: statement nextStatement*
+;
+
+// Original: statement
+CONTROL_FLOWstatementCONTROL_FLOW
+// Original: : linearCatalogModifyingStatement
+: CONTROL_FLOWlinearCatalogModifyingStatementCONTROL_FLOW
+// Original: | linearDataModifyingStatement
+| CONTROL_FLOWlinearDataModifyingStatementCONTROL_FLOW
+// Original: | compositeQueryStatement
+| CONTROL_FLOWcompositeQueryStatementCONTROL_FLOW
+;
+
+// Original: nextStatement
+CONTROL_FLOWnextStatementCONTROL_FLOW
+// Original: : NEXT yieldClause? statement
+: CONTROL_FLOWNEXTCONTROL_FLOW CONTROL_FLOWyieldClauseCONTROL_FLOW? CONTROL_FLOWstatementCONTROL_FLOW
+;
+
+// 10.1 <graph variable definition>
+
+// Original: graphVariableDefinition
+CONTROL_FLOWgraphVariableDefinitionCONTROL_FLOW
+// Original: : PROPERTY? GRAPH bindingVariable optTypedGraphInitializer
+: CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWoptTypedGraphInitializerCONTROL_FLOW
+;
+
+// Original: optTypedGraphInitializer
+CONTROL_FLOWoptTypedGraphInitializerCONTROL_FLOW
+// Original: : (typed? graphReferenceValueType)? graphInitializer
+: (CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWgraphReferenceValueTypeCONTROL_FLOW)? CONTROL_FLOWgraphInitializerCONTROL_FLOW
+;
+
+// Original: graphInitializer
+CONTROL_FLOWgraphInitializerCONTROL_FLOW
+// Original: : EQUALS_OPERATOR graphExpression
+: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
+;
+
+// 10.2 <binding table variable definition>
+
+// Original: bindingTableVariableDefinition
+CONTROL_FLOWbindingTableVariableDefinitionCONTROL_FLOW
+// Original: : BINDING? TABLE bindingVariable optTypedBindingTableInitializer
+// Original: : KEYWORD? TABLE bindingVariable optTypedBindingTableInitializer
+: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWoptTypedBindingTableInitializerCONTROL_FLOW
+;
+
+// Original: optTypedBindingTableInitializer
+CONTROL_FLOWoptTypedBindingTableInitializerCONTROL_FLOW
+// Original: : (typed? bindingTableReferenceValueType)? bindingTableInitializer
+: (CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWbindingTableReferenceValueTypeCONTROL_FLOW)? CONTROL_FLOWbindingTableInitializerCONTROL_FLOW
+;
+
+// Original: bindingTableInitializer
+CONTROL_FLOWbindingTableInitializerCONTROL_FLOW
+// Original: : EQUALS_OPERATOR bindingTableExpression
+: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWbindingTableExpressionCONTROL_FLOW
+;
+
+// 10.3 <value variable definition>
+
+// Original: valueVariableDefinition
+CONTROL_FLOWvalueVariableDefinitionCONTROL_FLOW
+// Original: : VALUE bindingVariable optTypedValueInitializer
+: CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWoptTypedValueInitializerCONTROL_FLOW
+;
+
+// Original: optTypedValueInitializer
+CONTROL_FLOWoptTypedValueInitializerCONTROL_FLOW
+// Original: : (typed? valueType)? valueInitializer
+: (CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWvalueTypeCONTROL_FLOW)? CONTROL_FLOWvalueInitializerCONTROL_FLOW
+;
+
+// Original: valueInitializer
+CONTROL_FLOWvalueInitializerCONTROL_FLOW
+// Original: : EQUALS_OPERATOR valueExpression
+: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 11.1 <graph expression>
+
+// Original: graphExpression
+CONTROL_FLOWgraphExpressionCONTROL_FLOW
+// Original: : objectExpressionPrimary
+: CONTROL_FLOWobjectExpressionPrimaryCONTROL_FLOW
+// Original: | graphReference
+| CONTROL_FLOWgraphReferenceCONTROL_FLOW
+// Original: | objectNameOrBindingVariable
+| CONTROL_FLOWobjectNameOrBindingVariableCONTROL_FLOW
+// Original: | currentGraph
+| CONTROL_FLOWcurrentGraphCONTROL_FLOW
+;
+
+// Original: currentGraph
+CONTROL_FLOWcurrentGraphCONTROL_FLOW
+// Original: : CURRENT_PROPERTY_GRAPH
+// Original: : KEYWORD
+: CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | CURRENT_GRAPH
+| CONTROL_FLOWCURRENT_GRAPHCONTROL_FLOW
+;
+
+// 11.2 <binding table expression>
+
+// Original: bindingTableExpression
+CONTROL_FLOWbindingTableExpressionCONTROL_FLOW
+// Original: : nestedBindingTableQuerySpecification
+: CONTROL_FLOWnestedBindingTableQuerySpecificationCONTROL_FLOW
+// Original: | objectExpressionPrimary
+| CONTROL_FLOWobjectExpressionPrimaryCONTROL_FLOW
+// Original: | bindingTableReference
+| CONTROL_FLOWbindingTableReferenceCONTROL_FLOW
+// Original: | objectNameOrBindingVariable
+| CONTROL_FLOWobjectNameOrBindingVariableCONTROL_FLOW
+;
+
+// Original: nestedBindingTableQuerySpecification
+CONTROL_FLOWnestedBindingTableQuerySpecificationCONTROL_FLOW
+// Original: : nestedQuerySpecification
+: CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
+;
+
+// 11.3 <object expression primary>
+
+// Original: objectExpressionPrimary
+CONTROL_FLOWobjectExpressionPrimaryCONTROL_FLOW
+// Original: : VARIABLE valueExpressionPrimary
+: CONTROL_FLOWVARIABLECONTROL_FLOW CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
+// Original: | parenthesizedValueExpression
+| CONTROL_FLOWparenthesizedValueExpressionCONTROL_FLOW
+// Original: | nonParenthesizedValueExpressionPrimarySpecialCase
+| CONTROL_FLOWnonParenthesizedValueExpressionPrimarySpecialCaseCONTROL_FLOW
+;
+
+// 12.1 <linear catalog-modifying statement>
+
+// Original: linearCatalogModifyingStatement
+CONTROL_FLOWlinearCatalogModifyingStatementCONTROL_FLOW
+: simpleCatalogModifyingStatement+
+;
+
+// Original: simpleCatalogModifyingStatement
+CONTROL_FLOWsimpleCatalogModifyingStatementCONTROL_FLOW
+// Original: : primitiveCatalogModifyingStatement
+: CONTROL_FLOWprimitiveCatalogModifyingStatementCONTROL_FLOW
+// Original: | callCatalogModifyingProcedureStatement
+| CONTROL_FLOWcallCatalogModifyingProcedureStatementCONTROL_FLOW
+;
+
+// Original: primitiveCatalogModifyingStatement
+CONTROL_FLOWprimitiveCatalogModifyingStatementCONTROL_FLOW
+// Original: : createSchemaStatement
+: CONTROL_FLOWcreateSchemaStatementCONTROL_FLOW
+// Original: | dropSchemaStatement
+| CONTROL_FLOWdropSchemaStatementCONTROL_FLOW
+// Original: | createGraphStatement
+| CONTROL_FLOWcreateGraphStatementCONTROL_FLOW
+// Original: | dropGraphStatement
+| CONTROL_FLOWdropGraphStatementCONTROL_FLOW
+// Original: | createGraphTypeStatement
+| CONTROL_FLOWcreateGraphTypeStatementCONTROL_FLOW
+// Original: | dropGraphTypeStatement
+| CONTROL_FLOWdropGraphTypeStatementCONTROL_FLOW
+;
+
+// 12.2 <insert schema statement>
+
+// Original: createSchemaStatement
+CONTROL_FLOWcreateSchemaStatementCONTROL_FLOW
+// Original: : CREATE SCHEMA (IF NOT EXISTS)? catalogSchemaParentAndName
+// Original: : KEYWORD SCHEMA (IF NOT EXISTS)? catalogSchemaParentAndName
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWSCHEMACONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogSchemaParentAndNameCONTROL_FLOW
+;
+
+// 12.3 <drop schema statement>
+
+// Original: dropSchemaStatement
+CONTROL_FLOWdropSchemaStatementCONTROL_FLOW
+// Original: : DROP SCHEMA (IF EXISTS)? catalogSchemaParentAndName
+: CONTROL_FLOWDROPCONTROL_FLOW CONTROL_FLOWSCHEMACONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogSchemaParentAndNameCONTROL_FLOW
+;
+
+// 12.4 <insert graph statement>
+
+// Original: createGraphStatement
+CONTROL_FLOWcreateGraphStatementCONTROL_FLOW
+// Original: : CREATE (PROPERTY? GRAPH (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+// Original: : KEYWORD (PROPERTY? GRAPH (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+// Original: : KEYWORD (PROPERTY? GRAPH (IF NOT EXISTS)? | OR KEYWORD PROPERTY? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+// Original: : KEYWORD (KEYWORD? GRAPH (IF NOT EXISTS)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+// Original: : KEYWORD (KEYWORD? GRAPH (IF KEYWORD EXISTS)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+// Original: : KEYWORD (KEYWORD? GRAPH (IF KEYWORD KEYWORD)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+// Original: : KEYWORD (KEYWORD? GRAPH (CONTROL_FLOW KEYWORD KEYWORD)? | OR KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+: KEYWORD (KEYWORD? GRAPH (CONTROL_FLOW KEYWORD KEYWORD)? | KEYWORD KEYWORD KEYWORD? GRAPH) catalogGraphParentAndName (openGraphType | ofGraphType) graphSource?
+;
+
+// Original: openGraphType
+CONTROL_FLOWopenGraphTypeCONTROL_FLOW
+// Original: : typed? ANY (PROPERTY? GRAPH)?
+// Original: : typed? ANY (KEYWORD? GRAPH)?
+: typed? KEYWORD (KEYWORD? GRAPH)?
+;
+
+// Original: ofGraphType
+CONTROL_FLOWofGraphTypeCONTROL_FLOW
+// Original: : graphTypeLikeGraph
+: CONTROL_FLOWgraphTypeLikeGraphCONTROL_FLOW
+// Original: | typed? graphTypeReference
+| CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWgraphTypeReferenceCONTROL_FLOW
+// Original: | typed? (PROPERTY? GRAPH)? nestedGraphTypeSpecification
+| CONTROL_FLOWtypedCONTROL_FLOW? (CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW)? CONTROL_FLOWnestedGraphTypeSpecificationCONTROL_FLOW
+;
+
+// Original: graphTypeLikeGraph
+CONTROL_FLOWgraphTypeLikeGraphCONTROL_FLOW
+// Original: : LIKE graphExpression
+: CONTROL_FLOWLIKECONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
+;
+
+// Original: graphSource
+CONTROL_FLOWgraphSourceCONTROL_FLOW
+// Original: : AS COPY OF graphExpression
+// Original: : KEYWORD COPY OF graphExpression
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWCOPYCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
+;
+
+// 12.5 <drop graph statement>
+
+// Original: dropGraphStatement
+CONTROL_FLOWdropGraphStatementCONTROL_FLOW
+// Original: : DROP PROPERTY? GRAPH (IF EXISTS)? catalogGraphParentAndName
+: CONTROL_FLOWDROPCONTROL_FLOW CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogGraphParentAndNameCONTROL_FLOW
+;
+
+// 12.6 <graph type statement>
+
+// Original: createGraphTypeStatement
+CONTROL_FLOWcreateGraphTypeStatementCONTROL_FLOW
+// Original: : CREATE (PROPERTY? GRAPH TYPE (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH TYPE) catalogGraphTypeParentAndName graphTypeSource
+// Original: : KEYWORD (PROPERTY? GRAPH TYPE (IF NOT EXISTS)? | OR REPLACE PROPERTY? GRAPH TYPE) catalogGraphTypeParentAndName graphTypeSource
+: CONTROL_FLOWKEYWORDCONTROL_FLOW (CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? | CONTROL_FLOWORCONTROL_FLOW CONTROL_FLOWREPLACECONTROL_FLOW CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW) CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW CONTROL_FLOWgraphTypeSourceCONTROL_FLOW
+;
+
+// Original: graphTypeSource
+CONTROL_FLOWgraphTypeSourceCONTROL_FLOW
+// Original: : AS? copyOfGraphType
+// Original: : KEYWORD? copyOfGraphType
+: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWcopyOfGraphTypeCONTROL_FLOW
+// Original: | graphTypeLikeGraph
+| CONTROL_FLOWgraphTypeLikeGraphCONTROL_FLOW
+// Original: | AS? nestedGraphTypeSpecification
+// Original: | KEYWORD? nestedGraphTypeSpecification
+| CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWnestedGraphTypeSpecificationCONTROL_FLOW
+;
+
+// Original: copyOfGraphType
+CONTROL_FLOWcopyOfGraphTypeCONTROL_FLOW
+// Original: : COPY OF graphTypeReference
+: CONTROL_FLOWCOPYCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWgraphTypeReferenceCONTROL_FLOW
+;
+
+// 12.7 <drop graph statement>
+
+// Original: dropGraphTypeStatement
+CONTROL_FLOWdropGraphTypeStatementCONTROL_FLOW
+// Original: : DROP PROPERTY? GRAPH TYPE (IF EXISTS)? catalogGraphTypeParentAndName
+: CONTROL_FLOWDROPCONTROL_FLOW CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW (CONTROL_FLOWIFCONTROL_FLOW CONTROL_FLOWEXISTSCONTROL_FLOW)? CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW
+;
+
+// 12.8 <call catalog-modifying statement>
+
+// Original: callCatalogModifyingProcedureStatement
+CONTROL_FLOWcallCatalogModifyingProcedureStatementCONTROL_FLOW
+// Original: : callProcedureStatement
+: CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
+;
+
+// 13.1 <linear data-modifying statement>
+
+// Original: linearDataModifyingStatement
+CONTROL_FLOWlinearDataModifyingStatementCONTROL_FLOW
+// Original: : focusedLinearDataModifyingStatement
+: CONTROL_FLOWfocusedLinearDataModifyingStatementCONTROL_FLOW
+// Original: | ambientLinearDataModifyingStatement
+| CONTROL_FLOWambientLinearDataModifyingStatementCONTROL_FLOW
+;
+
+// Original: focusedLinearDataModifyingStatement
+CONTROL_FLOWfocusedLinearDataModifyingStatementCONTROL_FLOW
+// Original: : focusedLinearDataModifyingStatementBody
+: CONTROL_FLOWfocusedLinearDataModifyingStatementBodyCONTROL_FLOW
+// Original: | focusedNestedDataModifyingProcedureSpecification
+| CONTROL_FLOWfocusedNestedDataModifyingProcedureSpecificationCONTROL_FLOW
+;
+
+// Original: focusedLinearDataModifyingStatementBody
+CONTROL_FLOWfocusedLinearDataModifyingStatementBodyCONTROL_FLOW
+: useGraphClause simpleLinearDataAccessingStatement primitiveResultStatement?
+;
+
+// Original: focusedNestedDataModifyingProcedureSpecification
+CONTROL_FLOWfocusedNestedDataModifyingProcedureSpecificationCONTROL_FLOW
+// Original: : useGraphClause nestedDataModifyingProcedureSpecification
+: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWnestedDataModifyingProcedureSpecificationCONTROL_FLOW
+;
+
+// Original: ambientLinearDataModifyingStatement
+CONTROL_FLOWambientLinearDataModifyingStatementCONTROL_FLOW
+// Original: : ambientLinearDataModifyingStatementBody
+: CONTROL_FLOWambientLinearDataModifyingStatementBodyCONTROL_FLOW
+// Original: | nestedDataModifyingProcedureSpecification
+| CONTROL_FLOWnestedDataModifyingProcedureSpecificationCONTROL_FLOW
+;
+
+// Original: ambientLinearDataModifyingStatementBody
+CONTROL_FLOWambientLinearDataModifyingStatementBodyCONTROL_FLOW
+: simpleLinearDataAccessingStatement primitiveResultStatement?
+;
+
+// Original: simpleLinearDataAccessingStatement
+CONTROL_FLOWsimpleLinearDataAccessingStatementCONTROL_FLOW
+: simpleQueryStatement* simpleDataModifyingStatement+
+;
+
+// Original: // Subsumed by previous rule to enforce 13.1 SR 5
+// CONTROL_FLOWSubsumedCONTROL_FLOW CONTROL_FLOWbyCONTROL_FLOW CONTROL_FLOWpreviousCONTROL_FLOW CONTROL_FLOWruleCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWenforceCONTROL_FLOW CONTROL_FLOW13CONTROL_FLOW.CONTROL_FLOW1CONTROL_FLOW CONTROL_FLOWSRCONTROL_FLOW CONTROL_FLOW5CONTROL_FLOW
+// Original: //simpleDataAccessingStatement
+//CONTROL_FLOWsimpleDataAccessingStatementCONTROL_FLOW
+// Original: //    : simpleQueryStatement
+//    : CONTROL_FLOWsimpleQueryStatementCONTROL_FLOW
+// Original: //    | simpleDataModifyingStatement
+//    | CONTROL_FLOWsimpleDataModifyingStatementCONTROL_FLOW
+//    ;
+
+// Original: simpleDataModifyingStatement
+CONTROL_FLOWsimpleDataModifyingStatementCONTROL_FLOW
+// Original: : primitiveDataModifyingStatement
+: CONTROL_FLOWprimitiveDataModifyingStatementCONTROL_FLOW
+// Original: | callDataModifyingProcedureStatement
+| CONTROL_FLOWcallDataModifyingProcedureStatementCONTROL_FLOW
+;
+
+// Original: primitiveDataModifyingStatement
+CONTROL_FLOWprimitiveDataModifyingStatementCONTROL_FLOW
+// Original: : insertStatement
+: CONTROL_FLOWinsertStatementCONTROL_FLOW
+// Original: | setStatement
+| CONTROL_FLOWsetStatementCONTROL_FLOW
+// Original: | removeStatement
+| CONTROL_FLOWremoveStatementCONTROL_FLOW
+// Original: | deleteStatement
+| CONTROL_FLOWdeleteStatementCONTROL_FLOW
+;
+
+// 13.2 <insertStatement>
+
+// Original: insertStatement
+CONTROL_FLOWinsertStatementCONTROL_FLOW
+// Original: : INSERT insertGraphPattern
+: CONTROL_FLOWINSERTCONTROL_FLOW CONTROL_FLOWinsertGraphPatternCONTROL_FLOW
+;
+
+// 13.3 <set statement>
+
+// Original: setStatement
+CONTROL_FLOWsetStatementCONTROL_FLOW
+// Original: : SET setItemList
+// Original: : KEYWORD setItemList
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsetItemListCONTROL_FLOW
+;
+
+// Original: setItemList
+CONTROL_FLOWsetItemListCONTROL_FLOW
+// Original: : setItem (COMMA setItem)*
+: setItem (PUNCTUATION_OPERATOR setItem)*
+;
+
+// Original: setItem
+CONTROL_FLOWsetItemCONTROL_FLOW
+// Original: : setPropertyItem
+: CONTROL_FLOWsetPropertyItemCONTROL_FLOW
+// Original: | setAllPropertiesItem
+| CONTROL_FLOWsetAllPropertiesItemCONTROL_FLOW
+// Original: | setLabelItem
+| CONTROL_FLOWsetLabelItemCONTROL_FLOW
+;
+
+// Original: setPropertyItem
+CONTROL_FLOWsetPropertyItemCONTROL_FLOW
+// Original: : bindingVariableReference PERIOD propertyName EQUALS_OPERATOR valueExpression
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: setAllPropertiesItem
+CONTROL_FLOWsetAllPropertiesItemCONTROL_FLOW
+// Original: : bindingVariableReference EQUALS_OPERATOR LEFT_BRACE propertyKeyValuePairList? RIGHT_BRACE
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWpropertyKeyValuePairListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: setLabelItem
+CONTROL_FLOWsetLabelItemCONTROL_FLOW
+// Original: : bindingVariableReference isOrColon labelName
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelNameCONTROL_FLOW
+;
+
+// 13.4 <remove statement>
+
+// Original: removeStatement
+CONTROL_FLOWremoveStatementCONTROL_FLOW
+// Original: : REMOVE removeItemList
+: CONTROL_FLOWREMOVECONTROL_FLOW CONTROL_FLOWremoveItemListCONTROL_FLOW
+;
+
+// Original: removeItemList
+CONTROL_FLOWremoveItemListCONTROL_FLOW
+// Original: : removeItem (COMMA removeItem)*
+: removeItem (PUNCTUATION_OPERATOR removeItem)*
+;
+
+// Original: removeItem
+CONTROL_FLOWremoveItemCONTROL_FLOW
+// Original: : removePropertyItem
+: CONTROL_FLOWremovePropertyItemCONTROL_FLOW
+// Original: | removeLabelItem
+| CONTROL_FLOWremoveLabelItemCONTROL_FLOW
+;
+
+// Original: removePropertyItem
+CONTROL_FLOWremovePropertyItemCONTROL_FLOW
+// Original: : bindingVariableReference PERIOD propertyName
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW
+;
+
+// Original: removeLabelItem
+CONTROL_FLOWremoveLabelItemCONTROL_FLOW
+// Original: : bindingVariableReference isOrColon labelName
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelNameCONTROL_FLOW
+;
+
+// 13.5 <delete statement>
+
+// Original: deleteStatement
+CONTROL_FLOWdeleteStatementCONTROL_FLOW
+// Original: : (DETACH | NODETACH)? DELETE deleteItemList
+// Original: : (DETACH | NODETACH)? KEYWORD deleteItemList
+// Original: : (KEYWORD | NODETACH)? KEYWORD deleteItemList
+: (CONTROL_FLOWKEYWORDCONTROL_FLOW | CONTROL_FLOWNODETACHCONTROL_FLOW)? CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWdeleteItemListCONTROL_FLOW
+;
+
+// Original: deleteItemList
+CONTROL_FLOWdeleteItemListCONTROL_FLOW
+// Original: : deleteItem (COMMA deleteItem)*
+: deleteItem (PUNCTUATION_OPERATOR deleteItem)*
+;
+
+// Original: deleteItem
+CONTROL_FLOWdeleteItemCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 13.6 <call data-modifying procedure statement>
+
+// Original: callDataModifyingProcedureStatement
+CONTROL_FLOWcallDataModifyingProcedureStatementCONTROL_FLOW
+// Original: : callProcedureStatement
+: CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
+;
+
+// 14.1 <composite query statement>
+
+// Original: compositeQueryStatement
+CONTROL_FLOWcompositeQueryStatementCONTROL_FLOW
+// Original: : compositeQueryExpression
+: CONTROL_FLOWcompositeQueryExpressionCONTROL_FLOW
+;
+
+// 14.2 <composite query expression>
+
+// Original: compositeQueryExpression
+CONTROL_FLOWcompositeQueryExpressionCONTROL_FLOW
+// Original: : compositeQueryExpression queryConjunction compositeQueryPrimary
+: CONTROL_FLOWcompositeQueryExpressionCONTROL_FLOW CONTROL_FLOWqueryConjunctionCONTROL_FLOW CONTROL_FLOWcompositeQueryPrimaryCONTROL_FLOW
+// Original: | compositeQueryPrimary
+| CONTROL_FLOWcompositeQueryPrimaryCONTROL_FLOW
+;
+
+// Original: queryConjunction
+CONTROL_FLOWqueryConjunctionCONTROL_FLOW
+// Original: : setOperator
+: CONTROL_FLOWsetOperatorCONTROL_FLOW
+// Original: | OTHERWISE
+| CONTROL_FLOWOTHERWISECONTROL_FLOW
+;
+
+// Original: setOperator
+CONTROL_FLOWsetOperatorCONTROL_FLOW
+// Original: : UNION setQuantifier?
+: KEYWORD setQuantifier?
+// Original: | EXCEPT setQuantifier?
+| KEYWORD setQuantifier?
+// Original: | INTERSECT setQuantifier?
+| KEYWORD setQuantifier?
+;
+
+// Original: compositeQueryPrimary
+CONTROL_FLOWcompositeQueryPrimaryCONTROL_FLOW
+// Original: : linearQueryStatement
+: CONTROL_FLOWlinearQueryStatementCONTROL_FLOW
+;
+
+// 14.3 <linear query statement> and <simple query statement>
+
+// Original: linearQueryStatement
+CONTROL_FLOWlinearQueryStatementCONTROL_FLOW
+// Original: : focusedLinearQueryStatement
+: CONTROL_FLOWfocusedLinearQueryStatementCONTROL_FLOW
+// Original: | ambientLinearQueryStatement
+| CONTROL_FLOWambientLinearQueryStatementCONTROL_FLOW
+;
+
+// Original: focusedLinearQueryStatement
+CONTROL_FLOWfocusedLinearQueryStatementCONTROL_FLOW
+// Original: : focusedLinearQueryStatementPart* focusedLinearQueryAndPrimitiveResultStatementPart
+: CONTROL_FLOWfocusedLinearQueryStatementPartCONTROL_FLOW* CONTROL_FLOWfocusedLinearQueryAndPrimitiveResultStatementPartCONTROL_FLOW
+// Original: | focusedPrimitiveResultStatement
+| CONTROL_FLOWfocusedPrimitiveResultStatementCONTROL_FLOW
+// Original: | focusedNestedQuerySpecification
+| CONTROL_FLOWfocusedNestedQuerySpecificationCONTROL_FLOW
+// Original: | selectStatement
+| CONTROL_FLOWselectStatementCONTROL_FLOW
+;
+
+// Original: focusedLinearQueryStatementPart
+CONTROL_FLOWfocusedLinearQueryStatementPartCONTROL_FLOW
+// Original: : useGraphClause simpleLinearQueryStatement
+: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW
+;
+
+// Original: focusedLinearQueryAndPrimitiveResultStatementPart
+CONTROL_FLOWfocusedLinearQueryAndPrimitiveResultStatementPartCONTROL_FLOW
+// Original: : useGraphClause simpleLinearQueryStatement primitiveResultStatement
+: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
+;
+
+// Original: focusedPrimitiveResultStatement
+CONTROL_FLOWfocusedPrimitiveResultStatementCONTROL_FLOW
+// Original: : useGraphClause primitiveResultStatement
+: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
+;
+
+// Original: focusedNestedQuerySpecification
+CONTROL_FLOWfocusedNestedQuerySpecificationCONTROL_FLOW
+// Original: : useGraphClause nestedQuerySpecification
+: CONTROL_FLOWuseGraphClauseCONTROL_FLOW CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
+;
+
+// Original: ambientLinearQueryStatement
+CONTROL_FLOWambientLinearQueryStatementCONTROL_FLOW
+// Original: : simpleLinearQueryStatement? primitiveResultStatement
+: CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW? CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
+// Original: | nestedQuerySpecification
+| CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
+;
+
+// Original: simpleLinearQueryStatement
+CONTROL_FLOWsimpleLinearQueryStatementCONTROL_FLOW
+: simpleQueryStatement+
+;
+
+// Original: simpleQueryStatement
+CONTROL_FLOWsimpleQueryStatementCONTROL_FLOW
+// Original: : primitiveQueryStatement
+: CONTROL_FLOWprimitiveQueryStatementCONTROL_FLOW
+// Original: | callQueryStatement
+| CONTROL_FLOWcallQueryStatementCONTROL_FLOW
+;
+
+// Original: primitiveQueryStatement
+CONTROL_FLOWprimitiveQueryStatementCONTROL_FLOW
+// Original: : matchStatement
+: CONTROL_FLOWmatchStatementCONTROL_FLOW
+// Original: | letStatement
+| CONTROL_FLOWletStatementCONTROL_FLOW
+// Original: | forStatement
+| CONTROL_FLOWforStatementCONTROL_FLOW
+// Original: | filterStatement
+| CONTROL_FLOWfilterStatementCONTROL_FLOW
+// Original: | orderByAndPageStatement
+| CONTROL_FLOWorderByAndPageStatementCONTROL_FLOW
+;
+
+// 14.4 <match statement>
+
+// Original: matchStatement
+CONTROL_FLOWmatchStatementCONTROL_FLOW
+// Original: : simpleMatchStatement
+: CONTROL_FLOWsimpleMatchStatementCONTROL_FLOW
+// Original: | optionalMatchStatement
+| CONTROL_FLOWoptionalMatchStatementCONTROL_FLOW
+;
+
+// Original: simpleMatchStatement
+CONTROL_FLOWsimpleMatchStatementCONTROL_FLOW
+// Original: : MATCH graphPatternBindingTable
+: CONTROL_FLOWMATCHCONTROL_FLOW CONTROL_FLOWgraphPatternBindingTableCONTROL_FLOW
+;
+
+// Original: optionalMatchStatement
+CONTROL_FLOWoptionalMatchStatementCONTROL_FLOW
+// Original: : OPTIONAL optionalOperand
+: CONTROL_FLOWOPTIONALCONTROL_FLOW CONTROL_FLOWoptionalOperandCONTROL_FLOW
+;
+
+// Original: optionalOperand
+CONTROL_FLOWoptionalOperandCONTROL_FLOW
+// Original: : simpleMatchStatement
+: CONTROL_FLOWsimpleMatchStatementCONTROL_FLOW
+// Original: | LEFT_BRACE matchStatementBlock RIGHT_BRACE
+| CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWmatchStatementBlockCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+// Original: | LEFT_PAREN matchStatementBlock RIGHT_PAREN
+// Original: | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR
+| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWmatchStatementBlockCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: matchStatementBlock
+CONTROL_FLOWmatchStatementBlockCONTROL_FLOW
+: matchStatement+
+;
+
+// 14.5 <call query statement>
+
+// Original: callQueryStatement
+CONTROL_FLOWcallQueryStatementCONTROL_FLOW
+// Original: : callProcedureStatement
+: CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
+;
+
+// 14.6 <filter statement>
+
+// Original: filterStatement
+CONTROL_FLOWfilterStatementCONTROL_FLOW
+// Original: : FILTER (whereClause | searchCondition)
+: KEYWORD (whereClause | searchCondition)
+;
+
+// 14.7 <let statement>
+
+// Original: letStatement
+CONTROL_FLOWletStatementCONTROL_FLOW
+// Original: : LET letVariableDefinitionList
+: CONTROL_FLOWLETCONTROL_FLOW CONTROL_FLOWletVariableDefinitionListCONTROL_FLOW
+;
+
+// Original: letVariableDefinitionList
+CONTROL_FLOWletVariableDefinitionListCONTROL_FLOW
+// Original: : letVariableDefinition (COMMA letVariableDefinition)*
+: letVariableDefinition (PUNCTUATION_OPERATOR letVariableDefinition)*
+;
+
+// Original: letVariableDefinition
+CONTROL_FLOWletVariableDefinitionCONTROL_FLOW
+// Original: : valueVariableDefinition
+: CONTROL_FLOWvalueVariableDefinitionCONTROL_FLOW
+// Original: | bindingVariable EQUALS_OPERATOR valueExpression
+| CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 14.8 <for statement>
+
+// Original: forStatement
+CONTROL_FLOWforStatementCONTROL_FLOW
+// Original: : FOR forItem forOrdinalityOrOffset?
+: CONTROL_FLOW forItem forOrdinalityOrOffset?
+;
+
+// Original: forItem
+CONTROL_FLOWforItemCONTROL_FLOW
+// Original: : forItemAlias forItemSource
+: CONTROL_FLOWforItemAliasCONTROL_FLOW CONTROL_FLOWforItemSourceCONTROL_FLOW
+;
+
+// Original: forItemAlias
+CONTROL_FLOWforItemAliasCONTROL_FLOW
+// Original: : bindingVariable IN
+: CONTROL_FLOWbindingVariableCONTROL_FLOW CONTROL_FLOWINCONTROL_FLOW
+;
+
+// Original: forItemSource
+CONTROL_FLOWforItemSourceCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: forOrdinalityOrOffset
+CONTROL_FLOWforOrdinalityOrOffsetCONTROL_FLOW
+// Original: : WITH (ORDINALITY | OFFSET) bindingVariable
+// Original: : WITH (KEYWORD | OFFSET) bindingVariable
+: CONTROL_FLOWWITHCONTROL_FLOW (CONTROL_FLOWKEYWORDCONTROL_FLOW | CONTROL_FLOWOFFSETCONTROL_FLOW) CONTROL_FLOWbindingVariableCONTROL_FLOW
+;
+
+// 14.9 <order by and page statement>
+
+// Original: orderByAndPageStatement
+CONTROL_FLOWorderByAndPageStatementCONTROL_FLOW
+: orderByClause offsetClause? limitClause?
+| offsetClause limitClause?
+// Original: | limitClause
+| CONTROL_FLOWlimitClauseCONTROL_FLOW
+;
+
+// 14.10 <primitive result statement>
+
+// Original: primitiveResultStatement
+CONTROL_FLOWprimitiveResultStatementCONTROL_FLOW
+: returnStatement orderByAndPageStatement?
+// Original: | FINISH
+| CONTROL_FLOWFINISHCONTROL_FLOW
+;
+
+// 14.11 <return statement>
+
+// Original: returnStatement
+CONTROL_FLOWreturnStatementCONTROL_FLOW
+// Original: : RETURN returnStatementBody
+: CONTROL_FLOWRETURNCONTROL_FLOW CONTROL_FLOWreturnStatementBodyCONTROL_FLOW
+;
+
+// Original: returnStatementBody
+CONTROL_FLOWreturnStatementBodyCONTROL_FLOW
+// Original: : setQuantifier? (ASTERISK | returnItemList) groupByClause?
+: setQuantifier? (PUNCTUATION_OPERATOR | returnItemList) groupByClause?
+// Original: | NO BINDINGS
+// Original: | NO KEYWORD
+| CONTROL_FLOWNOCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW
+;
+
+// Original: returnItemList
+CONTROL_FLOWreturnItemListCONTROL_FLOW
+// Original: : returnItem (COMMA returnItem)*
+: returnItem (PUNCTUATION_OPERATOR returnItem)*
+;
+
+// Original: returnItem
+CONTROL_FLOWreturnItemCONTROL_FLOW
+: aggregatingValueExpression returnItemAlias?
+;
+
+// Original: returnItemAlias
+CONTROL_FLOWreturnItemAliasCONTROL_FLOW
+// Original: : AS identifier
+// Original: : KEYWORD identifier
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// 14.12 <select statement>
+
+// Original: selectStatement
+CONTROL_FLOWselectStatementCONTROL_FLOW
+// Original: : SELECT setQuantifier? (ASTERISK | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
+// Original: : SELECT setQuantifier? (PUNCTUATION_OPERATOR | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
+: KEYWORD setQuantifier? (PUNCTUATION_OPERATOR | selectItemList) (selectStatementBody whereClause? groupByClause? havingClause? orderByClause? offsetClause? limitClause?)?
+;
+
+// Original: selectItemList
+CONTROL_FLOWselectItemListCONTROL_FLOW
+// Original: : selectItem (COMMA selectItem)*
+: selectItem (PUNCTUATION_OPERATOR selectItem)*
+;
+
+// Original: selectItem
+CONTROL_FLOWselectItemCONTROL_FLOW
+: aggregatingValueExpression selectItemAlias?
+;
+
+// Original: selectItemAlias
+CONTROL_FLOWselectItemAliasCONTROL_FLOW
+// Original: : AS identifier
+// Original: : KEYWORD identifier
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: havingClause
+CONTROL_FLOWhavingClauseCONTROL_FLOW
+// Original: : HAVING searchCondition
+: CONTROL_FLOWHAVINGCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
+;
+
+// Original: selectStatementBody
+CONTROL_FLOWselectStatementBodyCONTROL_FLOW
+// Original: : FROM (selectGraphMatchList | selectQuerySpecification)
+: KEYWORD (selectGraphMatchList | selectQuerySpecification)
+;
+
+// Original: selectGraphMatchList
+CONTROL_FLOWselectGraphMatchListCONTROL_FLOW
+// Original: : selectGraphMatch (COMMA selectGraphMatch)*
+: selectGraphMatch (PUNCTUATION_OPERATOR selectGraphMatch)*
+;
+
+// Original: selectGraphMatch
+CONTROL_FLOWselectGraphMatchCONTROL_FLOW
+// Original: : graphExpression matchStatement
+: CONTROL_FLOWgraphExpressionCONTROL_FLOW CONTROL_FLOWmatchStatementCONTROL_FLOW
+;
+
+// Original: selectQuerySpecification
+CONTROL_FLOWselectQuerySpecificationCONTROL_FLOW
+// Original: : nestedQuerySpecification
+: CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
+// Original: | graphExpression nestedQuerySpecification
+| CONTROL_FLOWgraphExpressionCONTROL_FLOW CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
+;
+
+// 15.1 <call procedure statement> and <procedure call>
+
+// Original: callProcedureStatement
+CONTROL_FLOWcallProcedureStatementCONTROL_FLOW
+// Original: : OPTIONAL? CALL procedureCall
+// Original: : OPTIONAL? KEYWORD procedureCall
+: CONTROL_FLOWOPTIONALCONTROL_FLOW? CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWprocedureCallCONTROL_FLOW
+;
+
+// Original: procedureCall
+CONTROL_FLOWprocedureCallCONTROL_FLOW
+// Original: : inlineProcedureCall
+: CONTROL_FLOWinlineProcedureCallCONTROL_FLOW
+// Original: | namedProcedureCall
+| CONTROL_FLOWnamedProcedureCallCONTROL_FLOW
+;
+
+// 15.2 <inline procedure call>
+
+// Original: inlineProcedureCall
+CONTROL_FLOWinlineProcedureCallCONTROL_FLOW
+// Original: : variableScopeClause? nestedProcedureSpecification
+: CONTROL_FLOWvariableScopeClauseCONTROL_FLOW? CONTROL_FLOWnestedProcedureSpecificationCONTROL_FLOW
+;
+
+// Original: variableScopeClause
+CONTROL_FLOWvariableScopeClauseCONTROL_FLOW
+// Original: : LEFT_PAREN bindingVariableReferenceList? RIGHT_PAREN
+// Original: : LEFT_PAREN bindingVariableReferenceList? PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWbindingVariableReferenceListCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: bindingVariableReferenceList
+CONTROL_FLOWbindingVariableReferenceListCONTROL_FLOW
+// Original: : bindingVariableReference (COMMA bindingVariableReference)*
+: bindingVariableReference (PUNCTUATION_OPERATOR bindingVariableReference)*
+;
+
+// 15.3 <named procedure call>
+
+// Original: namedProcedureCall
+CONTROL_FLOWnamedProcedureCallCONTROL_FLOW
+// Original: : procedureReference LEFT_PAREN procedureArgumentList? RIGHT_PAREN yieldClause?
+// Original: : procedureReference LEFT_PAREN procedureArgumentList? PUNCTUATION_OPERATOR yieldClause?
+: procedureReference PUNCTUATION_OPERATOR procedureArgumentList? PUNCTUATION_OPERATOR yieldClause?
+;
+
+// Original: procedureArgumentList
+CONTROL_FLOWprocedureArgumentListCONTROL_FLOW
+// Original: : procedureArgument (COMMA procedureArgument)*
+: procedureArgument (PUNCTUATION_OPERATOR procedureArgument)*
+;
+
+// Original: procedureArgument
+CONTROL_FLOWprocedureArgumentCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 16.1 <at schema clasue>
+
+// Original: atSchemaClause
+CONTROL_FLOWatSchemaClauseCONTROL_FLOW
+// Original: : AT schemaReference
+// Original: : KEYWORD schemaReference
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWschemaReferenceCONTROL_FLOW
+;
+
+// 16.2 <use graph clause>
+
+// Original: useGraphClause
+CONTROL_FLOWuseGraphClauseCONTROL_FLOW
+// Original: : USE graphExpression
+: CONTROL_FLOWUSECONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW
+;
+
+// 16.3 <graph pattern binding table>
+
+// Original: graphPatternBindingTable
+CONTROL_FLOWgraphPatternBindingTableCONTROL_FLOW
+: graphPattern graphPatternYieldClause?
+;
+
+// Original: graphPatternYieldClause
+CONTROL_FLOWgraphPatternYieldClauseCONTROL_FLOW
+// Original: : YIELD graphPatternYieldItemList
+// Original: : KEYWORD graphPatternYieldItemList
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWgraphPatternYieldItemListCONTROL_FLOW
+;
+
+// Original: graphPatternYieldItemList
+CONTROL_FLOWgraphPatternYieldItemListCONTROL_FLOW
+// Original: : graphPatternYieldItem (COMMA graphPatternYieldItem)*
+: graphPatternYieldItem (PUNCTUATION_OPERATOR graphPatternYieldItem)*
+// Original: | NO BINDINGS
+// Original: | NO KEYWORD
+| CONTROL_FLOWNOCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW
+;
+
+// Original: // <elemement variable reference> and <path variable reference> are identical productions, both consisting
+// <CONTROL_FLOWelemementCONTROL_FLOW CONTROL_FLOWvariableCONTROL_FLOW CONTROL_FLOWreferenceCONTROL_FLOW> CONTROL_FLOWandCONTROL_FLOW <CONTROL_FLOWpathCONTROL_FLOW CONTROL_FLOWvariableCONTROL_FLOW CONTROL_FLOWreferenceCONTROL_FLOW> CONTROL_FLOWareCONTROL_FLOW CONTROL_FLOWidenticalCONTROL_FLOW CONTROL_FLOWproductionsCONTROL_FLOW, CONTROL_FLOWbothCONTROL_FLOW CONTROL_FLOWconsistingCONTROL_FLOW
+// Original: // of a single non-terminal <binding variable reference>. Thus <graph pattern yield item> is ambiguous
+// CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWsingleCONTROL_FLOW CONTROL_FLOWnonCONTROL_FLOW-CONTROL_FLOWterminalCONTROL_FLOW <CONTROL_FLOWbindingCONTROL_FLOW CONTROL_FLOWvariableCONTROL_FLOW CONTROL_FLOWreferenceCONTROL_FLOW>. CONTROL_FLOWThusCONTROL_FLOW <CONTROL_FLOWgraphCONTROL_FLOW CONTROL_FLOWpatternCONTROL_FLOW CONTROL_FLOWyieldCONTROL_FLOW CONTROL_FLOWitemCONTROL_FLOW> CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWambiguousCONTROL_FLOW
+// Original: // from a parsing standpoint. So here we simply use bindingVariableReference. Post parsing code must
+// CONTROL_FLOWfromCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWparsingCONTROL_FLOW CONTROL_FLOWstandpointCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWhereCONTROL_FLOW CONTROL_FLOWweCONTROL_FLOW CONTROL_FLOWsimplyCONTROL_FLOW CONTROL_FLOWuseCONTROL_FLOW CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW. CONTROL_FLOWPostCONTROL_FLOW CONTROL_FLOWparsingCONTROL_FLOW CONTROL_FLOWcodeCONTROL_FLOW CONTROL_FLOWmustCONTROL_FLOW
+// apply the semantics assocaited with each type of <binding variable reference>.
+// Original: graphPatternYieldItem
+CONTROL_FLOWgraphPatternYieldItemCONTROL_FLOW
+// Original: : bindingVariableReference
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
+// Original: //    : elementVariableReference
+//    : CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
+// Original: //    | pathVariableReference
+//    | CONTROL_FLOWpathVariableReferenceCONTROL_FLOW
+;
+
+// 16.4 <graph pattern>
+
+// Original: graphPattern
+CONTROL_FLOWgraphPatternCONTROL_FLOW
+: matchMode? pathPatternList keepClause? graphPatternWhereClause?
+;
+
+// Original: matchMode
+CONTROL_FLOWmatchModeCONTROL_FLOW
+// Original: : repeatableElementsMatchMode
+: CONTROL_FLOWrepeatableElementsMatchModeCONTROL_FLOW
+// Original: | differentEdgesMatchMode
+| CONTROL_FLOWdifferentEdgesMatchModeCONTROL_FLOW
+;
+
+// Original: repeatableElementsMatchMode
+CONTROL_FLOWrepeatableElementsMatchModeCONTROL_FLOW
+// Original: : REPEATABLE elementBindingsOrElements
+: CONTROL_FLOWREPEATABLECONTROL_FLOW CONTROL_FLOWelementBindingsOrElementsCONTROL_FLOW
+;
+
+// Original: differentEdgesMatchMode
+CONTROL_FLOWdifferentEdgesMatchModeCONTROL_FLOW
+// Original: : DIFFERENT edgeBindingsOrEdges
+: CONTROL_FLOWDIFFERENTCONTROL_FLOW CONTROL_FLOWedgeBindingsOrEdgesCONTROL_FLOW
+;
+
+// Original: elementBindingsOrElements
+CONTROL_FLOWelementBindingsOrElementsCONTROL_FLOW
+// Original: : ELEMENT BINDINGS?
+// Original: : ELEMENT KEYWORD?
+: DATA_TYPE KEYWORD?
+// Original: | ELEMENTS
+| CONTROL_FLOWELEMENTSCONTROL_FLOW
+;
+
+// Original: edgeBindingsOrEdges
+CONTROL_FLOWedgeBindingsOrEdgesCONTROL_FLOW
+// Original: : edgeSynonym BINDINGS?
+: edgeSynonym KEYWORD?
+// Original: | edgesSynonym
+| CONTROL_FLOWedgesSynonymCONTROL_FLOW
+;
+
+// Original: pathPatternList
+CONTROL_FLOWpathPatternListCONTROL_FLOW
+// Original: : pathPattern (COMMA pathPattern)*
+: pathPattern (PUNCTUATION_OPERATOR pathPattern)*
+;
+
+// Original: pathPattern
+CONTROL_FLOWpathPatternCONTROL_FLOW
+// Original: : pathVariableDeclaration? pathPatternPrefix? pathPatternExpression
+: CONTROL_FLOWpathVariableDeclarationCONTROL_FLOW? CONTROL_FLOWpathPatternPrefixCONTROL_FLOW? CONTROL_FLOWpathPatternExpressionCONTROL_FLOW
+;
+
+// Original: pathVariableDeclaration
+CONTROL_FLOWpathVariableDeclarationCONTROL_FLOW
+// Original: : pathVariable EQUALS_OPERATOR
+: CONTROL_FLOWpathVariableCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW
+;
+
+// Original: keepClause
+CONTROL_FLOWkeepClauseCONTROL_FLOW
+// Original: : KEEP pathPatternPrefix
+: CONTROL_FLOWKEEPCONTROL_FLOW CONTROL_FLOWpathPatternPrefixCONTROL_FLOW
+;
+
+// Original: graphPatternWhereClause
+CONTROL_FLOWgraphPatternWhereClauseCONTROL_FLOW
+// Original: : WHERE searchCondition
+// Original: : KEYWORD searchCondition
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
+;
+
+// 16.5 <insert graph pattern>
+
+// Original: insertGraphPattern
+CONTROL_FLOWinsertGraphPatternCONTROL_FLOW
+// Original: : insertPathPatternList
+: CONTROL_FLOWinsertPathPatternListCONTROL_FLOW
+;
+
+// Original: insertPathPatternList
+CONTROL_FLOWinsertPathPatternListCONTROL_FLOW
+// Original: : insertPathPattern (COMMA insertPathPattern)*
+: insertPathPattern (PUNCTUATION_OPERATOR insertPathPattern)*
+;
+
+// Original: insertPathPattern
+CONTROL_FLOWinsertPathPatternCONTROL_FLOW
+: insertNodePattern (insertEdgePattern insertNodePattern)*
+;
+
+// Original: insertNodePattern
+CONTROL_FLOWinsertNodePatternCONTROL_FLOW
+// Original: : LEFT_PAREN insertElementPatternFiller? RIGHT_PAREN
+// Original: : LEFT_PAREN insertElementPatternFiller? PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: insertEdgePattern
+CONTROL_FLOWinsertEdgePatternCONTROL_FLOW
+// Original: : insertEdgePointingLeft
+: CONTROL_FLOWinsertEdgePointingLeftCONTROL_FLOW
+// Original: | insertEdgePointingRight
+| CONTROL_FLOWinsertEdgePointingRightCONTROL_FLOW
+// Original: | insertEdgeUndirected
+| CONTROL_FLOWinsertEdgeUndirectedCONTROL_FLOW
+;
+
+// Original: insertEdgePointingLeft
+CONTROL_FLOWinsertEdgePointingLeftCONTROL_FLOW
+// Original: : LEFT_ARROW_BRACKET insertElementPatternFiller? RIGHT_BRACKET_MINUS
+: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
+;
+
+// Original: insertEdgePointingRight
+CONTROL_FLOWinsertEdgePointingRightCONTROL_FLOW
+// Original: : MINUS_LEFT_BRACKET insertElementPatternFiller? BRACKET_RIGHT_ARROW
+// Original: : MINUS_LEFT_BRACKET insertElementPatternFiller? PUNCTUATION_OPERATOR
+: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: insertEdgeUndirected
+CONTROL_FLOWinsertEdgeUndirectedCONTROL_FLOW
+// Original: : TILDE_LEFT_BRACKET insertElementPatternFiller? RIGHT_BRACKET_TILDE
+// Original: : TILDE_LEFT_BRACKET insertElementPatternFiller? PUNCTUATION_OPERATOR
+// Original: : PUNCTUATION_OPERATOR insertElementPatternFiller? PUNCTUATION_OPERATOR
+: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: insertElementPatternFiller
+CONTROL_FLOWinsertElementPatternFillerCONTROL_FLOW
+: elementVariableDeclaration labelAndPropertySetSpecification?
+// Original: | elementVariableDeclaration? labelAndPropertySetSpecification
+| CONTROL_FLOWelementVariableDeclarationCONTROL_FLOW? CONTROL_FLOWlabelAndPropertySetSpecificationCONTROL_FLOW
+;
+
+// Original: labelAndPropertySetSpecification
+CONTROL_FLOWlabelAndPropertySetSpecificationCONTROL_FLOW
+: isOrColon labelSetSpecification elementPropertySpecification?
+// Original: | (isOrColon labelSetSpecification)? elementPropertySpecification
+| (CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW)? CONTROL_FLOWelementPropertySpecificationCONTROL_FLOW
+;
+
+// 16.6 <path pattern prefix>
+
+// Original: pathPatternPrefix
+CONTROL_FLOWpathPatternPrefixCONTROL_FLOW
+// Original: : pathModePrefix
+: CONTROL_FLOWpathModePrefixCONTROL_FLOW
+// Original: | pathSearchPrefix
+| CONTROL_FLOWpathSearchPrefixCONTROL_FLOW
+;
+
+// Original: pathModePrefix
+CONTROL_FLOWpathModePrefixCONTROL_FLOW
+: pathMode pathOrPaths?
+;
+
+// Original: pathMode
+CONTROL_FLOWpathModeCONTROL_FLOW
+// Original: : WALK
+: CONTROL_FLOWWALKCONTROL_FLOW
+// Original: | TRAIL
+| CONTROL_FLOWTRAILCONTROL_FLOW
+// Original: | SIMPLE
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | ACYCLIC
+| CONTROL_FLOWACYCLICCONTROL_FLOW
+;
+
+// Original: pathSearchPrefix
+CONTROL_FLOWpathSearchPrefixCONTROL_FLOW
+// Original: : allPathSearch
+: CONTROL_FLOWallPathSearchCONTROL_FLOW
+// Original: | anyPathSearch
+| CONTROL_FLOWanyPathSearchCONTROL_FLOW
+// Original: | shortestPathSearch
+| CONTROL_FLOWshortestPathSearchCONTROL_FLOW
+;
+
+// Original: allPathSearch
+CONTROL_FLOWallPathSearchCONTROL_FLOW
+// Original: : ALL pathMode? pathOrPaths?
+: KEYWORD pathMode? pathOrPaths?
+;
+
+// Original: pathOrPaths
+CONTROL_FLOWpathOrPathsCONTROL_FLOW
+// Original: : PATH
+// Original: : KEYWORD
+: CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | PATHS
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+;
+
+// Original: anyPathSearch
+CONTROL_FLOWanyPathSearchCONTROL_FLOW
+// Original: : ANY numberOfPaths? pathMode? pathOrPaths?
+: KEYWORD numberOfPaths? pathMode? pathOrPaths?
+;
+
+// Original: numberOfPaths
+CONTROL_FLOWnumberOfPathsCONTROL_FLOW
+// Original: : nonNegativeIntegerSpecification
+: CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
+;
+
+// Original: shortestPathSearch
+CONTROL_FLOWshortestPathSearchCONTROL_FLOW
+// Original: : allShortestPathSearch
+: CONTROL_FLOWallShortestPathSearchCONTROL_FLOW
+// Original: | anyShortestPathSearch
+| CONTROL_FLOWanyShortestPathSearchCONTROL_FLOW
+// Original: | countedShortestPathSearch
+| CONTROL_FLOWcountedShortestPathSearchCONTROL_FLOW
+// Original: | countedShortestGroupSearch
+| CONTROL_FLOWcountedShortestGroupSearchCONTROL_FLOW
+;
+
+// Original: allShortestPathSearch
+CONTROL_FLOWallShortestPathSearchCONTROL_FLOW
+// Original: : ALL SHORTEST pathMode? pathOrPaths?
+// Original: : KEYWORD SHORTEST pathMode? pathOrPaths?
+: KEYWORD KEYWORD pathMode? pathOrPaths?
+;
+
+// Original: anyShortestPathSearch
+CONTROL_FLOWanyShortestPathSearchCONTROL_FLOW
+// Original: : ANY SHORTEST pathMode? pathOrPaths?
+// Original: : ANY KEYWORD pathMode? pathOrPaths?
+: KEYWORD KEYWORD pathMode? pathOrPaths?
+;
+
+// Original: countedShortestPathSearch
+CONTROL_FLOWcountedShortestPathSearchCONTROL_FLOW
+// Original: : SHORTEST numberOfPaths pathMode? pathOrPaths?
+: KEYWORD numberOfPaths pathMode? pathOrPaths?
+;
+
+// Original: countedShortestGroupSearch
+CONTROL_FLOWcountedShortestGroupSearchCONTROL_FLOW
+// Original: : SHORTEST numberOfGroups? pathMode? pathOrPaths? (GROUP | GROUPS)
+// Original: : SHORTEST numberOfGroups? pathMode? pathOrPaths? (GROUP | KEYWORD)
+// Original: : SHORTEST numberOfGroups? pathMode? pathOrPaths? (KEYWORD | KEYWORD)
+: KEYWORD numberOfGroups? pathMode? pathOrPaths? (KEYWORD | KEYWORD)
+;
+
+// Original: numberOfGroups
+CONTROL_FLOWnumberOfGroupsCONTROL_FLOW
+// Original: : nonNegativeIntegerSpecification
+: CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
+;
+
+// 16.7 <path pattern expression>
+
+// Original: pathPatternExpression
+CONTROL_FLOWpathPatternExpressionCONTROL_FLOW
+// Original: : pathTerm                                              #ppePathTerm
+: CONTROL_FLOWpathTermCONTROL_FLOW                                              #CONTROL_FLOWppePathTermCONTROL_FLOW
+// Original: | pathTerm (MULTISET_ALTERNATION_OPERATOR pathTerm)+    #ppeMultisetAlternation
+| CONTROL_FLOWpathTermCONTROL_FLOW (CONTROL_FLOWMULTISET_ALTERNATION_OPERATORCONTROL_FLOW CONTROL_FLOWpathTermCONTROL_FLOW)+    #CONTROL_FLOWppeMultisetAlternationCONTROL_FLOW
+// Original: | pathTerm (VERTICAL_BAR pathTerm)+                     #ppePatternUnion
+| CONTROL_FLOWpathTermCONTROL_FLOW (CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWpathTermCONTROL_FLOW)+                     #CONTROL_FLOWppePatternUnionCONTROL_FLOW
+;
+
+// Original: pathTerm
+CONTROL_FLOWpathTermCONTROL_FLOW
+: pathFactor+
+;
+
+// Original: pathFactor
+CONTROL_FLOWpathFactorCONTROL_FLOW
+// Original: : pathPrimary                           #pfPathPrimary
+: CONTROL_FLOWpathPrimaryCONTROL_FLOW                           #CONTROL_FLOWpfPathPrimaryCONTROL_FLOW
+// Original: | pathPrimary graphPatternQuantifier    #pfQuantifiedPathPrimary
+| CONTROL_FLOWpathPrimaryCONTROL_FLOW CONTROL_FLOWgraphPatternQuantifierCONTROL_FLOW    #CONTROL_FLOWpfQuantifiedPathPrimaryCONTROL_FLOW
+// Original: | pathPrimary QUESTION_MARK             #pfQuestionedPathPrimary
+| CONTROL_FLOWpathPrimaryCONTROL_FLOW CONTROL_FLOWQUESTION_MARKCONTROL_FLOW             #CONTROL_FLOWpfQuestionedPathPrimaryCONTROL_FLOW
+;
+
+// Original: pathPrimary
+CONTROL_FLOWpathPrimaryCONTROL_FLOW
+// Original: : elementPattern                        #ppElementPattern
+: CONTROL_FLOWelementPatternCONTROL_FLOW                        #CONTROL_FLOWppElementPatternCONTROL_FLOW
+// Original: | parenthesizedPathPatternExpression    #ppParenthesizedPathPatternExpression
+| CONTROL_FLOWparenthesizedPathPatternExpressionCONTROL_FLOW    #CONTROL_FLOWppParenthesizedPathPatternExpressionCONTROL_FLOW
+// Original: | simplifiedPathPatternExpression       #ppSimplifiedPathPatternExpression
+| CONTROL_FLOWsimplifiedPathPatternExpressionCONTROL_FLOW       #CONTROL_FLOWppSimplifiedPathPatternExpressionCONTROL_FLOW
+;
+
+// Original: elementPattern
+CONTROL_FLOWelementPatternCONTROL_FLOW
+// Original: : nodePattern
+: CONTROL_FLOWnodePatternCONTROL_FLOW
+// Original: | edgePattern
+| CONTROL_FLOWedgePatternCONTROL_FLOW
+;
+
+// Original: nodePattern
+CONTROL_FLOWnodePatternCONTROL_FLOW
+// Original: : LEFT_PAREN elementPatternFiller RIGHT_PAREN
+// Original: : LEFT_PAREN elementPatternFiller PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: elementPatternFiller
+CONTROL_FLOWelementPatternFillerCONTROL_FLOW
+: elementVariableDeclaration? isLabelExpression? elementPatternPredicate?
+;
+
+// Original: elementVariableDeclaration
+CONTROL_FLOWelementVariableDeclarationCONTROL_FLOW
+// Original: : TEMP? elementVariable
+: CONTROL_FLOWTEMPCONTROL_FLOW? CONTROL_FLOWelementVariableCONTROL_FLOW
+;
+
+// Original: isLabelExpression
+CONTROL_FLOWisLabelExpressionCONTROL_FLOW
+// Original: : isOrColon labelExpression
+: CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW
+;
+
+// Original: isOrColon
+CONTROL_FLOWisOrColonCONTROL_FLOW
+// Original: : IS
+: CONTROL_FLOWISCONTROL_FLOW
+// Original: | COLON
+| CONTROL_FLOWCOLONCONTROL_FLOW
+;
+
+// Original: elementPatternPredicate
+CONTROL_FLOWelementPatternPredicateCONTROL_FLOW
+// Original: : elementPatternWhereClause
+: CONTROL_FLOWelementPatternWhereClauseCONTROL_FLOW
+// Original: | elementPropertySpecification
+| CONTROL_FLOWelementPropertySpecificationCONTROL_FLOW
+;
+
+// Original: elementPatternWhereClause
+CONTROL_FLOWelementPatternWhereClauseCONTROL_FLOW
+// Original: : WHERE searchCondition
+// Original: : KEYWORD searchCondition
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
+;
+
+// Original: elementPropertySpecification
+CONTROL_FLOWelementPropertySpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE propertyKeyValuePairList RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWpropertyKeyValuePairListCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: propertyKeyValuePairList
+CONTROL_FLOWpropertyKeyValuePairListCONTROL_FLOW
+// Original: : propertyKeyValuePair (COMMA propertyKeyValuePair)*
+: propertyKeyValuePair (PUNCTUATION_OPERATOR propertyKeyValuePair)*
+;
+
+// Original: propertyKeyValuePair
+CONTROL_FLOWpropertyKeyValuePairCONTROL_FLOW
+// Original: : propertyName COLON valueExpression
+: CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWCOLONCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: edgePattern
+CONTROL_FLOWedgePatternCONTROL_FLOW
+// Original: : fullEdgePattern
+: CONTROL_FLOWfullEdgePatternCONTROL_FLOW
+// Original: | abbreviatedEdgePattern
+| CONTROL_FLOWabbreviatedEdgePatternCONTROL_FLOW
+;
+
+// Original: fullEdgePattern
+CONTROL_FLOWfullEdgePatternCONTROL_FLOW
+// Original: : fullEdgePointingLeft
+: CONTROL_FLOWfullEdgePointingLeftCONTROL_FLOW
+// Original: | fullEdgeUndirected
+| CONTROL_FLOWfullEdgeUndirectedCONTROL_FLOW
+// Original: | fullEdgePointingRight
+| CONTROL_FLOWfullEdgePointingRightCONTROL_FLOW
+// Original: | fullEdgeLeftOrUndirected
+| CONTROL_FLOWfullEdgeLeftOrUndirectedCONTROL_FLOW
+// Original: | fullEdgeUndirectedOrRight
+| CONTROL_FLOWfullEdgeUndirectedOrRightCONTROL_FLOW
+// Original: | fullEdgeLeftOrRight
+| CONTROL_FLOWfullEdgeLeftOrRightCONTROL_FLOW
+// Original: | fullEdgeAnyDirection
+| CONTROL_FLOWfullEdgeAnyDirectionCONTROL_FLOW
+;
+
+// Original: fullEdgePointingLeft
+CONTROL_FLOWfullEdgePointingLeftCONTROL_FLOW
+// Original: : LEFT_ARROW_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
+: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
+;
+
+// Original: fullEdgeUndirected
+CONTROL_FLOWfullEdgeUndirectedCONTROL_FLOW
+// Original: : TILDE_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
+// Original: : TILDE_LEFT_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
+// Original: : PUNCTUATION_OPERATOR elementPatternFiller PUNCTUATION_OPERATOR
+: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: fullEdgePointingRight
+CONTROL_FLOWfullEdgePointingRightCONTROL_FLOW
+// Original: : MINUS_LEFT_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
+// Original: : MINUS_LEFT_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
+: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: fullEdgeLeftOrUndirected
+CONTROL_FLOWfullEdgeLeftOrUndirectedCONTROL_FLOW
+// Original: : LEFT_ARROW_TILDE_BRACKET elementPatternFiller RIGHT_BRACKET_TILDE
+// Original: : LEFT_ARROW_TILDE_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_ARROW_TILDE_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: fullEdgeUndirectedOrRight
+CONTROL_FLOWfullEdgeUndirectedOrRightCONTROL_FLOW
+// Original: : TILDE_LEFT_BRACKET elementPatternFiller BRACKET_TILDE_RIGHT_ARROW
+// Original: : PUNCTUATION_OPERATOR elementPatternFiller BRACKET_TILDE_RIGHT_ARROW
+: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWBRACKET_TILDE_RIGHT_ARROWCONTROL_FLOW
+;
+
+// Original: fullEdgeLeftOrRight
+CONTROL_FLOWfullEdgeLeftOrRightCONTROL_FLOW
+// Original: : LEFT_ARROW_BRACKET elementPatternFiller BRACKET_RIGHT_ARROW
+// Original: : LEFT_ARROW_BRACKET elementPatternFiller PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: fullEdgeAnyDirection
+CONTROL_FLOWfullEdgeAnyDirectionCONTROL_FLOW
+// Original: : MINUS_LEFT_BRACKET elementPatternFiller RIGHT_BRACKET_MINUS
+: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWelementPatternFillerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
+;
+
+// Original: abbreviatedEdgePattern
+CONTROL_FLOWabbreviatedEdgePatternCONTROL_FLOW
+// Original: : LEFT_ARROW
+: CONTROL_FLOWLEFT_ARROWCONTROL_FLOW
+// Original: | TILDE
+| CONTROL_FLOWTILDECONTROL_FLOW
+// Original: | RIGHT_ARROW
+// Original: | PUNCTUATION_OPERATOR
+| CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+// Original: | LEFT_ARROW_TILDE
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | TILDE_RIGHT_ARROW
+| CONTROL_FLOWTILDE_RIGHT_ARROWCONTROL_FLOW
+// Original: | LEFT_MINUS_RIGHT
+| CONTROL_FLOWLEFT_MINUS_RIGHTCONTROL_FLOW
+// Original: | MINUS_SIGN
+| CONTROL_FLOWMINUS_SIGNCONTROL_FLOW
+;
+
+// Original: parenthesizedPathPatternExpression
+CONTROL_FLOWparenthesizedPathPatternExpressionCONTROL_FLOW
+// Original: : LEFT_PAREN subpathVariableDeclaration? pathModePrefix? pathPatternExpression parenthesizedPathPatternWhereClause? RIGHT_PAREN
+// Original: : LEFT_PAREN subpathVariableDeclaration? pathModePrefix? pathPatternExpression parenthesizedPathPatternWhereClause? PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsubpathVariableDeclarationCONTROL_FLOW? CONTROL_FLOWpathModePrefixCONTROL_FLOW? CONTROL_FLOWpathPatternExpressionCONTROL_FLOW CONTROL_FLOWparenthesizedPathPatternWhereClauseCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: subpathVariableDeclaration
+CONTROL_FLOWsubpathVariableDeclarationCONTROL_FLOW
+// Original: : subpathVariable EQUALS_OPERATOR
+: CONTROL_FLOWsubpathVariableCONTROL_FLOW CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW
+;
+
+// Original: parenthesizedPathPatternWhereClause
+CONTROL_FLOWparenthesizedPathPatternWhereClauseCONTROL_FLOW
+// Original: : WHERE searchCondition
+// Original: : KEYWORD searchCondition
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
+;
+
+// 16.8 <label expression>
+
+// Original: labelExpression
+CONTROL_FLOWlabelExpressionCONTROL_FLOW
+// Original: : EXCLAMATION_MARK labelExpression                  #labelExpressionNegation
+: CONTROL_FLOWEXCLAMATION_MARKCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW                  #CONTROL_FLOWlabelExpressionNegationCONTROL_FLOW
+// Original: | labelExpression AMPERSAND labelExpression         #labelExpressionConjunction
+| CONTROL_FLOWlabelExpressionCONTROL_FLOW CONTROL_FLOWAMPERSANDCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW         #CONTROL_FLOWlabelExpressionConjunctionCONTROL_FLOW
+// Original: | labelExpression VERTICAL_BAR labelExpression      #labelExpressionDisjunction
+| CONTROL_FLOWlabelExpressionCONTROL_FLOW CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW      #CONTROL_FLOWlabelExpressionDisjunctionCONTROL_FLOW
+// Original: | labelName                                         #labelExpressionName
+| CONTROL_FLOWlabelNameCONTROL_FLOW                                         #CONTROL_FLOWlabelExpressionNameCONTROL_FLOW
+// Original: | PERCENT                                           #labelExpressionWildcard
+| CONTROL_FLOWPERCENTCONTROL_FLOW                                           #CONTROL_FLOWlabelExpressionWildcardCONTROL_FLOW
+// Original: | LEFT_PAREN labelExpression RIGHT_PAREN            #labelExpressionParenthesized
+// Original: | LEFT_PAREN labelExpression PUNCTUATION_OPERATOR            #labelExpressionParenthesized
+| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW            #CONTROL_FLOWlabelExpressionParenthesizedCONTROL_FLOW
+;
+
+// 16.9 <path variable reference>
+
+// Original: pathVariableReference
+CONTROL_FLOWpathVariableReferenceCONTROL_FLOW
+// Original: : bindingVariableReference
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
+;
+
+// 16.10 <element variable reference>
+
+// Original: elementVariableReference
+CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
+// Original: : bindingVariableReference
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
+;
+
+// 16.11 <graph pattern quantifier>
+
+// Original: graphPatternQuantifier
+CONTROL_FLOWgraphPatternQuantifierCONTROL_FLOW
+// Original: : ASTERISK
+: CONTROL_FLOWASTERISKCONTROL_FLOW
+// Original: | PLUS_SIGN
+| CONTROL_FLOWPLUS_SIGNCONTROL_FLOW
+// Original: | fixedQuantifier
+| CONTROL_FLOWfixedQuantifierCONTROL_FLOW
+// Original: | generalQuantifier
+| CONTROL_FLOWgeneralQuantifierCONTROL_FLOW
+;
+
+// Original: fixedQuantifier
+CONTROL_FLOWfixedQuantifierCONTROL_FLOW
+// Original: : LEFT_BRACE unsignedInteger RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWunsignedIntegerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: generalQuantifier
+CONTROL_FLOWgeneralQuantifierCONTROL_FLOW
+// Original: : LEFT_BRACE lowerBound? COMMA upperBound? RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWlowerBoundCONTROL_FLOW? CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWupperBoundCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: lowerBound
+CONTROL_FLOWlowerBoundCONTROL_FLOW
+// Original: : unsignedInteger
+: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+;
+
+// Original: upperBound
+CONTROL_FLOWupperBoundCONTROL_FLOW
+// Original: : unsignedInteger
+: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+;
+
+// 16.12 <simplified path pattern expression>
+
+// Original: simplifiedPathPatternExpression
+CONTROL_FLOWsimplifiedPathPatternExpressionCONTROL_FLOW
+// Original: : simplifiedDefaultingLeft
+: CONTROL_FLOWsimplifiedDefaultingLeftCONTROL_FLOW
+// Original: | simplifiedDefaultingUndirected
+| CONTROL_FLOWsimplifiedDefaultingUndirectedCONTROL_FLOW
+// Original: | simplifiedDefaultingRight
+| CONTROL_FLOWsimplifiedDefaultingRightCONTROL_FLOW
+// Original: | simplifiedDefaultingLeftOrUndirected
+| CONTROL_FLOWsimplifiedDefaultingLeftOrUndirectedCONTROL_FLOW
+// Original: | simplifiedDefaultingUndirectedOrRight
+| CONTROL_FLOWsimplifiedDefaultingUndirectedOrRightCONTROL_FLOW
+// Original: | simplifiedDefaultingLeftOrRight
+| CONTROL_FLOWsimplifiedDefaultingLeftOrRightCONTROL_FLOW
+// Original: | simplifiedDefaultingAnyDirection
+| CONTROL_FLOWsimplifiedDefaultingAnyDirectionCONTROL_FLOW
+;
+
+// Original: simplifiedDefaultingLeft
+CONTROL_FLOWsimplifiedDefaultingLeftCONTROL_FLOW
+// Original: : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS
+: CONTROL_FLOWLEFT_MINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUSCONTROL_FLOW
+;
+
+// Original: simplifiedDefaultingUndirected
+CONTROL_FLOWsimplifiedDefaultingUndirectedCONTROL_FLOW
+// Original: : TILDE_SLASH simplifiedContents SLASH_TILDE
+: CONTROL_FLOWTILDE_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_TILDECONTROL_FLOW
+;
+
+// Original: simplifiedDefaultingRight
+CONTROL_FLOWsimplifiedDefaultingRightCONTROL_FLOW
+// Original: : MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
+: CONTROL_FLOWMINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUS_RIGHTCONTROL_FLOW
+;
+
+// Original: simplifiedDefaultingLeftOrUndirected
+CONTROL_FLOWsimplifiedDefaultingLeftOrUndirectedCONTROL_FLOW
+// Original: : LEFT_TILDE_SLASH simplifiedContents SLASH_TILDE
+: CONTROL_FLOWLEFT_TILDE_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_TILDECONTROL_FLOW
+;
+
+// Original: simplifiedDefaultingUndirectedOrRight
+CONTROL_FLOWsimplifiedDefaultingUndirectedOrRightCONTROL_FLOW
+// Original: : TILDE_SLASH simplifiedContents SLASH_TILDE_RIGHT
+: CONTROL_FLOWTILDE_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_TILDE_RIGHTCONTROL_FLOW
+;
+
+// Original: simplifiedDefaultingLeftOrRight
+CONTROL_FLOWsimplifiedDefaultingLeftOrRightCONTROL_FLOW
+// Original: : LEFT_MINUS_SLASH simplifiedContents SLASH_MINUS_RIGHT
+: CONTROL_FLOWLEFT_MINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUS_RIGHTCONTROL_FLOW
+;
+
+// Original: simplifiedDefaultingAnyDirection
+CONTROL_FLOWsimplifiedDefaultingAnyDirectionCONTROL_FLOW
+// Original: : MINUS_SLASH simplifiedContents SLASH_MINUS
+: CONTROL_FLOWMINUS_SLASHCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWSLASH_MINUSCONTROL_FLOW
+;
+
+// Original: simplifiedContents
+CONTROL_FLOWsimplifiedContentsCONTROL_FLOW
+// Original: : simplifiedTerm
+: CONTROL_FLOWsimplifiedTermCONTROL_FLOW
+// Original: | simplifiedPathUnion
+| CONTROL_FLOWsimplifiedPathUnionCONTROL_FLOW
+// Original: | simplifiedMultisetAlternation
+| CONTROL_FLOWsimplifiedMultisetAlternationCONTROL_FLOW
+;
+
+// Original: simplifiedPathUnion
+CONTROL_FLOWsimplifiedPathUnionCONTROL_FLOW
+// Original: : simplifiedTerm VERTICAL_BAR simplifiedTerm (VERTICAL_BAR simplifiedTerm)*
+: simplifiedTerm PUNCTUATION_OPERATOR simplifiedTerm (PUNCTUATION_OPERATOR simplifiedTerm)*
+;
+
+// Original: simplifiedMultisetAlternation
+CONTROL_FLOWsimplifiedMultisetAlternationCONTROL_FLOW
+: simplifiedTerm MULTISET_ALTERNATION_OPERATOR simplifiedTerm (MULTISET_ALTERNATION_OPERATOR simplifiedTerm)*
+;
+
+// Original: simplifiedTerm
+CONTROL_FLOWsimplifiedTermCONTROL_FLOW
+// Original: : simplifiedFactorLow                        #simplifiedFactorLowLabel
+: CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW                        #CONTROL_FLOWsimplifiedFactorLowLabelCONTROL_FLOW
+// Original: | simplifiedTerm simplifiedFactorLow      #simplifiedConcatenationLabel
+| CONTROL_FLOWsimplifiedTermCONTROL_FLOW CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW      #CONTROL_FLOWsimplifiedConcatenationLabelCONTROL_FLOW
+;
+
+// Original: simplifiedFactorLow
+CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW
+// Original: : simplifiedFactorHigh                                     #simplifiedFactorHighLabel
+: CONTROL_FLOWsimplifiedFactorHighCONTROL_FLOW                                     #CONTROL_FLOWsimplifiedFactorHighLabelCONTROL_FLOW
+// Original: | simplifiedFactorLow AMPERSAND simplifiedFactorHigh #simplifiedConjunctionLabel
+| CONTROL_FLOWsimplifiedFactorLowCONTROL_FLOW CONTROL_FLOWAMPERSANDCONTROL_FLOW CONTROL_FLOWsimplifiedFactorHighCONTROL_FLOW #CONTROL_FLOWsimplifiedConjunctionLabelCONTROL_FLOW
+;
+
+// Original: simplifiedFactorHigh
+CONTROL_FLOWsimplifiedFactorHighCONTROL_FLOW
+// Original: : simplifiedTertiary
+: CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW
+// Original: | simplifiedQuantified
+| CONTROL_FLOWsimplifiedQuantifiedCONTROL_FLOW
+// Original: | simplifiedQuestioned
+| CONTROL_FLOWsimplifiedQuestionedCONTROL_FLOW
+;
+
+// Original: simplifiedQuantified
+CONTROL_FLOWsimplifiedQuantifiedCONTROL_FLOW
+// Original: : simplifiedTertiary graphPatternQuantifier
+: CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW CONTROL_FLOWgraphPatternQuantifierCONTROL_FLOW
+;
+
+// Original: simplifiedQuestioned
+CONTROL_FLOWsimplifiedQuestionedCONTROL_FLOW
+// Original: : simplifiedTertiary QUESTION_MARK
+: CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW CONTROL_FLOWQUESTION_MARKCONTROL_FLOW
+;
+
+// Original: simplifiedTertiary
+CONTROL_FLOWsimplifiedTertiaryCONTROL_FLOW
+// Original: : simplifiedDirectionOverride
+: CONTROL_FLOWsimplifiedDirectionOverrideCONTROL_FLOW
+// Original: | simplifiedSecondary
+| CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
+;
+
+// Original: simplifiedDirectionOverride
+CONTROL_FLOWsimplifiedDirectionOverrideCONTROL_FLOW
+// Original: : simplifiedOverrideLeft
+: CONTROL_FLOWsimplifiedOverrideLeftCONTROL_FLOW
+// Original: | simplifiedOverrideUndirected
+| CONTROL_FLOWsimplifiedOverrideUndirectedCONTROL_FLOW
+// Original: | simplifiedOverrideRight
+| CONTROL_FLOWsimplifiedOverrideRightCONTROL_FLOW
+// Original: | simplifiedOverrideLeftOrUndirected
+| CONTROL_FLOWsimplifiedOverrideLeftOrUndirectedCONTROL_FLOW
+// Original: | simplifiedOverrideUndirectedOrRight
+| CONTROL_FLOWsimplifiedOverrideUndirectedOrRightCONTROL_FLOW
+// Original: | simplifiedOverrideLeftOrRight
+| CONTROL_FLOWsimplifiedOverrideLeftOrRightCONTROL_FLOW
+// Original: | simplifiedOverrideAnyDirection
+| CONTROL_FLOWsimplifiedOverrideAnyDirectionCONTROL_FLOW
+;
+
+// Original: simplifiedOverrideLeft
+CONTROL_FLOWsimplifiedOverrideLeftCONTROL_FLOW
+// Original: : LEFT_ANGLE_BRACKET simplifiedSecondary
+// Original: : PUNCTUATION_OPERATOR simplifiedSecondary
+: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
+;
+
+// Original: simplifiedOverrideUndirected
+CONTROL_FLOWsimplifiedOverrideUndirectedCONTROL_FLOW
+// Original: : TILDE simplifiedSecondary
+: CONTROL_FLOWTILDECONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
+;
+
+// Original: simplifiedOverrideRight
+CONTROL_FLOWsimplifiedOverrideRightCONTROL_FLOW
+// Original: : simplifiedSecondary RIGHT_ANGLE_BRACKET
+: CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
+;
+
+// Original: simplifiedOverrideLeftOrUndirected
+CONTROL_FLOWsimplifiedOverrideLeftOrUndirectedCONTROL_FLOW
+// Original: : LEFT_ARROW_TILDE simplifiedSecondary
+// Original: : KEYWORD simplifiedSecondary
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
+;
+
+// Original: simplifiedOverrideUndirectedOrRight
+CONTROL_FLOWsimplifiedOverrideUndirectedOrRightCONTROL_FLOW
+// Original: : TILDE simplifiedSecondary RIGHT_ANGLE_BRACKET
+: CONTROL_FLOWTILDECONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
+;
+
+// Original: simplifiedOverrideLeftOrRight
+CONTROL_FLOWsimplifiedOverrideLeftOrRightCONTROL_FLOW
+// Original: : LEFT_ANGLE_BRACKET simplifiedSecondary RIGHT_ANGLE_BRACKET
+// Original: : PUNCTUATION_OPERATOR simplifiedSecondary RIGHT_ANGLE_BRACKET
+: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
+;
+
+// Original: simplifiedOverrideAnyDirection
+CONTROL_FLOWsimplifiedOverrideAnyDirectionCONTROL_FLOW
+// Original: : MINUS_SIGN simplifiedSecondary
+: CONTROL_FLOWMINUS_SIGNCONTROL_FLOW CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
+;
+
+// Original: simplifiedSecondary
+CONTROL_FLOWsimplifiedSecondaryCONTROL_FLOW
+// Original: : simplifiedPrimary
+: CONTROL_FLOWsimplifiedPrimaryCONTROL_FLOW
+// Original: | simplifiedNegation
+| CONTROL_FLOWsimplifiedNegationCONTROL_FLOW
+;
+
+// Original: simplifiedNegation
+CONTROL_FLOWsimplifiedNegationCONTROL_FLOW
+// Original: : EXCLAMATION_MARK simplifiedPrimary
+: CONTROL_FLOWEXCLAMATION_MARKCONTROL_FLOW CONTROL_FLOWsimplifiedPrimaryCONTROL_FLOW
+;
+
+// Original: simplifiedPrimary
+CONTROL_FLOWsimplifiedPrimaryCONTROL_FLOW
+// Original: : labelName
+: CONTROL_FLOWlabelNameCONTROL_FLOW
+// Original: | LEFT_PAREN simplifiedContents RIGHT_PAREN
+// Original: | LEFT_PAREN simplifiedContents PUNCTUATION_OPERATOR
+| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsimplifiedContentsCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 16.13 <where clause>
+
+// Original: whereClause
+CONTROL_FLOWwhereClauseCONTROL_FLOW
+// Original: : WHERE searchCondition
+// Original: : KEYWORD searchCondition
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW
+;
+
+// 16.14 <yield clause>
+
+// Original: yieldClause
+CONTROL_FLOWyieldClauseCONTROL_FLOW
+// Original: : YIELD yieldItemList
+// Original: : KEYWORD yieldItemList
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWyieldItemListCONTROL_FLOW
+;
+
+// Original: yieldItemList
+CONTROL_FLOWyieldItemListCONTROL_FLOW
+// Original: : yieldItem (COMMA yieldItem)*
+: yieldItem (PUNCTUATION_OPERATOR yieldItem)*
+;
+
+// Original: yieldItem
+CONTROL_FLOWyieldItemCONTROL_FLOW
+: (yieldItemName yieldItemAlias?)
+;
+
+// Original: yieldItemName
+CONTROL_FLOWyieldItemNameCONTROL_FLOW
+// Original: : fieldName
+: CONTROL_FLOWfieldNameCONTROL_FLOW
+;
+
+// Original: yieldItemAlias
+CONTROL_FLOWyieldItemAliasCONTROL_FLOW
+// Original: : AS bindingVariable
+// Original: : KEYWORD bindingVariable
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWbindingVariableCONTROL_FLOW
+;
+
+// 16.15 <group by clasue>
+
+// Original: groupByClause
+CONTROL_FLOWgroupByClauseCONTROL_FLOW
+// Original: : GROUP BY groupingElementList
+// Original: : KEYWORD BY groupingElementList
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWBYCONTROL_FLOW CONTROL_FLOWgroupingElementListCONTROL_FLOW
+;
+
+// Original: groupingElementList
+CONTROL_FLOWgroupingElementListCONTROL_FLOW
+// Original: : groupingElement (COMMA groupingElement)*
+: groupingElement (PUNCTUATION_OPERATOR groupingElement)*
+// Original: | emptyGroupingSet
+| CONTROL_FLOWemptyGroupingSetCONTROL_FLOW
+;
+
+// Original: groupingElement
+CONTROL_FLOWgroupingElementCONTROL_FLOW
+// Original: : bindingVariableReference
+: CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
+;
+
+// Original: emptyGroupingSet
+CONTROL_FLOWemptyGroupingSetCONTROL_FLOW
+// Original: : LEFT_PAREN RIGHT_PAREN
+// Original: : LEFT_PAREN PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 16.16 <order by clasue>
+
+// Original: orderByClause
+CONTROL_FLOWorderByClauseCONTROL_FLOW
+// Original: : ORDER BY sortSpecificationList
+: CONTROL_FLOWORDERCONTROL_FLOW CONTROL_FLOWBYCONTROL_FLOW CONTROL_FLOWsortSpecificationListCONTROL_FLOW
+;
+
+// 16.17 <sort specification list>
+
+// Original: sortSpecificationList
+CONTROL_FLOWsortSpecificationListCONTROL_FLOW
+// Original: : sortSpecification (COMMA sortSpecification)*
+: sortSpecification (PUNCTUATION_OPERATOR sortSpecification)*
+;
+
+// Original: sortSpecification
+CONTROL_FLOWsortSpecificationCONTROL_FLOW
+: sortKey orderingSpecification? nullOrdering?
+;
+
+// Original: sortKey
+CONTROL_FLOWsortKeyCONTROL_FLOW
+// Original: : aggregatingValueExpression
+: CONTROL_FLOWaggregatingValueExpressionCONTROL_FLOW
+;
+
+// Original: orderingSpecification
+CONTROL_FLOWorderingSpecificationCONTROL_FLOW
+// Original: : ASC
+// Original: : KEYWORD
+: CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | ASCENDING
+| CONTROL_FLOWASCENDINGCONTROL_FLOW
+// Original: | DESC
+| CONTROL_FLOWDESCCONTROL_FLOW
+// Original: | DESCENDING
+| CONTROL_FLOWDESCENDINGCONTROL_FLOW
+;
+
+// Original: nullOrdering
+CONTROL_FLOWnullOrderingCONTROL_FLOW
+// Original: : NULLS FIRST
+: CONTROL_FLOWNULLSCONTROL_FLOW CONTROL_FLOWFIRSTCONTROL_FLOW
+// Original: | NULLS LAST
+| CONTROL_FLOWNULLSCONTROL_FLOW CONTROL_FLOWLASTCONTROL_FLOW
+;
+
+// 16.18 <limit clause>
+
+// Original: limitClause
+CONTROL_FLOWlimitClauseCONTROL_FLOW
+// Original: : LIMIT nonNegativeIntegerSpecification
+: CONTROL_FLOWLIMITCONTROL_FLOW CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
+;
+
+// 16.19 <offset clause>
+
+// Original: offsetClause
+CONTROL_FLOWoffsetClauseCONTROL_FLOW
+// Original: : offsetSynonym nonNegativeIntegerSpecification
+: CONTROL_FLOWoffsetSynonymCONTROL_FLOW CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
+;
+
+// Original: offsetSynonym
+CONTROL_FLOWoffsetSynonymCONTROL_FLOW
+// Original: : OFFSET
+: CONTROL_FLOWOFFSETCONTROL_FLOW
+// Original: | SKIP_RESERVED_WORD
+| CONTROL_FLOWSKIP_RESERVED_WORDCONTROL_FLOW
+;
+
+// 17.1 <schema reference> and <catalog schema parent name>
+
+// Original: schemaReference
+CONTROL_FLOWschemaReferenceCONTROL_FLOW
+// Original: : absoluteCatalogSchemaReference
+: CONTROL_FLOWabsoluteCatalogSchemaReferenceCONTROL_FLOW
+// Original: | relativeCatalogSchemaReference
+| CONTROL_FLOWrelativeCatalogSchemaReferenceCONTROL_FLOW
+// Original: | referenceParameterSpecification
+| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
+;
+
+// Original: absoluteCatalogSchemaReference
+CONTROL_FLOWabsoluteCatalogSchemaReferenceCONTROL_FLOW
+// Original: : SOLIDUS
+: CONTROL_FLOWSOLIDUSCONTROL_FLOW
+// Original: | absoluteDirectoryPath schemaName
+| CONTROL_FLOWabsoluteDirectoryPathCONTROL_FLOW CONTROL_FLOWschemaNameCONTROL_FLOW
+;
+
+// Original: catalogSchemaParentAndName
+CONTROL_FLOWcatalogSchemaParentAndNameCONTROL_FLOW
+// Original: : absoluteDirectoryPath schemaName
+: CONTROL_FLOWabsoluteDirectoryPathCONTROL_FLOW CONTROL_FLOWschemaNameCONTROL_FLOW
+;
+
+// Original: relativeCatalogSchemaReference
+CONTROL_FLOWrelativeCatalogSchemaReferenceCONTROL_FLOW
+// Original: : predefinedSchemaReference
+: CONTROL_FLOWpredefinedSchemaReferenceCONTROL_FLOW
+// Original: | relativeDirectoryPath schemaName
+| CONTROL_FLOWrelativeDirectoryPathCONTROL_FLOW CONTROL_FLOWschemaNameCONTROL_FLOW
+;
+
+// Original: predefinedSchemaReference
+CONTROL_FLOWpredefinedSchemaReferenceCONTROL_FLOW
+// Original: : HOME_SCHEMA
+: CONTROL_FLOWHOME_SCHEMACONTROL_FLOW
+// Original: | CURRENT_SCHEMA
+| CONTROL_FLOWCURRENT_SCHEMACONTROL_FLOW
+// Original: | PERIOD
+| CONTROL_FLOWPERIODCONTROL_FLOW
+;
+
+// Original: absoluteDirectoryPath
+CONTROL_FLOWabsoluteDirectoryPathCONTROL_FLOW
+// Original: : SOLIDUS simpleDirectoryPath?
+: PUNCTUATION_OPERATOR simpleDirectoryPath?
+;
+
+// Original: relativeDirectoryPath
+CONTROL_FLOWrelativeDirectoryPathCONTROL_FLOW
+// Original: : DOUBLE_PERIOD (SOLIDUS DOUBLE_PERIOD)* SOLIDUS simpleDirectoryPath?
+// Original: : PUNCTUATION_OPERATOR (SOLIDUS PUNCTUATION_OPERATOR)* SOLIDUS simpleDirectoryPath?
+: PUNCTUATION_OPERATOR (PUNCTUATION_OPERATOR PUNCTUATION_OPERATOR)* PUNCTUATION_OPERATOR simpleDirectoryPath?
+;
+
+// Original: simpleDirectoryPath
+CONTROL_FLOWsimpleDirectoryPathCONTROL_FLOW
+// Original: : (directoryName SOLIDUS)+
+: (directoryName PUNCTUATION_OPERATOR)+
+;
+
+// 17.2 <graph reference> and <catalog graph parent and name>
+
+// Original: graphReference
+CONTROL_FLOWgraphReferenceCONTROL_FLOW
+// Original: : catalogObjectParentReference graphName
+: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW CONTROL_FLOWgraphNameCONTROL_FLOW
+// Original: | delimitedGraphName
+| CONTROL_FLOWdelimitedGraphNameCONTROL_FLOW
+// Original: | homeGraph
+| CONTROL_FLOWhomeGraphCONTROL_FLOW
+// Original: | referenceParameterSpecification
+| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
+;
+
+// Original: catalogGraphParentAndName
+CONTROL_FLOWcatalogGraphParentAndNameCONTROL_FLOW
+// Original: : catalogObjectParentReference? graphName
+: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW? CONTROL_FLOWgraphNameCONTROL_FLOW
+;
+
+// Original: homeGraph
+CONTROL_FLOWhomeGraphCONTROL_FLOW
+// Original: : HOME_PROPERTY_GRAPH
+: CONTROL_FLOWHOME_PROPERTY_GRAPHCONTROL_FLOW
+// Original: | HOME_GRAPH
+| CONTROL_FLOWHOME_GRAPHCONTROL_FLOW
+;
+
+// 17.3 <graph type reference> and <catalog graph type parent and name>
+
+// Original: graphTypeReference
+CONTROL_FLOWgraphTypeReferenceCONTROL_FLOW
+// Original: : catalogGraphTypeParentAndName
+: CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW
+// Original: | referenceParameterSpecification
+| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
+;
+
+// Original: catalogGraphTypeParentAndName
+CONTROL_FLOWcatalogGraphTypeParentAndNameCONTROL_FLOW
+// Original: : catalogObjectParentReference? graphTypeName
+: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW? CONTROL_FLOWgraphTypeNameCONTROL_FLOW
+;
+
+// 17.4 <binding table reference> and <catalog binding table parent name>
+
+// Original: bindingTableReference
+CONTROL_FLOWbindingTableReferenceCONTROL_FLOW
+// Original: : catalogObjectParentReference bindingTableName
+: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW CONTROL_FLOWbindingTableNameCONTROL_FLOW
+// Original: | delimitedBindingTableName
+| CONTROL_FLOWdelimitedBindingTableNameCONTROL_FLOW
+// Original: | referenceParameterSpecification
+| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
+;
+
+// 17.5 <procedure reference> and <catalog procedure parent and name>
+
+// Original: procedureReference
+CONTROL_FLOWprocedureReferenceCONTROL_FLOW
+// Original: : catalogProcedureParentAndName
+: CONTROL_FLOWcatalogProcedureParentAndNameCONTROL_FLOW
+// Original: | referenceParameterSpecification
+| CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
+;
+
+// Original: catalogProcedureParentAndName
+CONTROL_FLOWcatalogProcedureParentAndNameCONTROL_FLOW
+// Original: : catalogObjectParentReference? procedureName
+: CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW? CONTROL_FLOWprocedureNameCONTROL_FLOW
+;
+
+// 17.6 <catalog object parent reference>
+
+// Original: catalogObjectParentReference
+CONTROL_FLOWcatalogObjectParentReferenceCONTROL_FLOW
+// Original: : schemaReference SOLIDUS? (objectName PERIOD)*
+// Original: : schemaReference PUNCTUATION_OPERATOR? (objectName PERIOD)*
+: schemaReference PUNCTUATION_OPERATOR? (objectName PUNCTUATION_OPERATOR)*
+// Original: |  (objectName PERIOD)+
+|  (objectName PUNCTUATION_OPERATOR)+
+;
+
+// 17.7 <reference parameter specification>
+
+// Original: referenceParameterSpecification
+CONTROL_FLOWreferenceParameterSpecificationCONTROL_FLOW
+// Original: : SUBSTITUTED_PARAMETER_REFERENCE
+: CONTROL_FLOWSUBSTITUTED_PARAMETER_REFERENCECONTROL_FLOW
+;
+
+// 18.1 <nested graph type specification>
+
+// Original: nestedGraphTypeSpecification
+CONTROL_FLOWnestedGraphTypeSpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE graphTypeSpecificationBody RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWgraphTypeSpecificationBodyCONTROL_FLOW CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: graphTypeSpecificationBody
+CONTROL_FLOWgraphTypeSpecificationBodyCONTROL_FLOW
+// Original: : elementTypeList
+: CONTROL_FLOWelementTypeListCONTROL_FLOW
+;
+
+// Original: elementTypeList
+CONTROL_FLOWelementTypeListCONTROL_FLOW
+// Original: : elementTypeSpecification (COMMA elementTypeSpecification)*
+: elementTypeSpecification (PUNCTUATION_OPERATOR elementTypeSpecification)*
+;
+
+// Original: elementTypeSpecification
+CONTROL_FLOWelementTypeSpecificationCONTROL_FLOW
+// Original: : nodeTypeSpecification
+: CONTROL_FLOWnodeTypeSpecificationCONTROL_FLOW
+// Original: | edgeTypeSpecification
+| CONTROL_FLOWedgeTypeSpecificationCONTROL_FLOW
+;
+
+// 18.2 <node type specification>
+
+// Original: nodeTypeSpecification
+CONTROL_FLOWnodeTypeSpecificationCONTROL_FLOW
+// Original: : nodeTypePattern
+: CONTROL_FLOWnodeTypePatternCONTROL_FLOW
+// Original: | nodeTypePhrase
+| CONTROL_FLOWnodeTypePhraseCONTROL_FLOW
+;
+
+// Original: nodeTypePattern
+CONTROL_FLOWnodeTypePatternCONTROL_FLOW
+// Original: : (nodeSynonym TYPE? nodeTypeName)? LEFT_PAREN localNodeTypeAlias? nodeTypeFiller? RIGHT_PAREN
+// Original: : (nodeSynonym TYPE? nodeTypeName)? LEFT_PAREN localNodeTypeAlias? nodeTypeFiller? PUNCTUATION_OPERATOR
+: (CONTROL_FLOWnodeSynonymCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW? CONTROL_FLOWnodeTypeNameCONTROL_FLOW)? CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlocalNodeTypeAliasCONTROL_FLOW? CONTROL_FLOWnodeTypeFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: nodeTypePhrase
+CONTROL_FLOWnodeTypePhraseCONTROL_FLOW
+// Original: : nodeSynonym TYPE? nodeTypePhraseFiller (AS localNodeTypeAlias)?
+: nodeSynonym TYPE? nodeTypePhraseFiller (KEYWORD localNodeTypeAlias)?
+;
+
+// Original: nodeTypePhraseFiller
+CONTROL_FLOWnodeTypePhraseFillerCONTROL_FLOW
+: nodeTypeName nodeTypeFiller?
+// Original: | nodeTypeFiller
+| CONTROL_FLOWnodeTypeFillerCONTROL_FLOW
+;
+
+// Original: nodeTypeFiller
+CONTROL_FLOWnodeTypeFillerCONTROL_FLOW
+: nodeTypeKeyLabelSet nodeTypeImpliedContent?
+// Original: | nodeTypeImpliedContent
+| CONTROL_FLOWnodeTypeImpliedContentCONTROL_FLOW
+;
+
+// Original: localNodeTypeAlias
+CONTROL_FLOWlocalNodeTypeAliasCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+;
+
+// Original: nodeTypeImpliedContent
+CONTROL_FLOWnodeTypeImpliedContentCONTROL_FLOW
+// Original: : nodeTypeLabelSet
+: CONTROL_FLOWnodeTypeLabelSetCONTROL_FLOW
+// Original: | nodeTypePropertyTypes
+| CONTROL_FLOWnodeTypePropertyTypesCONTROL_FLOW
+// Original: | nodeTypeLabelSet nodeTypePropertyTypes
+| CONTROL_FLOWnodeTypeLabelSetCONTROL_FLOW CONTROL_FLOWnodeTypePropertyTypesCONTROL_FLOW
+;
+
+// Original: nodeTypeKeyLabelSet
+CONTROL_FLOWnodeTypeKeyLabelSetCONTROL_FLOW
+// Original: : labelSetPhrase? IMPLIES
+: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW? CONTROL_FLOWIMPLIESCONTROL_FLOW
+;
+
+// Original: nodeTypeLabelSet
+CONTROL_FLOWnodeTypeLabelSetCONTROL_FLOW
+// Original: : labelSetPhrase
+: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW
+;
+
+// Original: nodeTypePropertyTypes
+CONTROL_FLOWnodeTypePropertyTypesCONTROL_FLOW
+// Original: : propertyTypesSpecification
+: CONTROL_FLOWpropertyTypesSpecificationCONTROL_FLOW
+;
+
+// 18.3 <edge type specification>
+
+// Original: edgeTypeSpecification
+CONTROL_FLOWedgeTypeSpecificationCONTROL_FLOW
+// Original: : edgeTypePattern
+: CONTROL_FLOWedgeTypePatternCONTROL_FLOW
+// Original: | edgeTypePhrase
+| CONTROL_FLOWedgeTypePhraseCONTROL_FLOW
+;
+
+// Original: edgeTypePattern
+CONTROL_FLOWedgeTypePatternCONTROL_FLOW
+: (edgeKind? edgeSynonym TYPE? edgeTypeName)? (edgeTypePatternDirected | edgeTypePatternUndirected)
+;
+
+// Original: edgeTypePhrase
+CONTROL_FLOWedgeTypePhraseCONTROL_FLOW
+// Original: : edgeKind edgeSynonym TYPE? edgeTypePhraseFiller endpointPairPhrase
+: CONTROL_FLOWedgeKindCONTROL_FLOW CONTROL_FLOWedgeSynonymCONTROL_FLOW CONTROL_FLOWTYPECONTROL_FLOW? CONTROL_FLOWedgeTypePhraseFillerCONTROL_FLOW CONTROL_FLOWendpointPairPhraseCONTROL_FLOW
+;
+
+// Original: edgeTypePhraseFiller
+CONTROL_FLOWedgeTypePhraseFillerCONTROL_FLOW
+: edgeTypeName edgeTypeFiller?
+// Original: | edgeTypeFiller
+| CONTROL_FLOWedgeTypeFillerCONTROL_FLOW
+;
+
+// Original: edgeTypeFiller
+CONTROL_FLOWedgeTypeFillerCONTROL_FLOW
+: edgeTypeKeyLabelSet edgeTypeImpliedContent?
+// Original: | edgeTypeImpliedContent
+| CONTROL_FLOWedgeTypeImpliedContentCONTROL_FLOW
+;
+
+// Original: edgeTypeImpliedContent
+CONTROL_FLOWedgeTypeImpliedContentCONTROL_FLOW
+// Original: : edgeTypeLabelSet
+: CONTROL_FLOWedgeTypeLabelSetCONTROL_FLOW
+// Original: | edgeTypePropertyTypes
+| CONTROL_FLOWedgeTypePropertyTypesCONTROL_FLOW
+// Original: | edgeTypeLabelSet edgeTypePropertyTypes
+| CONTROL_FLOWedgeTypeLabelSetCONTROL_FLOW CONTROL_FLOWedgeTypePropertyTypesCONTROL_FLOW
+;
+
+// Original: edgeTypeKeyLabelSet
+CONTROL_FLOWedgeTypeKeyLabelSetCONTROL_FLOW
+// Original: : labelSetPhrase? IMPLIES
+: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW? CONTROL_FLOWIMPLIESCONTROL_FLOW
+;
+
+// Original: edgeTypeLabelSet
+CONTROL_FLOWedgeTypeLabelSetCONTROL_FLOW
+// Original: : labelSetPhrase
+: CONTROL_FLOWlabelSetPhraseCONTROL_FLOW
+;
+
+// Original: edgeTypePropertyTypes
+CONTROL_FLOWedgeTypePropertyTypesCONTROL_FLOW
+// Original: : propertyTypesSpecification
+: CONTROL_FLOWpropertyTypesSpecificationCONTROL_FLOW
+;
+
+// Original: edgeTypePatternDirected
+CONTROL_FLOWedgeTypePatternDirectedCONTROL_FLOW
+// Original: : edgeTypePatternPointingRight
+: CONTROL_FLOWedgeTypePatternPointingRightCONTROL_FLOW
+// Original: | edgeTypePatternPointingLeft
+| CONTROL_FLOWedgeTypePatternPointingLeftCONTROL_FLOW
+;
+
+// Original: edgeTypePatternPointingRight
+CONTROL_FLOWedgeTypePatternPointingRightCONTROL_FLOW
+// Original: : sourceNodeTypeReference arcTypePointingRight destinationNodeTypeReference
+: CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW CONTROL_FLOWarcTypePointingRightCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW
+;
+
+// Original: edgeTypePatternPointingLeft
+CONTROL_FLOWedgeTypePatternPointingLeftCONTROL_FLOW
+// Original: : destinationNodeTypeReference arcTypePointingLeft sourceNodeTypeReference
+: CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW CONTROL_FLOWarcTypePointingLeftCONTROL_FLOW CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW
+;
+
+// Original: edgeTypePatternUndirected
+CONTROL_FLOWedgeTypePatternUndirectedCONTROL_FLOW
+// Original: : sourceNodeTypeReference arcTypeUndirected destinationNodeTypeReference
+: CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW CONTROL_FLOWarcTypeUndirectedCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW
+;
+
+// Original: arcTypePointingRight
+CONTROL_FLOWarcTypePointingRightCONTROL_FLOW
+// Original: : MINUS_LEFT_BRACKET edgeTypeFiller BRACKET_RIGHT_ARROW
+// Original: : MINUS_LEFT_BRACKET edgeTypeFiller PUNCTUATION_OPERATOR
+: CONTROL_FLOWMINUS_LEFT_BRACKETCONTROL_FLOW CONTROL_FLOWedgeTypeFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: arcTypePointingLeft
+CONTROL_FLOWarcTypePointingLeftCONTROL_FLOW
+// Original: : LEFT_ARROW_BRACKET edgeTypeFiller RIGHT_BRACKET_MINUS
+: CONTROL_FLOWLEFT_ARROW_BRACKETCONTROL_FLOW CONTROL_FLOWedgeTypeFillerCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKET_MINUSCONTROL_FLOW
+;
+
+// Original: arcTypeUndirected
+CONTROL_FLOWarcTypeUndirectedCONTROL_FLOW
+// Original: : TILDE_LEFT_BRACKET edgeTypeFiller RIGHT_BRACKET_TILDE
+// Original: : TILDE_LEFT_BRACKET edgeTypeFiller PUNCTUATION_OPERATOR
+// Original: : PUNCTUATION_OPERATOR edgeTypeFiller PUNCTUATION_OPERATOR
+: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWedgeTypeFillerCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: sourceNodeTypeReference
+CONTROL_FLOWsourceNodeTypeReferenceCONTROL_FLOW
+// Original: : LEFT_PAREN sourceNodeTypeAlias RIGHT_PAREN
+// Original: : LEFT_PAREN sourceNodeTypeAlias PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+// Original: | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
+// Original: | LEFT_PAREN nodeTypeFiller? PUNCTUATION_OPERATOR
+| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnodeTypeFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: destinationNodeTypeReference
+CONTROL_FLOWdestinationNodeTypeReferenceCONTROL_FLOW
+// Original: : LEFT_PAREN destinationNodeTypeAlias RIGHT_PAREN
+// Original: : LEFT_PAREN destinationNodeTypeAlias PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+// Original: | LEFT_PAREN nodeTypeFiller? RIGHT_PAREN
+// Original: | LEFT_PAREN nodeTypeFiller? PUNCTUATION_OPERATOR
+| CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnodeTypeFillerCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: edgeKind
+CONTROL_FLOWedgeKindCONTROL_FLOW
+// Original: : DIRECTED
+: CONTROL_FLOWDIRECTEDCONTROL_FLOW
+// Original: | UNDIRECTED
+| CONTROL_FLOWUNDIRECTEDCONTROL_FLOW
+;
+
+// Original: endpointPairPhrase
+CONTROL_FLOWendpointPairPhraseCONTROL_FLOW
+// Original: : CONNECTING endpointPair
+: CONTROL_FLOWCONNECTINGCONTROL_FLOW CONTROL_FLOWendpointPairCONTROL_FLOW
+;
+
+// Original: endpointPair
+CONTROL_FLOWendpointPairCONTROL_FLOW
+// Original: : endpointPairDirected
+: CONTROL_FLOWendpointPairDirectedCONTROL_FLOW
+// Original: | endpointPairUndirected
+| CONTROL_FLOWendpointPairUndirectedCONTROL_FLOW
+;
+
+// Original: endpointPairDirected
+CONTROL_FLOWendpointPairDirectedCONTROL_FLOW
+// Original: : endpointPairPointingRight
+: CONTROL_FLOWendpointPairPointingRightCONTROL_FLOW
+// Original: | endpointPairPointingLeft
+| CONTROL_FLOWendpointPairPointingLeftCONTROL_FLOW
+;
+
+// Original: endpointPairPointingRight
+CONTROL_FLOWendpointPairPointingRightCONTROL_FLOW
+// Original: : LEFT_PAREN sourceNodeTypeAlias connectorPointingRight destinationNodeTypeAlias RIGHT_PAREN
+// Original: : LEFT_PAREN sourceNodeTypeAlias connectorPointingRight destinationNodeTypeAlias PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWconnectorPointingRightCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: endpointPairPointingLeft
+CONTROL_FLOWendpointPairPointingLeftCONTROL_FLOW
+// Original: : LEFT_PAREN destinationNodeTypeAlias LEFT_ARROW sourceNodeTypeAlias RIGHT_PAREN
+// Original: : LEFT_PAREN destinationNodeTypeAlias LEFT_ARROW sourceNodeTypeAlias PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWLEFT_ARROWCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: endpointPairUndirected
+CONTROL_FLOWendpointPairUndirectedCONTROL_FLOW
+// Original: : LEFT_PAREN sourceNodeTypeAlias connectorUndirected destinationNodeTypeAlias RIGHT_PAREN
+// Original: : LEFT_PAREN sourceNodeTypeAlias connectorUndirected destinationNodeTypeAlias PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW CONTROL_FLOWconnectorUndirectedCONTROL_FLOW CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: connectorPointingRight
+CONTROL_FLOWconnectorPointingRightCONTROL_FLOW
+// Original: : TO
+// Original: : KEYWORD
+: CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | RIGHT_ARROW
+// Original: | PUNCTUATION_OPERATOR
+| CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: connectorUndirected
+CONTROL_FLOWconnectorUndirectedCONTROL_FLOW
+// Original: : TO
+// Original: : KEYWORD
+: CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | TILDE
+| CONTROL_FLOWTILDECONTROL_FLOW
+;
+
+// Original: sourceNodeTypeAlias
+CONTROL_FLOWsourceNodeTypeAliasCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+;
+
+// Original: destinationNodeTypeAlias
+CONTROL_FLOWdestinationNodeTypeAliasCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+;
+
+// 18.4 <label set phrase> and <label set specification>
+
+// Original: labelSetPhrase
+CONTROL_FLOWlabelSetPhraseCONTROL_FLOW
+// Original: : LABEL labelName
+: CONTROL_FLOWLABELCONTROL_FLOW CONTROL_FLOWlabelNameCONTROL_FLOW
+// Original: | LABELS labelSetSpecification
+| CONTROL_FLOWLABELSCONTROL_FLOW CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW
+// Original: | isOrColon labelSetSpecification
+| CONTROL_FLOWisOrColonCONTROL_FLOW CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW
+;
+
+// Original: labelSetSpecification
+CONTROL_FLOWlabelSetSpecificationCONTROL_FLOW
+// Original: : labelName (AMPERSAND labelName)*
+: labelName (PUNCTUATION_OPERATOR labelName)*
+;
+
+// 18.5 <property types specification>
+
+// Original: propertyTypesSpecification
+CONTROL_FLOWpropertyTypesSpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE propertyTypeList? RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWpropertyTypeListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: propertyTypeList
+CONTROL_FLOWpropertyTypeListCONTROL_FLOW
+// Original: : propertyType (COMMA propertyType)*
+: propertyType (PUNCTUATION_OPERATOR propertyType)*
+;
+
+// 18.6 <property type>
+
+// Original: propertyType
+CONTROL_FLOWpropertyTypeCONTROL_FLOW
+// Original: : propertyName typed? propertyValueType
+: CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWpropertyValueTypeCONTROL_FLOW
+;
+
+// 18.7 <property value type>
+
+// Original: propertyValueType
+CONTROL_FLOWpropertyValueTypeCONTROL_FLOW
+// Original: : valueType
+: CONTROL_FLOWvalueTypeCONTROL_FLOW
+;
+
+// 18.8 <binding table type>
+
+// Original: bindingTableType
+CONTROL_FLOWbindingTableTypeCONTROL_FLOW
+// Original: : BINDING? TABLE fieldTypesSpecification
+// Original: : KEYWORD? TABLE fieldTypesSpecification
+: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWfieldTypesSpecificationCONTROL_FLOW
+;
+
+// 18.9 <value type>
+
+// Original: valueType
+CONTROL_FLOWvalueTypeCONTROL_FLOW
+// Original: : predefinedType                                                                                                                              #predefinedTypeLabel
+: CONTROL_FLOWpredefinedTypeCONTROL_FLOW                                                                                                                              #CONTROL_FLOWpredefinedTypeLabelCONTROL_FLOW
+// <constructed value type>
+// Original: | pathValueType                                                                                                                               #pathValueTypeLabel
+| CONTROL_FLOWpathValueTypeCONTROL_FLOW                                                                                                                               #CONTROL_FLOWpathValueTypeLabelCONTROL_FLOW
+// Original: | listValueTypeName LEFT_ANGLE_BRACKET valueType RIGHT_ANGLE_BRACKET (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
+// Original: | listValueTypeName PUNCTUATION_OPERATOR valueType RIGHT_ANGLE_BRACKET (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
+// Original: | listValueTypeName PUNCTUATION_OPERATOR valueType RIGHT_ANGLE_BRACKET (PUNCTUATION_OPERATOR maxLength RIGHT_BRACKET)? notNull?     #listValueTypeAlt1
+| CONTROL_FLOWlistValueTypeNameCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW (CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWmaxLengthCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW)? CONTROL_FLOWnotNullCONTROL_FLOW?     #CONTROL_FLOWlistValueTypeAlt1CONTROL_FLOW
+// Original: | valueType listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                    #listValueTypeAlt2
+// Original: | valueType listValueTypeName (PUNCTUATION_OPERATOR maxLength RIGHT_BRACKET)? notNull?                                                    #listValueTypeAlt2
+| CONTROL_FLOWvalueTypeCONTROL_FLOW CONTROL_FLOWlistValueTypeNameCONTROL_FLOW (CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWmaxLengthCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW)? CONTROL_FLOWnotNullCONTROL_FLOW?                                                    #CONTROL_FLOWlistValueTypeAlt2CONTROL_FLOW
+// Original: | listValueTypeName (LEFT_BRACKET maxLength RIGHT_BRACKET)? notNull?                                                                #listValueTypeAlt3
+// Original: | listValueTypeName (PUNCTUATION_OPERATOR maxLength RIGHT_BRACKET)? notNull?                                                                #listValueTypeAlt3
+| CONTROL_FLOWlistValueTypeNameCONTROL_FLOW (CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWmaxLengthCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW)? CONTROL_FLOWnotNullCONTROL_FLOW?                                                                #CONTROL_FLOWlistValueTypeAlt3CONTROL_FLOW
+// Original: | recordType                                                                                                                                   #recordTypeLabel
+| CONTROL_FLOWrecordTypeCONTROL_FLOW                                                                                                                                   #CONTROL_FLOWrecordTypeLabelCONTROL_FLOW
+// <dynamic union type>
+// Original: | ANY VALUE? notNull?                                                                                                                        #openDynamicUnionTypeLabel
+| CONTROL_FLOWANYCONTROL_FLOW CONTROL_FLOWVALUECONTROL_FLOW? CONTROL_FLOWnotNullCONTROL_FLOW?                                                                                                                        #CONTROL_FLOWopenDynamicUnionTypeLabelCONTROL_FLOW
+// Original: | ANY? PROPERTY VALUE notNull?                                                                                                             #dynamicPropertyValueTypeLabel
+| CONTROL_FLOWANYCONTROL_FLOW? CONTROL_FLOWPROPERTYCONTROL_FLOW CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWnotNullCONTROL_FLOW?                                                                                                             #CONTROL_FLOWdynamicPropertyValueTypeLabelCONTROL_FLOW
+// <closed dynamic union type>
+// Original: | ANY VALUE? LEFT_ANGLE_BRACKET valueType (VERTICAL_BAR valueType)* RIGHT_ANGLE_BRACKET                                         #closedDynamicUnionTypeAtl1
+// Original: | ANY VALUE? PUNCTUATION_OPERATOR valueType (VERTICAL_BAR valueType)* RIGHT_ANGLE_BRACKET                                         #closedDynamicUnionTypeAtl1
+| CONTROL_FLOWANYCONTROL_FLOW CONTROL_FLOWVALUECONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW (CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW)* CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW                                         #CONTROL_FLOWclosedDynamicUnionTypeAtl1CONTROL_FLOW
+// Original: | valueType VERTICAL_BAR valueType                                                                                                        #closedDynamicUnionTypeAtl2
+| CONTROL_FLOWvalueTypeCONTROL_FLOW CONTROL_FLOWVERTICAL_BARCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW                                                                                                        #CONTROL_FLOWclosedDynamicUnionTypeAtl2CONTROL_FLOW
+;
+
+// Original: typed
+CONTROL_FLOWtypedCONTROL_FLOW
+// Original: : DOUBLE_COLON
+: CONTROL_FLOWDOUBLE_COLONCONTROL_FLOW
+// Original: | TYPED
+| CONTROL_FLOWTYPEDCONTROL_FLOW
+;
+
+// Original: predefinedType
+CONTROL_FLOWpredefinedTypeCONTROL_FLOW
+// Original: : booleanType
+: CONTROL_FLOWbooleanTypeCONTROL_FLOW
+// Original: | characterStringType
+| CONTROL_FLOWcharacterStringTypeCONTROL_FLOW
+// Original: | byteStringType
+| CONTROL_FLOWbyteStringTypeCONTROL_FLOW
+// Original: | numericType
+| CONTROL_FLOWnumericTypeCONTROL_FLOW
+// Original: | temporalType
+| CONTROL_FLOWtemporalTypeCONTROL_FLOW
+// Original: | referenceValueType
+| CONTROL_FLOWreferenceValueTypeCONTROL_FLOW
+// Original: | immaterialValueType
+| CONTROL_FLOWimmaterialValueTypeCONTROL_FLOW
+;
+
+// Original: booleanType
+CONTROL_FLOWbooleanTypeCONTROL_FLOW
+// Original: : (BOOL | BOOLEAN) notNull?
+// Original: : (BOOL | DATA_TYPE) notNull?
+: (DATA_TYPE | DATA_TYPE) notNull?
+;
+
+// Original: characterStringType
+CONTROL_FLOWcharacterStringTypeCONTROL_FLOW
+// Original: : STRING (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
+// Original: : STRING (LEFT_PAREN (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
+// Original: : DATA_TYPE (LEFT_PAREN (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
+// Original: : DATA_TYPE (PUNCTUATION_OPERATOR (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
+: DATA_TYPE (PUNCTUATION_OPERATOR (minLength PUNCTUATION_OPERATOR)? maxLength PUNCTUATION_OPERATOR)? notNull?
+// Original: | CHAR (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
+// Original: | CHAR (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
+// Original: | DATA_TYPE (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
+| DATA_TYPE (PUNCTUATION_OPERATOR fixedLength PUNCTUATION_OPERATOR)? notNull?
+// Original: | VARCHAR (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
+// Original: | DATA_TYPE (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
+// Original: | DATA_TYPE (LEFT_PAREN maxLength PUNCTUATION_OPERATOR)? notNull?
+| DATA_TYPE (PUNCTUATION_OPERATOR maxLength PUNCTUATION_OPERATOR)? notNull?
+;
+
+// Original: byteStringType
+CONTROL_FLOWbyteStringTypeCONTROL_FLOW
+// Original: : BYTES (LEFT_PAREN (minLength COMMA)? maxLength RIGHT_PAREN)? notNull?
+// Original: : BYTES (LEFT_PAREN (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
+// Original: : BYTES (PUNCTUATION_OPERATOR (minLength COMMA)? maxLength PUNCTUATION_OPERATOR)? notNull?
+// Original: : BYTES (PUNCTUATION_OPERATOR (minLength PUNCTUATION_OPERATOR)? maxLength PUNCTUATION_OPERATOR)? notNull?
+: DATA_TYPE (PUNCTUATION_OPERATOR (minLength PUNCTUATION_OPERATOR)? maxLength PUNCTUATION_OPERATOR)? notNull?
+// Original: | BINARY (LEFT_PAREN fixedLength RIGHT_PAREN)? notNull?
+// Original: | BINARY (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
+// Original: | KEYWORD (LEFT_PAREN fixedLength PUNCTUATION_OPERATOR)? notNull?
+| KEYWORD (PUNCTUATION_OPERATOR fixedLength PUNCTUATION_OPERATOR)? notNull?
+// Original: | VARBINARY (LEFT_PAREN maxLength RIGHT_PAREN)? notNull?
+// Original: | VARBINARY (LEFT_PAREN maxLength PUNCTUATION_OPERATOR)? notNull?
+// Original: | DATA_TYPE (LEFT_PAREN maxLength PUNCTUATION_OPERATOR)? notNull?
+| DATA_TYPE (PUNCTUATION_OPERATOR maxLength PUNCTUATION_OPERATOR)? notNull?
+;
+
+// Original: minLength
+CONTROL_FLOWminLengthCONTROL_FLOW
+// Original: : unsignedInteger
+: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+;
+
+// Original: maxLength
+CONTROL_FLOWmaxLengthCONTROL_FLOW
+// Original: : unsignedInteger
+: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+;
+
+// Original: fixedLength
+CONTROL_FLOWfixedLengthCONTROL_FLOW
+// Original: : unsignedInteger
+: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+;
+
+// Original: numericType
+CONTROL_FLOWnumericTypeCONTROL_FLOW
+// Original: : exactNumericType
+: CONTROL_FLOWexactNumericTypeCONTROL_FLOW
+// Original: | approximateNumericType
+| CONTROL_FLOWapproximateNumericTypeCONTROL_FLOW
+;
+
+// Original: exactNumericType
+CONTROL_FLOWexactNumericTypeCONTROL_FLOW
+// Original: : binaryExactNumericType
+: CONTROL_FLOWbinaryExactNumericTypeCONTROL_FLOW
+// Original: | decimalExactNumericType
+| CONTROL_FLOWdecimalExactNumericTypeCONTROL_FLOW
+;
+
+// Original: binaryExactNumericType
+CONTROL_FLOWbinaryExactNumericTypeCONTROL_FLOW
+// Original: : signedBinaryExactNumericType
+: CONTROL_FLOWsignedBinaryExactNumericTypeCONTROL_FLOW
+// Original: | unsignedBinaryExactNumericType
+| CONTROL_FLOWunsignedBinaryExactNumericTypeCONTROL_FLOW
+;
+
+// Original: signedBinaryExactNumericType
+CONTROL_FLOWsignedBinaryExactNumericTypeCONTROL_FLOW
+// Original: : INT8 notNull?
+: DATA_TYPE notNull?
+// Original: | INT16 notNull?
+| DATA_TYPE notNull?
+// Original: | INT32 notNull?
+| DATA_TYPE notNull?
+// Original: | INT64 notNull?
+| DATA_TYPE notNull?
+// Original: | INT128 notNull?
+| DATA_TYPE notNull?
+// Original: | INT256 notNull?
+| DATA_TYPE notNull?
+// Original: | SMALLINT notNull?
+| DATA_TYPE notNull?
+// Original: | INT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
+// Original: | INT (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
+// Original: | INT (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
+| DATA_TYPE (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
+// Original: | BIGINT notNull?
+| DATA_TYPE notNull?
+// Original: | SIGNED? verboseBinaryExactNumericType
+| CONTROL_FLOWSIGNEDCONTROL_FLOW? CONTROL_FLOWverboseBinaryExactNumericTypeCONTROL_FLOW
+;
+
+// Original: unsignedBinaryExactNumericType
+CONTROL_FLOWunsignedBinaryExactNumericTypeCONTROL_FLOW
+// Original: : UINT8 notNull?
+: DATA_TYPE notNull?
+// Original: | UINT16 notNull?
+| DATA_TYPE notNull?
+// Original: | UINT32 notNull?
+| DATA_TYPE notNull?
+// Original: | UINT64 notNull?
+| DATA_TYPE notNull?
+// Original: | UINT128 notNull?
+| DATA_TYPE notNull?
+// Original: | UINT256 notNull?
+| DATA_TYPE notNull?
+// Original: | USMALLINT notNull?
+| DATA_TYPE notNull?
+// Original: | UINT (LEFT_PAREN precision RIGHT_PAREN)? notNull?
+// Original: | UINT (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
+// Original: | UINT (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
+| DATA_TYPE (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
+// Original: | UBIGINT notNull?
+| DATA_TYPE notNull?
+// Original: | UNSIGNED verboseBinaryExactNumericType
+| CONTROL_FLOWUNSIGNEDCONTROL_FLOW CONTROL_FLOWverboseBinaryExactNumericTypeCONTROL_FLOW
+;
+
+// Original: verboseBinaryExactNumericType
+CONTROL_FLOWverboseBinaryExactNumericTypeCONTROL_FLOW
+: INTEGER8 notNull?
+| INTEGER16 notNull?
+| INTEGER32 notNull?
+| INTEGER64 notNull?
+| INTEGER128 notNull?
+| INTEGER256 notNull?
+// Original: | SMALL INTEGER notNull?
+| SMALL DATA_TYPE notNull?
+// Original: | INTEGER (LEFT_PAREN precision RIGHT_PAREN)? notNull?
+// Original: | INTEGER (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
+// Original: | DATA_TYPE (LEFT_PAREN precision PUNCTUATION_OPERATOR)? notNull?
+| DATA_TYPE (PUNCTUATION_OPERATOR precision PUNCTUATION_OPERATOR)? notNull?
+// Original: | BIG INTEGER notNull?
+// Original: | BIG DATA_TYPE notNull?
+| KEYWORD DATA_TYPE notNull?
+;
+
+// Original: decimalExactNumericType
+CONTROL_FLOWdecimalExactNumericTypeCONTROL_FLOW
+// Original: : (DECIMAL | DEC) (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN notNull?)?
+// Original: : (DECIMAL | DEC) (LEFT_PAREN precision (COMMA scale)? PUNCTUATION_OPERATOR notNull?)?
+// Original: : (DECIMAL | DEC) (PUNCTUATION_OPERATOR precision (COMMA scale)? PUNCTUATION_OPERATOR notNull?)?
+// Original: : (DECIMAL | DEC) (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR notNull?)?
+// Original: : (DATA_TYPE | DEC) (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR notNull?)?
+: (DATA_TYPE | DATA_TYPE) (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR notNull?)?
+;
+
+// Original: precision
+CONTROL_FLOWprecisionCONTROL_FLOW
+// Original: : unsignedDecimalInteger
+: CONTROL_FLOWunsignedDecimalIntegerCONTROL_FLOW
+;
+
+// Original: scale
+CONTROL_FLOWscaleCONTROL_FLOW
+// Original: : unsignedDecimalInteger
+: CONTROL_FLOWunsignedDecimalIntegerCONTROL_FLOW
+;
+
+// Original: approximateNumericType
+CONTROL_FLOWapproximateNumericTypeCONTROL_FLOW
+: FLOAT16 notNull?
+| FLOAT32 notNull?
+| FLOAT64 notNull?
+| FLOAT128 notNull?
+| FLOAT256 notNull?
+// Original: | FLOAT (LEFT_PAREN precision (COMMA scale)? RIGHT_PAREN)? notNull?
+// Original: | FLOAT (LEFT_PAREN precision (COMMA scale)? PUNCTUATION_OPERATOR)? notNull?
+// Original: | FLOAT (PUNCTUATION_OPERATOR precision (COMMA scale)? PUNCTUATION_OPERATOR)? notNull?
+// Original: | FLOAT (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR)? notNull?
+| DATA_TYPE (PUNCTUATION_OPERATOR precision (PUNCTUATION_OPERATOR scale)? PUNCTUATION_OPERATOR)? notNull?
+// Original: | REAL notNull?
+| DATA_TYPE notNull?
+// Original: | DOUBLE PRECISION? notNull?
+// Original: | DOUBLE KEYWORD? notNull?
+| DATA_TYPE KEYWORD? notNull?
+;
+
+// Original: temporalType
+CONTROL_FLOWtemporalTypeCONTROL_FLOW
+// Original: : temporalInstantType
+: CONTROL_FLOWtemporalInstantTypeCONTROL_FLOW
+// Original: | temporalDurationType
+| CONTROL_FLOWtemporalDurationTypeCONTROL_FLOW
+;
+
+// Original: temporalInstantType
+CONTROL_FLOWtemporalInstantTypeCONTROL_FLOW
+// Original: : datetimeType
+: CONTROL_FLOWdatetimeTypeCONTROL_FLOW
+// Original: | localdatetimeType
+| CONTROL_FLOWlocaldatetimeTypeCONTROL_FLOW
+// Original: | dateType
+| CONTROL_FLOWdateTypeCONTROL_FLOW
+// Original: | timeType
+| CONTROL_FLOWtimeTypeCONTROL_FLOW
+// Original: | localtimeType
+| CONTROL_FLOWlocaltimeTypeCONTROL_FLOW
+;
+
+// Original: datetimeType
+CONTROL_FLOWdatetimeTypeCONTROL_FLOW
+// Original: : ZONED DATETIME notNull?
+// Original: : ZONED DATA_TYPE notNull?
+: DATA_TYPE DATA_TYPE notNull?
+// Original: | TIMESTAMP WITH TIME ZONE notNull?
+// Original: | TIMESTAMP WITH DATA_TYPE ZONE notNull?
+// Original: | TIMESTAMP KEYWORD DATA_TYPE ZONE notNull?
+// Original: | TIMESTAMP KEYWORD DATA_TYPE KEYWORD notNull?
+| DATA_TYPE KEYWORD DATA_TYPE KEYWORD notNull?
+;
+
+// Original: localdatetimeType
+CONTROL_FLOWlocaldatetimeTypeCONTROL_FLOW
+// Original: : LOCAL DATETIME notNull?
+: LOCAL DATA_TYPE notNull?
+// Original: | TIMESTAMP (WITHOUT TIME ZONE)? notNull?
+// Original: | TIMESTAMP (WITHOUT DATA_TYPE ZONE)? notNull?
+// Original: | TIMESTAMP (KEYWORD DATA_TYPE ZONE)? notNull?
+// Original: | TIMESTAMP (KEYWORD DATA_TYPE KEYWORD)? notNull?
+| DATA_TYPE (KEYWORD DATA_TYPE KEYWORD)? notNull?
+;
+
+// Original: dateType
+CONTROL_FLOWdateTypeCONTROL_FLOW
+// Original: : DATE notNull?
+: DATA_TYPE notNull?
+;
+
+// Original: timeType
+CONTROL_FLOWtimeTypeCONTROL_FLOW
+// Original: : ZONED TIME notNull?
+// Original: : ZONED DATA_TYPE notNull?
+: DATA_TYPE DATA_TYPE notNull?
+// Original: | TIME WITH TIME ZONE notNull?
+// Original: | DATA_TYPE WITH DATA_TYPE ZONE notNull?
+// Original: | DATA_TYPE KEYWORD DATA_TYPE ZONE notNull?
+| DATA_TYPE KEYWORD DATA_TYPE KEYWORD notNull?
+;
+
+// Original: localtimeType
+CONTROL_FLOWlocaltimeTypeCONTROL_FLOW
+// Original: : LOCAL TIME notNull?
+: LOCAL DATA_TYPE notNull?
+// Original: | TIME WITHOUT TIME ZONE notNull?
+// Original: | DATA_TYPE WITHOUT DATA_TYPE ZONE notNull?
+// Original: | DATA_TYPE KEYWORD DATA_TYPE ZONE notNull?
+| DATA_TYPE KEYWORD DATA_TYPE KEYWORD notNull?
+;
+
+// Original: temporalDurationType
+CONTROL_FLOWtemporalDurationTypeCONTROL_FLOW
+// Original: : DURATION LEFT_PAREN temporalDurationQualifier RIGHT_PAREN notNull?
+// Original: : DURATION LEFT_PAREN temporalDurationQualifier PUNCTUATION_OPERATOR notNull?
+// Original: : DATA_TYPE LEFT_PAREN temporalDurationQualifier PUNCTUATION_OPERATOR notNull?
+: DATA_TYPE PUNCTUATION_OPERATOR temporalDurationQualifier PUNCTUATION_OPERATOR notNull?
+;
+
+// Original: temporalDurationQualifier
+CONTROL_FLOWtemporalDurationQualifierCONTROL_FLOW
+// Original: : YEAR TO MONTH
+// Original: : YEAR TO DATA_TYPE
+// Original: : DATA_TYPE TO DATA_TYPE
+// Original: : DATA_TYPE KEYWORD DATA_TYPE
+: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWDATA_TYPECONTROL_FLOW
+// Original: | DAY TO SECOND
+// Original: | DAY KEYWORD SECOND
+| CONTROL_FLOWDAYCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWSECONDCONTROL_FLOW
+;
+
+// Original: referenceValueType
+CONTROL_FLOWreferenceValueTypeCONTROL_FLOW
+// Original: : graphReferenceValueType
+: CONTROL_FLOWgraphReferenceValueTypeCONTROL_FLOW
+// Original: | bindingTableReferenceValueType
+| CONTROL_FLOWbindingTableReferenceValueTypeCONTROL_FLOW
+// Original: | nodeReferenceValueType
+| CONTROL_FLOWnodeReferenceValueTypeCONTROL_FLOW
+// Original: | edgeReferenceValueType
+| CONTROL_FLOWedgeReferenceValueTypeCONTROL_FLOW
+;
+
+// Original: immaterialValueType
+CONTROL_FLOWimmaterialValueTypeCONTROL_FLOW
+// Original: : nullType
+: CONTROL_FLOWnullTypeCONTROL_FLOW
+// Original: | emptyType
+| CONTROL_FLOWemptyTypeCONTROL_FLOW
+;
+
+// Original: nullType
+CONTROL_FLOWnullTypeCONTROL_FLOW
+// Original: : NULL
+: CONTROL_FLOWNULLCONTROL_FLOW
+;
+
+// Original: emptyType
+CONTROL_FLOWemptyTypeCONTROL_FLOW
+// Original: : NULL notNull
+: CONTROL_FLOWNULLCONTROL_FLOW CONTROL_FLOWnotNullCONTROL_FLOW
+// Original: | NOTHING
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+;
+
+// Original: graphReferenceValueType
+CONTROL_FLOWgraphReferenceValueTypeCONTROL_FLOW
+// Original: : openGraphReferenceValueType
+: CONTROL_FLOWopenGraphReferenceValueTypeCONTROL_FLOW
+// Original: | closedGraphReferenceValueType
+| CONTROL_FLOWclosedGraphReferenceValueTypeCONTROL_FLOW
+;
+
+// Original: closedGraphReferenceValueType
+CONTROL_FLOWclosedGraphReferenceValueTypeCONTROL_FLOW
+// Original: : PROPERTY? GRAPH nestedGraphTypeSpecification notNull?
+: KEYWORD? GRAPH nestedGraphTypeSpecification notNull?
+;
+
+// Original: openGraphReferenceValueType
+CONTROL_FLOWopenGraphReferenceValueTypeCONTROL_FLOW
+// Original: : ANY PROPERTY? GRAPH notNull?
+// Original: : ANY KEYWORD? GRAPH notNull?
+: KEYWORD KEYWORD? GRAPH notNull?
+;
+
+// Original: bindingTableReferenceValueType
+CONTROL_FLOWbindingTableReferenceValueTypeCONTROL_FLOW
+: bindingTableType notNull?
+;
+
+// Original: nodeReferenceValueType
+CONTROL_FLOWnodeReferenceValueTypeCONTROL_FLOW
+// Original: : openNodeReferenceValueType
+: CONTROL_FLOWopenNodeReferenceValueTypeCONTROL_FLOW
+// Original: | closedNodeReferenceValueType
+| CONTROL_FLOWclosedNodeReferenceValueTypeCONTROL_FLOW
+;
+
+// Original: closedNodeReferenceValueType
+CONTROL_FLOWclosedNodeReferenceValueTypeCONTROL_FLOW
+: nodeTypeSpecification notNull?
+;
+
+// Original: openNodeReferenceValueType
+CONTROL_FLOWopenNodeReferenceValueTypeCONTROL_FLOW
+// Original: : ANY? nodeSynonym notNull?
+: KEYWORD? nodeSynonym notNull?
+;
+
+// Original: edgeReferenceValueType
+CONTROL_FLOWedgeReferenceValueTypeCONTROL_FLOW
+// Original: : openEdgeReferenceValueType
+: CONTROL_FLOWopenEdgeReferenceValueTypeCONTROL_FLOW
+// Original: | closedEdgeReferenceValueType
+| CONTROL_FLOWclosedEdgeReferenceValueTypeCONTROL_FLOW
+;
+
+// Original: closedEdgeReferenceValueType
+CONTROL_FLOWclosedEdgeReferenceValueTypeCONTROL_FLOW
+: edgeTypeSpecification notNull?
+;
+
+// Original: openEdgeReferenceValueType
+CONTROL_FLOWopenEdgeReferenceValueTypeCONTROL_FLOW
+// Original: : ANY? edgeSynonym notNull?
+: KEYWORD? edgeSynonym notNull?
+;
+
+// Original: pathValueType
+CONTROL_FLOWpathValueTypeCONTROL_FLOW
+// Original: : PATH notNull?
+: KEYWORD notNull?
+;
+
+// Original: listValueTypeName
+CONTROL_FLOWlistValueTypeNameCONTROL_FLOW
+// Original: : GROUP? listValueTypeNameSynonym
+// Original: : KEYWORD? listValueTypeNameSynonym
+: CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWlistValueTypeNameSynonymCONTROL_FLOW
+;
+
+// Original: listValueTypeNameSynonym
+CONTROL_FLOWlistValueTypeNameSynonymCONTROL_FLOW
+// Original: : LIST
+: CONTROL_FLOWLISTCONTROL_FLOW
+// Original: | ARRAY
+| CONTROL_FLOWARRAYCONTROL_FLOW
+;
+
+// Original: recordType
+CONTROL_FLOWrecordTypeCONTROL_FLOW
+// Original: : ANY? RECORD notNull?
+: KEYWORD? RECORD notNull?
+| RECORD? fieldTypesSpecification notNull?
+;
+
+// Original: fieldTypesSpecification
+CONTROL_FLOWfieldTypesSpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE fieldTypeList? RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWfieldTypeListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: fieldTypeList
+CONTROL_FLOWfieldTypeListCONTROL_FLOW
+// Original: : fieldType (COMMA fieldType)*
+: fieldType (PUNCTUATION_OPERATOR fieldType)*
+;
+
+// Original: notNull
+CONTROL_FLOWnotNullCONTROL_FLOW
+// Original: :  NOT NULL
+:  CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWNULLCONTROL_FLOW
+;
+
+// 18.10 <field type>
+
+// Original: fieldType
+CONTROL_FLOWfieldTypeCONTROL_FLOW
+// Original: : fieldName typed? valueType
+: CONTROL_FLOWfieldNameCONTROL_FLOW CONTROL_FLOWtypedCONTROL_FLOW? CONTROL_FLOWvalueTypeCONTROL_FLOW
+;
+
+// 19.1 <search condition>
+
+// Original: searchCondition
+CONTROL_FLOWsearchConditionCONTROL_FLOW
+// Original: : booleanValueExpression
+: CONTROL_FLOWbooleanValueExpressionCONTROL_FLOW
+;
+
+// 19.2 <predicate>
+
+// Original: predicate
+CONTROL_FLOWpredicateCONTROL_FLOW
+// Original: : existsPredicate
+: CONTROL_FLOWexistsPredicateCONTROL_FLOW
+// Original: | nullPredicate
+| CONTROL_FLOWnullPredicateCONTROL_FLOW
+// Original: | valueTypePredicate
+| CONTROL_FLOWvalueTypePredicateCONTROL_FLOW
+// Original: | directedPredicate
+| CONTROL_FLOWdirectedPredicateCONTROL_FLOW
+// Original: | labeledPredicate
+| CONTROL_FLOWlabeledPredicateCONTROL_FLOW
+// Original: | sourceDestinationPredicate
+| CONTROL_FLOWsourceDestinationPredicateCONTROL_FLOW
+// Original: | all_differentPredicate
+| CONTROL_FLOWall_differentPredicateCONTROL_FLOW
+// Original: | samePredicate
+| CONTROL_FLOWsamePredicateCONTROL_FLOW
+// Original: | property_existsPredicate
+| CONTROL_FLOWproperty_existsPredicateCONTROL_FLOW
+;
+
+// 19.3 <comparison predicate>
+
+// Original: // The <comparison predicate> productions moved to valueExpression
+// CONTROL_FLOWTheCONTROL_FLOW <CONTROL_FLOWcomparisonCONTROL_FLOW CONTROL_FLOWpredicateCONTROL_FLOW> CONTROL_FLOWproductionsCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+// to avoid left mutually recursive productions.
+
+// Original: comparisonPredicatePart2
+CONTROL_FLOWcomparisonPredicatePart2CONTROL_FLOW
+// Original: : compOp valueExpression
+: CONTROL_FLOWcompOpCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: compOp
+CONTROL_FLOWcompOpCONTROL_FLOW
+// Original: : EQUALS_OPERATOR
+: CONTROL_FLOWEQUALS_OPERATORCONTROL_FLOW
+// Original: | NOT_EQUALS_OPERATOR
+| CONTROL_FLOWNOT_EQUALS_OPERATORCONTROL_FLOW
+// Original: | LEFT_ANGLE_BRACKET
+// Original: | PUNCTUATION_OPERATOR
+| CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+// Original: | RIGHT_ANGLE_BRACKET
+| CONTROL_FLOWRIGHT_ANGLE_BRACKETCONTROL_FLOW
+// Original: | LESS_THAN_OR_EQUALS_OPERATOR
+| CONTROL_FLOWLESS_THAN_OR_EQUALS_OPERATORCONTROL_FLOW
+// Original: | GREATER_THAN_OR_EQUALS_OPERATOR
+| CONTROL_FLOWGREATER_THAN_OR_EQUALS_OPERATORCONTROL_FLOW
+;
+
+// 19.4 <exists predicate>
+
+// Original: existsPredicate
+CONTROL_FLOWexistsPredicateCONTROL_FLOW
+// Original: : EXISTS (LEFT_BRACE graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern RIGHT_PAREN | LEFT_BRACE matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock RIGHT_PAREN | nestedQuerySpecification)
+// Original: : EXISTS (LEFT_BRACE graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern PUNCTUATION_OPERATOR | LEFT_BRACE matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
+// Original: : EXISTS (PUNCTUATION_OPERATOR graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
+// Original: : KEYWORD (PUNCTUATION_OPERATOR graphPattern RIGHT_BRACE | LEFT_PAREN graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock RIGHT_BRACE | LEFT_PAREN matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
+// Original: : KEYWORD (PUNCTUATION_OPERATOR graphPattern RIGHT_BRACE | PUNCTUATION_OPERATOR graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock RIGHT_BRACE | PUNCTUATION_OPERATOR matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
+: KEYWORD (PUNCTUATION_OPERATOR graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR graphPattern PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock PUNCTUATION_OPERATOR | PUNCTUATION_OPERATOR matchStatementBlock PUNCTUATION_OPERATOR | nestedQuerySpecification)
+;
+
+// 19.5 <null predicate>
+
+// Original: nullPredicate
+CONTROL_FLOWnullPredicateCONTROL_FLOW
+// Original: : valueExpressionPrimary nullPredicatePart2
+: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW CONTROL_FLOWnullPredicatePart2CONTROL_FLOW
+;
+
+// Original: nullPredicatePart2
+CONTROL_FLOWnullPredicatePart2CONTROL_FLOW
+// Original: : IS NOT? NULL
+: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWNULLCONTROL_FLOW
+;
+
+// 19.6 <value type predicate>
+
+// Original: valueTypePredicate
+CONTROL_FLOWvalueTypePredicateCONTROL_FLOW
+// Original: : valueExpressionPrimary valueTypePredicatePart2
+: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW CONTROL_FLOWvalueTypePredicatePart2CONTROL_FLOW
+;
+
+// Original: valueTypePredicatePart2
+CONTROL_FLOWvalueTypePredicatePart2CONTROL_FLOW
+// Original: : IS NOT? typed valueType
+: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWtypedCONTROL_FLOW CONTROL_FLOWvalueTypeCONTROL_FLOW
+;
+
+// 19.7 <normalized predicate>
+
+// Original: normalizedPredicatePart2
+CONTROL_FLOWnormalizedPredicatePart2CONTROL_FLOW
+// Original: : IS NOT? normalForm? NORMALIZED
+: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWnormalFormCONTROL_FLOW? CONTROL_FLOWNORMALIZEDCONTROL_FLOW
+;
+
+// 19.8 <directed predicate>
+
+// Original: directedPredicate
+CONTROL_FLOWdirectedPredicateCONTROL_FLOW
+// Original: : elementVariableReference directedPredicatePart2
+: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWdirectedPredicatePart2CONTROL_FLOW
+;
+
+// Original: directedPredicatePart2
+CONTROL_FLOWdirectedPredicatePart2CONTROL_FLOW
+// Original: : IS NOT? DIRECTED
+: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWDIRECTEDCONTROL_FLOW
+;
+
+// 19.9 <labled predicate>
+
+// Original: labeledPredicate
+CONTROL_FLOWlabeledPredicateCONTROL_FLOW
+// Original: : elementVariableReference labeledPredicatePart2
+: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWlabeledPredicatePart2CONTROL_FLOW
+;
+
+// Original: labeledPredicatePart2
+CONTROL_FLOWlabeledPredicatePart2CONTROL_FLOW
+// Original: : isLabeledOrColon labelExpression
+: CONTROL_FLOWisLabeledOrColonCONTROL_FLOW CONTROL_FLOWlabelExpressionCONTROL_FLOW
+;
+
+// Original: isLabeledOrColon
+CONTROL_FLOWisLabeledOrColonCONTROL_FLOW
+// Original: : IS NOT? LABELED
+: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWLABELEDCONTROL_FLOW
+// Original: | COLON
+| CONTROL_FLOWCOLONCONTROL_FLOW
+;
+
+// 19.10 <source/destination predicate>
+
+// Original: sourceDestinationPredicate
+CONTROL_FLOWsourceDestinationPredicateCONTROL_FLOW
+// Original: : nodeReference sourcePredicatePart2
+: CONTROL_FLOWnodeReferenceCONTROL_FLOW CONTROL_FLOWsourcePredicatePart2CONTROL_FLOW
+// Original: | nodeReference destinationPredicatePart2
+| CONTROL_FLOWnodeReferenceCONTROL_FLOW CONTROL_FLOWdestinationPredicatePart2CONTROL_FLOW
+;
+
+// Original: nodeReference
+CONTROL_FLOWnodeReferenceCONTROL_FLOW
+// Original: : elementVariableReference
+: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
+;
+
+// Original: sourcePredicatePart2
+CONTROL_FLOWsourcePredicatePart2CONTROL_FLOW
+// Original: : IS NOT? SOURCE OF edgeReference
+// Original: : IS NOT? KEYWORD OF edgeReference
+: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWedgeReferenceCONTROL_FLOW
+;
+
+// Original: destinationPredicatePart2
+CONTROL_FLOWdestinationPredicatePart2CONTROL_FLOW
+// Original: : IS NOT? DESTINATION OF edgeReference
+: CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWDESTINATIONCONTROL_FLOW CONTROL_FLOWOFCONTROL_FLOW CONTROL_FLOWedgeReferenceCONTROL_FLOW
+;
+
+// Original: edgeReference
+CONTROL_FLOWedgeReferenceCONTROL_FLOW
+// Original: : elementVariableReference
+: CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
+;
+
+// 19.11 <all different predicate>
+
+// Original: all_differentPredicate
+CONTROL_FLOWall_differentPredicateCONTROL_FLOW
+// Original: : ALL_DIFFERENT LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* PUNCTUATION_OPERATOR
+: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW)* CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 19.12 <same predicate>
+
+// Original: samePredicate
+CONTROL_FLOWsamePredicateCONTROL_FLOW
+// Original: : SAME LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
+// Original: : KEYWORD LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* RIGHT_PAREN
+// Original: : KEYWORD LEFT_PAREN elementVariableReference COMMA elementVariableReference (COMMA elementVariableReference)* PUNCTUATION_OPERATOR
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW)* CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 19.13 <property exists predicate>
+
+// Original: property_existsPredicate
+CONTROL_FLOWproperty_existsPredicateCONTROL_FLOW
+// Original: : PROPERTY_EXISTS LEFT_PAREN elementVariableReference COMMA propertyName RIGHT_PAREN
+// Original: : PROPERTY_EXISTS LEFT_PAREN elementVariableReference COMMA propertyName PUNCTUATION_OPERATOR
+: CONTROL_FLOWPROPERTY_EXISTSCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 20.1 <value expression>
+
+// Original: // This version of valueExpression sucks up rules broken out in the standard to a single production. This
+// CONTROL_FLOWThisCONTROL_FLOW CONTROL_FLOWversionCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWsucksCONTROL_FLOW CONTROL_FLOWupCONTROL_FLOW CONTROL_FLOWrulesCONTROL_FLOW CONTROL_FLOWbrokenCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWstandardCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWsingleCONTROL_FLOW CONTROL_FLOWproductionCONTROL_FLOW. CONTROL_FLOWThisCONTROL_FLOW
+// eliminates ambiguity in multiple rules specifying valueExpressionPrimary.
+
+// Original: valueExpression
+CONTROL_FLOWvalueExpressionCONTROL_FLOW
+// Original: // Numeric, datetime and duration types all support roughly the same expressions. So here
+// CONTROL_FLOWNumericCONTROL_FLOW, CONTROL_FLOWdatetimeCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWdurationCONTROL_FLOW CONTROL_FLOWtypesCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWsupportCONTROL_FLOW CONTROL_FLOWroughlyCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWsameCONTROL_FLOW CONTROL_FLOWexpressionsCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWhereCONTROL_FLOW
+// Original: // we define a rule that deals with all of them. It is up to the implementation to post
+// CONTROL_FLOWweCONTROL_FLOW CONTROL_FLOWdefineCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWruleCONTROL_FLOW CONTROL_FLOWthatCONTROL_FLOW CONTROL_FLOWdealsCONTROL_FLOW CONTROL_FLOWwithCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW. CONTROL_FLOWItCONTROL_FLOW CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWupCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWimplementationCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWpostCONTROL_FLOW
+// process the sytnax tree and flag invalid type and function combinations.
+// Original: : sign = (PLUS_SIGN | MINUS_SIGN) valueExpression                       #signedExprAlt
+: CONTROL_FLOWsignCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW                       #CONTROL_FLOWsignedExprAltCONTROL_FLOW
+// Original: | valueExpression operator = (ASTERISK | SOLIDUS) valueExpression       #multDivExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWASTERISKCONTROL_FLOW | CONTROL_FLOWSOLIDUSCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW       #CONTROL_FLOWmultDivExprAltCONTROL_FLOW
+// Original: | valueExpression operator = (PLUS_SIGN | MINUS_SIGN) valueExpression   #addSubtractExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW   #CONTROL_FLOWaddSubtractExprAltCONTROL_FLOW
+// Original: // Character strings, byte strings, lists and paths all support the same concatenation
+// CONTROL_FLOWCharacterCONTROL_FLOW CONTROL_FLOWstringsCONTROL_FLOW, CONTROL_FLOWbyteCONTROL_FLOW CONTROL_FLOWstringsCONTROL_FLOW, CONTROL_FLOWlistsCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWpathsCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWsupportCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWsameCONTROL_FLOW CONTROL_FLOWconcatenationCONTROL_FLOW
+// Original: // operator. So here we define a rule that deals with all of them. Of course the types
+// CONTROL_FLOWoperatorCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWhereCONTROL_FLOW CONTROL_FLOWweCONTROL_FLOW CONTROL_FLOWdefineCONTROL_FLOW CONTROL_FLOWaCONTROL_FLOW CONTROL_FLOWruleCONTROL_FLOW CONTROL_FLOWthatCONTROL_FLOW CONTROL_FLOWdealsCONTROL_FLOW CONTROL_FLOWwithCONTROL_FLOW CONTROL_FLOWallCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW. CONTROL_FLOWOfCONTROL_FLOW CONTROL_FLOWcourseCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWtypesCONTROL_FLOW
+// Original: // cannot be combined. So it is up to implementation to post process the sytax tree
+// CONTROL_FLOWcannotCONTROL_FLOW CONTROL_FLOWbeCONTROL_FLOW CONTROL_FLOWcombinedCONTROL_FLOW. CONTROL_FLOWSoCONTROL_FLOW CONTROL_FLOWitCONTROL_FLOW CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWupCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWimplementationCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWpostCONTROL_FLOW CONTROL_FLOWprocessCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWsytaxCONTROL_FLOW CONTROL_FLOWtreeCONTROL_FLOW
+// and flag invalid type and function combinations.
+// Original: | valueExpression CONCATENATION_OPERATOR valueExpression                #concatenationExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWCONCATENATION_OPERATORCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW                #CONTROL_FLOWconcatenationExprAltCONTROL_FLOW
+// Boolean value expression included here.
+// Original: | NOT valueExpression                                                   #notExprAlt
+| CONTROL_FLOWNOTCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW                                                   #CONTROL_FLOWnotExprAltCONTROL_FLOW
+// Original: | valueExpression IS NOT? truthValue                                    #isNotExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWISCONTROL_FLOW CONTROL_FLOWNOTCONTROL_FLOW? CONTROL_FLOWtruthValueCONTROL_FLOW                                    #CONTROL_FLOWisNotExprAltCONTROL_FLOW
+// Original: | valueExpression AND valueExpression                                   #conjunctiveExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWANDCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW                                   #CONTROL_FLOWconjunctiveExprAltCONTROL_FLOW
+// Original: | valueExpression operator = (OR | XOR) valueExpression                 #disjunctiveExprAlt
+// Original: | valueExpression operator = (OR | KEYWORD) valueExpression                 #disjunctiveExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWORCONTROL_FLOW | CONTROL_FLOWKEYWORDCONTROL_FLOW) CONTROL_FLOWvalueExpressionCONTROL_FLOW                 #CONTROL_FLOWdisjunctiveExprAltCONTROL_FLOW
+// The comparisonPredicate productions moved here to eliminate left mutual recursion.
+// Original: | valueExpression comparisonPredicatePart2                              #comparisonExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWcomparisonPredicatePart2CONTROL_FLOW                              #CONTROL_FLOWcomparisonExprAltCONTROL_FLOW
+// Original: | predicate                                                             #predicateExprAlt
+| CONTROL_FLOWpredicateCONTROL_FLOW                                                             #CONTROL_FLOWpredicateExprAltCONTROL_FLOW
+// The normalizedPredicate productions moved here to eliminate left mutual recursion.
+// Original: | valueExpression normalizedPredicatePart2                              #normalizedPredicateExprAlt
+| CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWnormalizedPredicatePart2CONTROL_FLOW                              #CONTROL_FLOWnormalizedPredicateExprAltCONTROL_FLOW
+// Original: | PROPERTY? GRAPH graphExpression                                       #propertyGraphExprAlt
+| CONTROL_FLOWPROPERTYCONTROL_FLOW? CONTROL_FLOWGRAPHCONTROL_FLOW CONTROL_FLOWgraphExpressionCONTROL_FLOW                                       #CONTROL_FLOWpropertyGraphExprAltCONTROL_FLOW
+// Original: | BINDING? TABLE bindingTableExpression                                 #bindingTableExprAlt
+// Original: | KEYWORD? TABLE bindingTableExpression                                 #bindingTableExprAlt
+| CONTROL_FLOWKEYWORDCONTROL_FLOW? CONTROL_FLOWTABLECONTROL_FLOW CONTROL_FLOWbindingTableExpressionCONTROL_FLOW                                 #CONTROL_FLOWbindingTableExprAltCONTROL_FLOW
+// Original: | valueFunction                                                         #valueFunctionExprAlt
+| CONTROL_FLOWvalueFunctionCONTROL_FLOW                                                         #CONTROL_FLOWvalueFunctionExprAltCONTROL_FLOW
+// Original: | valueExpressionPrimary                                                #primaryExprAlt
+| CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW                                                #CONTROL_FLOWprimaryExprAltCONTROL_FLOW
+;
+
+// Original: valueFunction
+CONTROL_FLOWvalueFunctionCONTROL_FLOW
+// Original: : numericValueFunction
+: CONTROL_FLOWnumericValueFunctionCONTROL_FLOW
+// Original: | datetimeSubtraction
+| CONTROL_FLOWdatetimeSubtractionCONTROL_FLOW
+// Original: | datetimeValueFunction
+| CONTROL_FLOWdatetimeValueFunctionCONTROL_FLOW
+// Original: | durationValueFunction
+| CONTROL_FLOWdurationValueFunctionCONTROL_FLOW
+// Original: | characterOrByteStringFunction
+| CONTROL_FLOWcharacterOrByteStringFunctionCONTROL_FLOW
+// Original: | listValueFunction
+| CONTROL_FLOWlistValueFunctionCONTROL_FLOW
+;
+
+// Original: booleanValueExpression
+CONTROL_FLOWbooleanValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: characterOrByteStringFunction
+CONTROL_FLOWcharacterOrByteStringFunctionCONTROL_FLOW
+// Original: : subCharacterOrByteString
+: CONTROL_FLOWsubCharacterOrByteStringCONTROL_FLOW
+// Original: | trimSingleCharacterOrByteString
+| CONTROL_FLOWtrimSingleCharacterOrByteStringCONTROL_FLOW
+// Original: | foldCharacterString
+| CONTROL_FLOWfoldCharacterStringCONTROL_FLOW
+// Original: | trimMultiCharacterCharacterString
+| CONTROL_FLOWtrimMultiCharacterCharacterStringCONTROL_FLOW
+// Original: | normalizeCharacterString
+| CONTROL_FLOWnormalizeCharacterStringCONTROL_FLOW
+;
+
+// Original: subCharacterOrByteString
+CONTROL_FLOWsubCharacterOrByteStringCONTROL_FLOW
+// Original: : (LEFT | RIGHT) LEFT_PAREN valueExpression COMMA stringLength RIGHT_PAREN
+// Original: : (KEYWORD | RIGHT) LEFT_PAREN valueExpression COMMA stringLength RIGHT_PAREN
+// Original: : (KEYWORD | RIGHT) LEFT_PAREN valueExpression COMMA stringLength PUNCTUATION_OPERATOR
+: (CONTROL_FLOWKEYWORDCONTROL_FLOW | CONTROL_FLOWRIGHTCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWstringLengthCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: trimSingleCharacterOrByteString
+CONTROL_FLOWtrimSingleCharacterOrByteStringCONTROL_FLOW
+// Original: : TRIM LEFT_PAREN trimOperands RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN trimOperands RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN trimOperands PUNCTUATION_OPERATOR
+: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWtrimOperandsCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: foldCharacterString
+CONTROL_FLOWfoldCharacterStringCONTROL_FLOW
+// Original: : (UPPER | LOWER) LEFT_PAREN valueExpression RIGHT_PAREN
+// Original: : (UPPER | LOWER) LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
+// Original: : (FUNCTION | LOWER) LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
+: (CONTROL_FLOWFUNCTIONCONTROL_FLOW | CONTROL_FLOWLOWERCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: trimMultiCharacterCharacterString
+CONTROL_FLOWtrimMultiCharacterCharacterStringCONTROL_FLOW
+// Original: : (BTRIM | LTRIM | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? RIGHT_PAREN
+// Original: : (BTRIM | FUNCTION | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? RIGHT_PAREN
+// Original: : (BTRIM | FUNCTION | RTRIM) LEFT_PAREN valueExpression (COMMA valueExpression)? PUNCTUATION_OPERATOR
+: (CONTROL_FLOWBTRIMCONTROL_FLOW | CONTROL_FLOWFUNCTIONCONTROL_FLOW | CONTROL_FLOWRTRIMCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW)? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: normalizeCharacterString
+CONTROL_FLOWnormalizeCharacterStringCONTROL_FLOW
+// Original: : NORMALIZE LEFT_PAREN valueExpression (COMMA normalForm)? RIGHT_PAREN
+// Original: : NORMALIZE LEFT_PAREN valueExpression (COMMA normalForm)? PUNCTUATION_OPERATOR
+: CONTROL_FLOWNORMALIZECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnormalFormCONTROL_FLOW)? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: nodeReferenceValueExpression
+CONTROL_FLOWnodeReferenceValueExpressionCONTROL_FLOW
+// Original: : valueExpressionPrimary
+: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
+;
+
+// Original: edgeReferenceValueExpression
+CONTROL_FLOWedgeReferenceValueExpressionCONTROL_FLOW
+// Original: : valueExpressionPrimary
+: CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
+;
+
+// Original: aggregatingValueExpression
+CONTROL_FLOWaggregatingValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.2 <value expression primary>
+
+// Original: valueExpressionPrimary
+CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
+// Original: : parenthesizedValueExpression
+: CONTROL_FLOWparenthesizedValueExpressionCONTROL_FLOW
+// Original: | aggregateFunction
+| CONTROL_FLOWaggregateFunctionCONTROL_FLOW
+// Original: | unsignedValueSpecification
+| CONTROL_FLOWunsignedValueSpecificationCONTROL_FLOW
+// Original: // List and Record literals are reduntantly/abiguously part of the literal production
+// CONTROL_FLOWListCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWRecordCONTROL_FLOW CONTROL_FLOWliteralsCONTROL_FLOW CONTROL_FLOWareCONTROL_FLOW CONTROL_FLOWreduntantlyCONTROL_FLOW/CONTROL_FLOWabiguouslyCONTROL_FLOW CONTROL_FLOWpartCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWliteralCONTROL_FLOW CONTROL_FLOWproductionCONTROL_FLOW
+// Original: //    | listValueConstructor
+//    | CONTROL_FLOWlistValueConstructorCONTROL_FLOW
+// Original: //    | recordConstructor
+//    | CONTROL_FLOWrecordConstructorCONTROL_FLOW
+// Original: | pathValueConstructor
+| CONTROL_FLOWpathValueConstructorCONTROL_FLOW
+// Original: | valueExpressionPrimary PERIOD propertyName      // <propertyReference
+| CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWpropertyNameCONTROL_FLOW      // <CONTROL_FLOWpropertyReferenceCONTROL_FLOW
+// Original: | valueQueryExpression
+| CONTROL_FLOWvalueQueryExpressionCONTROL_FLOW
+// Original: | caseExpression
+| CONTROL_FLOWcaseExpressionCONTROL_FLOW
+// Original: | castSpecification
+| CONTROL_FLOWcastSpecificationCONTROL_FLOW
+// Original: | element_idFunction
+| CONTROL_FLOWelement_idFunctionCONTROL_FLOW
+// Original: | letValueExpression
+| CONTROL_FLOWletValueExpressionCONTROL_FLOW
+// Original: | bindingVariableReference
+| CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
+;
+
+// Original: parenthesizedValueExpression
+CONTROL_FLOWparenthesizedValueExpressionCONTROL_FLOW
+// Original: : LEFT_PAREN valueExpression RIGHT_PAREN
+// Original: : LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: nonParenthesizedValueExpressionPrimary
+CONTROL_FLOWnonParenthesizedValueExpressionPrimaryCONTROL_FLOW
+// Original: : nonParenthesizedValueExpressionPrimarySpecialCase
+: CONTROL_FLOWnonParenthesizedValueExpressionPrimarySpecialCaseCONTROL_FLOW
+// Original: | bindingVariableReference
+| CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
+;
+
+// Original: nonParenthesizedValueExpressionPrimarySpecialCase
+CONTROL_FLOWnonParenthesizedValueExpressionPrimarySpecialCaseCONTROL_FLOW
+// Original: : aggregateFunction
+: CONTROL_FLOWaggregateFunctionCONTROL_FLOW
+// Original: | unsignedValueSpecification
+| CONTROL_FLOWunsignedValueSpecificationCONTROL_FLOW
+// Original: // List and Record literals are reduntantly/abiguously part of the literal production
+// CONTROL_FLOWListCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWRecordCONTROL_FLOW CONTROL_FLOWliteralsCONTROL_FLOW CONTROL_FLOWareCONTROL_FLOW CONTROL_FLOWreduntantlyCONTROL_FLOW/CONTROL_FLOWabiguouslyCONTROL_FLOW CONTROL_FLOWpartCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW CONTROL_FLOWtheCONTROL_FLOW CONTROL_FLOWliteralCONTROL_FLOW CONTROL_FLOWproductionCONTROL_FLOW
+// Original: //    | listValueConstructor
+//    | CONTROL_FLOWlistValueConstructorCONTROL_FLOW
+// Original: //    | recordConstructor
+//    | CONTROL_FLOWrecordConstructorCONTROL_FLOW
+// Original: | pathValueConstructor
+| CONTROL_FLOWpathValueConstructorCONTROL_FLOW
+// Original: | valueExpressionPrimary PERIOD propertyName      // <property reference>
+| valueExpressionPrimary PUNCTUATION_OPERATOR propertyName      // <property reference>
+// Original: | valueQueryExpression
+| CONTROL_FLOWvalueQueryExpressionCONTROL_FLOW
+// Original: | caseExpression
+| CONTROL_FLOWcaseExpressionCONTROL_FLOW
+// Original: | castSpecification
+| CONTROL_FLOWcastSpecificationCONTROL_FLOW
+// Original: | element_idFunction
+| CONTROL_FLOWelement_idFunctionCONTROL_FLOW
+// Original: | letValueExpression
+| CONTROL_FLOWletValueExpressionCONTROL_FLOW
+;
+
+// 20.3 <value specification>
+
+// Original: unsignedValueSpecification
+CONTROL_FLOWunsignedValueSpecificationCONTROL_FLOW
+// Original: : unsignedLiteral
+: CONTROL_FLOWunsignedLiteralCONTROL_FLOW
+// Original: | generalValueSpecification
+| CONTROL_FLOWgeneralValueSpecificationCONTROL_FLOW
+;
+
+// Original: nonNegativeIntegerSpecification
+CONTROL_FLOWnonNegativeIntegerSpecificationCONTROL_FLOW
+// Original: : unsignedInteger
+: CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+// Original: | dynamicParameterSpecification
+| CONTROL_FLOWdynamicParameterSpecificationCONTROL_FLOW
+;
+
+// Original: generalValueSpecification
+CONTROL_FLOWgeneralValueSpecificationCONTROL_FLOW
+// Original: : dynamicParameterSpecification
+: CONTROL_FLOWdynamicParameterSpecificationCONTROL_FLOW
+// Original: | SESSION_USER
+| CONTROL_FLOWSESSION_USERCONTROL_FLOW
+;
+
+// 20.4 <dynamic parameter specification>
+
+// Original: dynamicParameterSpecification
+CONTROL_FLOWdynamicParameterSpecificationCONTROL_FLOW
+// Original: : GENERAL_PARAMETER_REFERENCE
+: CONTROL_FLOWGENERAL_PARAMETER_REFERENCECONTROL_FLOW
+;
+
+// 20.5 <let value expression>
+
+// Original: letValueExpression
+CONTROL_FLOWletValueExpressionCONTROL_FLOW
+// Original: : LET letVariableDefinitionList IN valueExpression END
+: CONTROL_FLOWLETCONTROL_FLOW CONTROL_FLOWletVariableDefinitionListCONTROL_FLOW CONTROL_FLOWINCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWENDCONTROL_FLOW
+;
+
+// 20.6 <value query expression>
+
+// Original: valueQueryExpression
+CONTROL_FLOWvalueQueryExpressionCONTROL_FLOW
+// Original: : VALUE nestedQuerySpecification
+: CONTROL_FLOWVALUECONTROL_FLOW CONTROL_FLOWnestedQuerySpecificationCONTROL_FLOW
+;
+
+// 20.7 <case expression>
+
+// Original: caseExpression
+CONTROL_FLOWcaseExpressionCONTROL_FLOW
+// Original: : caseAbbreviation
+: CONTROL_FLOWcaseAbbreviationCONTROL_FLOW
+// Original: | caseSpecification
+| CONTROL_FLOWcaseSpecificationCONTROL_FLOW
+;
+
+// Original: caseAbbreviation
+CONTROL_FLOWcaseAbbreviationCONTROL_FLOW
+// Original: : NULLIF LEFT_PAREN valueExpression COMMA valueExpression RIGHT_PAREN
+// Original: : NULLIF LEFT_PAREN valueExpression COMMA valueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWNULLIFCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+// Original: | COALESCE LEFT_PAREN valueExpression (COMMA valueExpression)+ RIGHT_PAREN
+// Original: | COALESCE LEFT_PAREN valueExpression (COMMA valueExpression)+ PUNCTUATION_OPERATOR
+| CONTROL_FLOWCOALESCECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW (CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW)+ CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: caseSpecification
+CONTROL_FLOWcaseSpecificationCONTROL_FLOW
+// Original: : simpleCase
+: CONTROL_FLOWsimpleCaseCONTROL_FLOW
+// Original: | searchedCase
+| CONTROL_FLOWsearchedCaseCONTROL_FLOW
+;
+
+// Original: simpleCase
+CONTROL_FLOWsimpleCaseCONTROL_FLOW
+// Original: : CASE caseOperand simpleWhenClause+ elseClause? END
+: CONTROL_FLOWCASECONTROL_FLOW CONTROL_FLOWcaseOperandCONTROL_FLOW CONTROL_FLOWsimpleWhenClauseCONTROL_FLOW+ CONTROL_FLOWelseClauseCONTROL_FLOW? CONTROL_FLOWENDCONTROL_FLOW
+;
+
+// Original: searchedCase
+CONTROL_FLOWsearchedCaseCONTROL_FLOW
+// Original: : CASE searchedWhenClause+ elseClause? END
+: CONTROL_FLOWCASECONTROL_FLOW CONTROL_FLOWsearchedWhenClauseCONTROL_FLOW+ CONTROL_FLOWelseClauseCONTROL_FLOW? CONTROL_FLOWENDCONTROL_FLOW
+;
+
+// Original: simpleWhenClause
+CONTROL_FLOWsimpleWhenClauseCONTROL_FLOW
+// Original: : WHEN whenOperandList THEN result
+// Original: : WHEN whenOperandList CONTROL_FLOW result
+: CONTROL_FLOWWHENCONTROL_FLOW CONTROL_FLOWwhenOperandListCONTROL_FLOW CONTROL_FLOWCONTROL_FLOWCONTROL_FLOW CONTROL_FLOWresultCONTROL_FLOW
+;
+
+// Original: searchedWhenClause
+CONTROL_FLOWsearchedWhenClauseCONTROL_FLOW
+// Original: : WHEN searchCondition THEN result
+// Original: : WHEN searchCondition CONTROL_FLOW result
+: CONTROL_FLOWWHENCONTROL_FLOW CONTROL_FLOWsearchConditionCONTROL_FLOW CONTROL_FLOWCONTROL_FLOWCONTROL_FLOW CONTROL_FLOWresultCONTROL_FLOW
+;
+
+// Original: elseClause
+CONTROL_FLOWelseClauseCONTROL_FLOW
+// Original: : ELSE result
+: CONTROL_FLOWELSECONTROL_FLOW CONTROL_FLOWresultCONTROL_FLOW
+;
+
+// Original: caseOperand
+CONTROL_FLOWcaseOperandCONTROL_FLOW
+// Original: : nonParenthesizedValueExpressionPrimary
+: CONTROL_FLOWnonParenthesizedValueExpressionPrimaryCONTROL_FLOW
+// Original: | elementVariableReference
+| CONTROL_FLOWelementVariableReferenceCONTROL_FLOW
+;
+
+// Original: whenOperandList
+CONTROL_FLOWwhenOperandListCONTROL_FLOW
+// Original: : whenOperand (COMMA whenOperand)*
+: whenOperand (PUNCTUATION_OPERATOR whenOperand)*
+;
+
+// Original: whenOperand
+CONTROL_FLOWwhenOperandCONTROL_FLOW
+// Original: : nonParenthesizedValueExpressionPrimary
+: CONTROL_FLOWnonParenthesizedValueExpressionPrimaryCONTROL_FLOW
+// Original: | comparisonPredicatePart2
+| CONTROL_FLOWcomparisonPredicatePart2CONTROL_FLOW
+// Original: | nullPredicatePart2
+| CONTROL_FLOWnullPredicatePart2CONTROL_FLOW
+// Original: | valueTypePredicatePart2
+| CONTROL_FLOWvalueTypePredicatePart2CONTROL_FLOW
+// Original: | normalizedPredicatePart2
+| CONTROL_FLOWnormalizedPredicatePart2CONTROL_FLOW
+// Original: | directedPredicatePart2
+| CONTROL_FLOWdirectedPredicatePart2CONTROL_FLOW
+// Original: | labeledPredicatePart2
+| CONTROL_FLOWlabeledPredicatePart2CONTROL_FLOW
+// Original: | sourcePredicatePart2
+| CONTROL_FLOWsourcePredicatePart2CONTROL_FLOW
+// Original: | destinationPredicatePart2
+| CONTROL_FLOWdestinationPredicatePart2CONTROL_FLOW
+;
+
+// Original: result
+CONTROL_FLOWresultCONTROL_FLOW
+// Original: : resultExpression
+: CONTROL_FLOWresultExpressionCONTROL_FLOW
+// Original: | nullLiteral
+| CONTROL_FLOWnullLiteralCONTROL_FLOW
+;
+
+// Original: resultExpression
+CONTROL_FLOWresultExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.8 <cast specification>
+
+// Original: castSpecification
+CONTROL_FLOWcastSpecificationCONTROL_FLOW
+// Original: : CAST LEFT_PAREN castOperand AS castTarget RIGHT_PAREN
+// Original: : CAST LEFT_PAREN castOperand KEYWORD castTarget RIGHT_PAREN
+// Original: : CAST LEFT_PAREN castOperand KEYWORD castTarget PUNCTUATION_OPERATOR
+: CONTROL_FLOWCASTCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWcastOperandCONTROL_FLOW CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWcastTargetCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: castOperand
+CONTROL_FLOWcastOperandCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+// Original: | nullLiteral
+| CONTROL_FLOWnullLiteralCONTROL_FLOW
+;
+
+// Original: castTarget
+CONTROL_FLOWcastTargetCONTROL_FLOW
+// Original: : valueType
+: CONTROL_FLOWvalueTypeCONTROL_FLOW
+;
+
+// 20.9 <aggregate function>
+
+// Original: aggregateFunction
+CONTROL_FLOWaggregateFunctionCONTROL_FLOW
+// Original: : COUNT LEFT_PAREN ASTERISK RIGHT_PAREN
+// Original: : COUNT LEFT_PAREN ASTERISK PUNCTUATION_OPERATOR
+: CONTROL_FLOWCOUNTCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWASTERISKCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+// Original: | generalSetFunction
+| CONTROL_FLOWgeneralSetFunctionCONTROL_FLOW
+// Original: | binarySetFunction
+| CONTROL_FLOWbinarySetFunctionCONTROL_FLOW
+;
+
+// Original: generalSetFunction
+CONTROL_FLOWgeneralSetFunctionCONTROL_FLOW
+// Original: : generalSetFunctionType LEFT_PAREN setQuantifier? valueExpression RIGHT_PAREN
+// Original: : generalSetFunctionType LEFT_PAREN setQuantifier? valueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWgeneralSetFunctionTypeCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWsetQuantifierCONTROL_FLOW? CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: binarySetFunction
+CONTROL_FLOWbinarySetFunctionCONTROL_FLOW
+// Original: : binarySetFunctionType LEFT_PAREN dependentValueExpression COMMA independentValueExpression RIGHT_PAREN
+// Original: : binarySetFunctionType LEFT_PAREN dependentValueExpression COMMA independentValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWbinarySetFunctionTypeCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdependentValueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWindependentValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: generalSetFunctionType
+CONTROL_FLOWgeneralSetFunctionTypeCONTROL_FLOW
+// Original: : AVG
+: CONTROL_FLOWAVGCONTROL_FLOW
+// Original: | COUNT
+| CONTROL_FLOWCOUNTCONTROL_FLOW
+// Original: | MAX
+| CONTROL_FLOWMAXCONTROL_FLOW
+// Original: | MIN
+// Original: | DATA_TYPE
+| CONTROL_FLOWDATA_TYPECONTROL_FLOW
+// Original: | SUM
+// Original: | FUNCTION
+| CONTROL_FLOWFUNCTIONCONTROL_FLOW
+// Original: | COLLECT_LIST
+| CONTROL_FLOWCOLLECT_LISTCONTROL_FLOW
+// Original: | STDDEV_SAMP
+| CONTROL_FLOWSTDDEV_SAMPCONTROL_FLOW
+// Original: | STDDEV_POP
+// Original: | FUNCTION
+| CONTROL_FLOWFUNCTIONCONTROL_FLOW
+;
+
+// Original: setQuantifier
+CONTROL_FLOWsetQuantifierCONTROL_FLOW
+// Original: : DISTINCT
+: CONTROL_FLOWDISTINCTCONTROL_FLOW
+// Original: | ALL
+| CONTROL_FLOWALLCONTROL_FLOW
+;
+
+// Original: binarySetFunctionType
+CONTROL_FLOWbinarySetFunctionTypeCONTROL_FLOW
+// Original: : PERCENTILE_CONT
+: CONTROL_FLOWPERCENTILE_CONTCONTROL_FLOW
+// Original: | PERCENTILE_DISC
+| CONTROL_FLOWPERCENTILE_DISCCONTROL_FLOW
+;
+
+// Original: dependentValueExpression
+CONTROL_FLOWdependentValueExpressionCONTROL_FLOW
+// Original: : setQuantifier? numericValueExpression
+: CONTROL_FLOWsetQuantifierCONTROL_FLOW? CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// Original: independentValueExpression
+CONTROL_FLOWindependentValueExpressionCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// 20.10 <element_id function>
+
+// Original: element_idFunction
+CONTROL_FLOWelement_idFunctionCONTROL_FLOW
+// Original: : ELEMENT_ID LEFT_PAREN elementVariableReference RIGHT_PAREN
+// Original: : ELEMENT_ID LEFT_PAREN elementVariableReference PUNCTUATION_OPERATOR
+// Original: : DATA_TYPE LEFT_PAREN elementVariableReference PUNCTUATION_OPERATOR
+: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWelementVariableReferenceCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 20.11 <property reference>
+
+// 20.12 <binding variable reference>
+
+// Original: bindingVariableReference
+CONTROL_FLOWbindingVariableReferenceCONTROL_FLOW
+// Original: : bindingVariable
+: CONTROL_FLOWbindingVariableCONTROL_FLOW
+;
+
+// The path value expression was combined with list and string value expressions.
+// See listStringOrPathValueExpression.
+
+// Original: pathValueExpression
+CONTROL_FLOWpathValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.14 <path value constructor>
+
+// Original: pathValueConstructor
+CONTROL_FLOWpathValueConstructorCONTROL_FLOW
+// Original: : pathValueConstructorByEnumeration
+: CONTROL_FLOWpathValueConstructorByEnumerationCONTROL_FLOW
+;
+
+// Original: pathValueConstructorByEnumeration
+CONTROL_FLOWpathValueConstructorByEnumerationCONTROL_FLOW
+// Original: : PATH LEFT_BRACKET pathElementList RIGHT_BRACKET
+// Original: : KEYWORD LEFT_BRACKET pathElementList RIGHT_BRACKET
+// Original: : KEYWORD PUNCTUATION_OPERATOR pathElementList RIGHT_BRACKET
+: CONTROL_FLOWKEYWORDCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWpathElementListCONTROL_FLOW CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW
+;
+
+// Original: pathElementList
+CONTROL_FLOWpathElementListCONTROL_FLOW
+: pathElementListStart pathElementListStep*
+;
+
+// Original: pathElementListStart
+CONTROL_FLOWpathElementListStartCONTROL_FLOW
+// Original: : nodeReferenceValueExpression
+: CONTROL_FLOWnodeReferenceValueExpressionCONTROL_FLOW
+;
+
+// Original: pathElementListStep
+CONTROL_FLOWpathElementListStepCONTROL_FLOW
+// Original: : COMMA edgeReferenceValueExpression COMMA nodeReferenceValueExpression
+: CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWedgeReferenceValueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnodeReferenceValueExpressionCONTROL_FLOW
+;
+
+// 20.15 <list value expression>
+
+// The list value expression was combined with path and string value expressions.
+// See listStringOrPathValueExpression.
+
+// Original: listValueExpression
+CONTROL_FLOWlistValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.16 <list value function>
+
+// Original: // Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
+// CONTROL_FLOWNoteCONTROL_FLOW: CONTROL_FLOWByteStringCONTROL_FLOW CONTROL_FLOWfunctionsCONTROL_FLOW CONTROL_FLOWwereCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterByteStringOrListFunctionCONTROL_FLOW, CONTROL_FLOWsomeCONTROL_FLOW CONTROL_FLOWalternativesCONTROL_FLOW
+// Original: // apply to characterString, byteString and list. Breaking them out separately resulted in
+// CONTROL_FLOWapplyCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterStringCONTROL_FLOW, CONTROL_FLOWbyteStringCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWlistCONTROL_FLOW. CONTROL_FLOWBreakingCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWseparatelyCONTROL_FLOW CONTROL_FLOWresultedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW
+// ambiguity.
+
+// Original: listValueFunction
+CONTROL_FLOWlistValueFunctionCONTROL_FLOW
+// Original: : trimListFunction
+: CONTROL_FLOWtrimListFunctionCONTROL_FLOW
+// Original: | elementsFunction
+| CONTROL_FLOWelementsFunctionCONTROL_FLOW
+;
+
+// Original: trimListFunction
+CONTROL_FLOWtrimListFunctionCONTROL_FLOW
+// Original: : TRIM LEFT_PAREN listValueExpression COMMA numericValueExpression RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN listValueExpression COMMA numericValueExpression RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN listValueExpression COMMA numericValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlistValueExpressionCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: elementsFunction
+CONTROL_FLOWelementsFunctionCONTROL_FLOW
+// Original: : ELEMENTS LEFT_PAREN pathValueExpression RIGHT_PAREN
+// Original: : ELEMENTS LEFT_PAREN pathValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWELEMENTSCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWpathValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 20.17 <list value constructor>
+
+// Original: listValueConstructor
+CONTROL_FLOWlistValueConstructorCONTROL_FLOW
+// Original: : listValueConstructorByEnumeration
+: CONTROL_FLOWlistValueConstructorByEnumerationCONTROL_FLOW
+;
+
+// Original: listValueConstructorByEnumeration
+CONTROL_FLOWlistValueConstructorByEnumerationCONTROL_FLOW
+// Original: : listValueTypeName? LEFT_BRACKET listElementList? RIGHT_BRACKET
+// Original: : listValueTypeName? PUNCTUATION_OPERATOR listElementList? RIGHT_BRACKET
+: CONTROL_FLOWlistValueTypeNameCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWlistElementListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACKETCONTROL_FLOW
+;
+
+// Original: listElementList
+CONTROL_FLOWlistElementListCONTROL_FLOW
+// Original: : listElement (COMMA listElement)*
+: listElement (PUNCTUATION_OPERATOR listElement)*
+;
+
+// Original: listElement
+CONTROL_FLOWlistElementCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.18 <record constructor>
+
+// Original: recordConstructor
+CONTROL_FLOWrecordConstructorCONTROL_FLOW
+// Original: : RECORD? fieldsSpecification
+: CONTROL_FLOWRECORDCONTROL_FLOW? CONTROL_FLOWfieldsSpecificationCONTROL_FLOW
+;
+
+// Original: fieldsSpecification
+CONTROL_FLOWfieldsSpecificationCONTROL_FLOW
+// Original: : LEFT_BRACE fieldList? RIGHT_BRACE
+: CONTROL_FLOWLEFT_BRACECONTROL_FLOW CONTROL_FLOWfieldListCONTROL_FLOW? CONTROL_FLOWRIGHT_BRACECONTROL_FLOW
+;
+
+// Original: fieldList
+CONTROL_FLOWfieldListCONTROL_FLOW
+// Original: : field (COMMA field)*
+: field (PUNCTUATION_OPERATOR field)*
+;
+
+// 20.19 <field>
+
+// Original: field
+CONTROL_FLOWfieldCONTROL_FLOW
+// Original: : fieldName COLON valueExpression
+: CONTROL_FLOWfieldNameCONTROL_FLOW CONTROL_FLOWCOLONCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.20 <boolean value expression>
+
+// Original: // Most of <boolean value expression> is incorporated in valueExpression
+// CONTROL_FLOWMostCONTROL_FLOW CONTROL_FLOWofCONTROL_FLOW <CONTROL_FLOWbooleanCONTROL_FLOW CONTROL_FLOWvalueCONTROL_FLOW CONTROL_FLOWexpressionCONTROL_FLOW> CONTROL_FLOWisCONTROL_FLOW CONTROL_FLOWincorporatedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW
+
+// Original: truthValue
+CONTROL_FLOWtruthValueCONTROL_FLOW
+// Original: : BOOLEAN_LITERAL
+: CONTROL_FLOWBOOLEAN_LITERALCONTROL_FLOW
+;
+
+// 20.21 <numeric value expression>
+
+// Original: numericValueExpression
+CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+// Original: : sign = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
+: CONTROL_FLOWsignCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+// Original: | numericValueExpression operator = (ASTERISK | SOLIDUS) numericValueExpression
+| CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWASTERISKCONTROL_FLOW | CONTROL_FLOWSOLIDUSCONTROL_FLOW) CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+// Original: | numericValueExpression operator = (PLUS_SIGN | MINUS_SIGN) numericValueExpression
+| CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWoperatorCONTROL_FLOW = (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW) CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+// Original: | valueExpressionPrimary
+| CONTROL_FLOWvalueExpressionPrimaryCONTROL_FLOW
+// Original: | numericValueFunction
+| CONTROL_FLOWnumericValueFunctionCONTROL_FLOW
+;
+
+// 20.22 <numeric value function>
+
+// Original: numericValueFunction
+CONTROL_FLOWnumericValueFunctionCONTROL_FLOW
+// Original: : lengthExpression
+: CONTROL_FLOWlengthExpressionCONTROL_FLOW
+// Original: | cardinalityExpression
+| CONTROL_FLOWcardinalityExpressionCONTROL_FLOW
+// Original: | absoluteValueExpression
+| CONTROL_FLOWabsoluteValueExpressionCONTROL_FLOW
+// Original: | modulusExpression
+| CONTROL_FLOWmodulusExpressionCONTROL_FLOW
+// Original: | trigonometricFunction
+| CONTROL_FLOWtrigonometricFunctionCONTROL_FLOW
+// Original: | generalLogarithmFunction
+| CONTROL_FLOWgeneralLogarithmFunctionCONTROL_FLOW
+// Original: | commonLogarithm
+| CONTROL_FLOWcommonLogarithmCONTROL_FLOW
+// Original: | naturalLogarithm
+| CONTROL_FLOWnaturalLogarithmCONTROL_FLOW
+// Original: | exponentialFunction
+| CONTROL_FLOWexponentialFunctionCONTROL_FLOW
+// Original: | powerFunction
+| CONTROL_FLOWpowerFunctionCONTROL_FLOW
+// Original: | squareRoot
+| CONTROL_FLOWsquareRootCONTROL_FLOW
+// Original: | floorFunction
+| CONTROL_FLOWfloorFunctionCONTROL_FLOW
+// Original: | ceilingFunction
+| CONTROL_FLOWceilingFunctionCONTROL_FLOW
+;
+
+// Original: lengthExpression
+CONTROL_FLOWlengthExpressionCONTROL_FLOW
+// Original: : charLengthExpression
+: CONTROL_FLOWcharLengthExpressionCONTROL_FLOW
+// Original: | byteLengthExpression
+| CONTROL_FLOWbyteLengthExpressionCONTROL_FLOW
+// Original: | pathLengthExpression
+| CONTROL_FLOWpathLengthExpressionCONTROL_FLOW
+;
+
+// Original: cardinalityExpression
+CONTROL_FLOWcardinalityExpressionCONTROL_FLOW
+// Original: : CARDINALITY LEFT_PAREN cardinalityExpressionArgument RIGHT_PAREN
+// Original: : CARDINALITY LEFT_PAREN cardinalityExpressionArgument PUNCTUATION_OPERATOR
+: CONTROL_FLOWCARDINALITYCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWcardinalityExpressionArgumentCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+// Original: | SIZE LEFT_PAREN listValueExpression RIGHT_PAREN
+// Original: | DATA_TYPE LEFT_PAREN listValueExpression RIGHT_PAREN
+// Original: | DATA_TYPE LEFT_PAREN listValueExpression PUNCTUATION_OPERATOR
+| CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWlistValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: cardinalityExpressionArgument
+CONTROL_FLOWcardinalityExpressionArgumentCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: charLengthExpression
+CONTROL_FLOWcharLengthExpressionCONTROL_FLOW
+// Original: : (CHAR_LENGTH | CHARACTER_LENGTH) LEFT_PAREN characterStringValueExpression RIGHT_PAREN
+// Original: : (CHAR_LENGTH | CHARACTER_LENGTH) LEFT_PAREN characterStringValueExpression PUNCTUATION_OPERATOR
+: (CONTROL_FLOWCHAR_LENGTHCONTROL_FLOW | CONTROL_FLOWCHARACTER_LENGTHCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWcharacterStringValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: byteLengthExpression
+CONTROL_FLOWbyteLengthExpressionCONTROL_FLOW
+// Original: : (BYTE_LENGTH | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression RIGHT_PAREN
+// Original: : (DATA_TYPE | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression RIGHT_PAREN
+// Original: : (DATA_TYPE | OCTET_LENGTH) LEFT_PAREN byteStringValueExpression PUNCTUATION_OPERATOR
+// Original: : (DATA_TYPE | FUNCTION) LEFT_PAREN byteStringValueExpression PUNCTUATION_OPERATOR
+: (CONTROL_FLOWDATA_TYPECONTROL_FLOW | CONTROL_FLOWFUNCTIONCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWbyteStringValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: pathLengthExpression
+CONTROL_FLOWpathLengthExpressionCONTROL_FLOW
+// Original: : PATH_LENGTH LEFT_PAREN pathValueExpression RIGHT_PAREN
+// Original: : PATH_LENGTH LEFT_PAREN pathValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWPATH_LENGTHCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWpathValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// absoluteValueExpression applies to both numeric types and duration types. They have the same syntax.
+// Original: absoluteValueExpression
+CONTROL_FLOWabsoluteValueExpressionCONTROL_FLOW
+// Original: : ABS LEFT_PAREN valueExpression RIGHT_PAREN
+// Original: : ABS LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
+// Original: : FUNCTION LEFT_PAREN valueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWvalueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: modulusExpression
+CONTROL_FLOWmodulusExpressionCONTROL_FLOW
+// Original: : MOD LEFT_PAREN numericValueExpressionDividend COMMA numericValueExpressionDivisor RIGHT_PAREN
+// Original: : MOD LEFT_PAREN numericValueExpressionDividend COMMA numericValueExpressionDivisor PUNCTUATION_OPERATOR
+: CONTROL_FLOWMODCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionDividendCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnumericValueExpressionDivisorCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: numericValueExpressionDividend
+CONTROL_FLOWnumericValueExpressionDividendCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// Original: numericValueExpressionDivisor
+CONTROL_FLOWnumericValueExpressionDivisorCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// Original: trigonometricFunction
+CONTROL_FLOWtrigonometricFunctionCONTROL_FLOW
+// Original: : trigonometricFunctionName LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : trigonometricFunctionName LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWtrigonometricFunctionNameCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: trigonometricFunctionName
+CONTROL_FLOWtrigonometricFunctionNameCONTROL_FLOW
+// Original: : SIN
+: CONTROL_FLOWSINCONTROL_FLOW
+// Original: | COS
+| CONTROL_FLOWCOSCONTROL_FLOW
+// Original: | TAN
+| CONTROL_FLOWTANCONTROL_FLOW
+// Original: | COT
+| CONTROL_FLOWCOTCONTROL_FLOW
+// Original: | SINH
+| CONTROL_FLOWSINHCONTROL_FLOW
+// Original: | COSH
+| CONTROL_FLOWCOSHCONTROL_FLOW
+// Original: | TANH
+| CONTROL_FLOWTANHCONTROL_FLOW
+// Original: | ASIN
+| CONTROL_FLOWASINCONTROL_FLOW
+// Original: | ACOS
+| CONTROL_FLOWACOSCONTROL_FLOW
+// Original: | ATAN
+| CONTROL_FLOWATANCONTROL_FLOW
+// Original: | DEGREES
+| CONTROL_FLOWDEGREESCONTROL_FLOW
+// Original: | RADIANS
+| CONTROL_FLOWRADIANSCONTROL_FLOW
+;
+
+// Original: generalLogarithmFunction
+CONTROL_FLOWgeneralLogarithmFunctionCONTROL_FLOW
+// Original: : LOG LEFT_PAREN generalLogarithmBase COMMA generalLogarithmArgument RIGHT_PAREN
+// Original: : LOG LEFT_PAREN generalLogarithmBase COMMA generalLogarithmArgument PUNCTUATION_OPERATOR
+: CONTROL_FLOWLOGCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWgeneralLogarithmBaseCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWgeneralLogarithmArgumentCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: generalLogarithmBase
+CONTROL_FLOWgeneralLogarithmBaseCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// Original: generalLogarithmArgument
+CONTROL_FLOWgeneralLogarithmArgumentCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// Original: commonLogarithm
+CONTROL_FLOWcommonLogarithmCONTROL_FLOW
+// Original: : LOG10 LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: naturalLogarithm
+CONTROL_FLOWnaturalLogarithmCONTROL_FLOW
+// Original: : LN LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : LN LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWLNCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: exponentialFunction
+CONTROL_FLOWexponentialFunctionCONTROL_FLOW
+// Original: : EXP LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : EXP LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWEXPCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: powerFunction
+CONTROL_FLOWpowerFunctionCONTROL_FLOW
+// Original: : POWER LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent RIGHT_PAREN
+// Original: : POWER LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent PUNCTUATION_OPERATOR
+// Original: : FUNCTION LEFT_PAREN numericValueExpressionBase COMMA numericValueExpressionExponent PUNCTUATION_OPERATOR
+: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionBaseCONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWnumericValueExpressionExponentCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: numericValueExpressionBase
+CONTROL_FLOWnumericValueExpressionBaseCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// Original: numericValueExpressionExponent
+CONTROL_FLOWnumericValueExpressionExponentCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// Original: squareRoot
+CONTROL_FLOWsquareRootCONTROL_FLOW
+// Original: : SQRT LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : SQRT LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWSQRTCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: floorFunction
+CONTROL_FLOWfloorFunctionCONTROL_FLOW
+// Original: : FLOOR LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : FUNCTION LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
+: CONTROL_FLOWFUNCTIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: ceilingFunction
+CONTROL_FLOWceilingFunctionCONTROL_FLOW
+// Original: : (CEIL | CEILING) LEFT_PAREN numericValueExpression RIGHT_PAREN
+// Original: : (CEIL | CEILING) LEFT_PAREN numericValueExpression PUNCTUATION_OPERATOR
+: (CONTROL_FLOWCEILCONTROL_FLOW | CONTROL_FLOWCEILINGCONTROL_FLOW) CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWnumericValueExpressionCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// 20.23 <string value expression>
+
+// The string value expressions were combined with list and path value expressions.
+
+// Original: characterStringValueExpression
+CONTROL_FLOWcharacterStringValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: byteStringValueExpression
+CONTROL_FLOWbyteStringValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.24 <string value function>
+
+// Original: // Note: String functions were moved to characterByteStringOrListFunction, some alternatives
+// CONTROL_FLOWNoteCONTROL_FLOW: CONTROL_FLOWStringCONTROL_FLOW CONTROL_FLOWfunctionsCONTROL_FLOW CONTROL_FLOWwereCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterByteStringOrListFunctionCONTROL_FLOW, CONTROL_FLOWsomeCONTROL_FLOW CONTROL_FLOWalternativesCONTROL_FLOW
+// Original: // apply to characterString, byteString and list. Breaking them out separately resulted in
+// CONTROL_FLOWapplyCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterStringCONTROL_FLOW, CONTROL_FLOWbyteStringCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWlistCONTROL_FLOW. CONTROL_FLOWBreakingCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWseparatelyCONTROL_FLOW CONTROL_FLOWresultedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW
+// ambiguity.
+
+// Original: trimOperands
+CONTROL_FLOWtrimOperandsCONTROL_FLOW
+// Original: : (trimSpecification? trimCharacterOrByteString? FROM)? trimCharacterOrByteStringSource
+: (CONTROL_FLOWtrimSpecificationCONTROL_FLOW? CONTROL_FLOWtrimCharacterOrByteStringCONTROL_FLOW? CONTROL_FLOWFROMCONTROL_FLOW)? CONTROL_FLOWtrimCharacterOrByteStringSourceCONTROL_FLOW
+;
+
+// Original: trimCharacterOrByteStringSource
+CONTROL_FLOWtrimCharacterOrByteStringSourceCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: trimSpecification
+CONTROL_FLOWtrimSpecificationCONTROL_FLOW
+// Original: : LEADING
+: CONTROL_FLOWLEADINGCONTROL_FLOW
+// Original: | TRAILING
+| CONTROL_FLOWTRAILINGCONTROL_FLOW
+// Original: | BOTH
+| CONTROL_FLOWBOTHCONTROL_FLOW
+;
+
+// Original: trimCharacterOrByteString
+CONTROL_FLOWtrimCharacterOrByteStringCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: normalForm
+CONTROL_FLOWnormalFormCONTROL_FLOW
+// Original: : NFC
+: CONTROL_FLOWNFCCONTROL_FLOW
+// Original: | NFD
+| CONTROL_FLOWNFDCONTROL_FLOW
+// Original: | NFKC
+| CONTROL_FLOWNFKCCONTROL_FLOW
+// Original: | NFKD
+| CONTROL_FLOWNFKDCONTROL_FLOW
+;
+
+// Original: stringLength
+CONTROL_FLOWstringLengthCONTROL_FLOW
+// Original: : numericValueExpression
+: CONTROL_FLOWnumericValueExpressionCONTROL_FLOW
+;
+
+// 20.25 <byte string function>
+
+// Original: // Note: ByteString functions were moved to characterByteStringOrListFunction, some alternatives
+// CONTROL_FLOWNoteCONTROL_FLOW: CONTROL_FLOWByteStringCONTROL_FLOW CONTROL_FLOWfunctionsCONTROL_FLOW CONTROL_FLOWwereCONTROL_FLOW CONTROL_FLOWmovedCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterByteStringOrListFunctionCONTROL_FLOW, CONTROL_FLOWsomeCONTROL_FLOW CONTROL_FLOWalternativesCONTROL_FLOW
+// Original: // apply to characterString, byteString and list. Breaking them out separately resulted in
+// CONTROL_FLOWapplyCONTROL_FLOW CONTROL_FLOWtoCONTROL_FLOW CONTROL_FLOWcharacterStringCONTROL_FLOW, CONTROL_FLOWbyteStringCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWlistCONTROL_FLOW. CONTROL_FLOWBreakingCONTROL_FLOW CONTROL_FLOWthemCONTROL_FLOW CONTROL_FLOWoutCONTROL_FLOW CONTROL_FLOWseparatelyCONTROL_FLOW CONTROL_FLOWresultedCONTROL_FLOW CONTROL_FLOWinCONTROL_FLOW
+// ambiguity.
+
+// 20.26 <datetime value expression>
+
+// The implementation should enforce that the data type is a datetime value.
+// Original: datetimeValueExpression
+CONTROL_FLOWdatetimeValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// 20.27 <datetime value function>
+
+// Original: datetimeValueFunction
+CONTROL_FLOWdatetimeValueFunctionCONTROL_FLOW
+// Original: : dateFunction
+: CONTROL_FLOWdateFunctionCONTROL_FLOW
+// Original: | timeFunction
+| CONTROL_FLOWtimeFunctionCONTROL_FLOW
+// Original: | datetimeFunction
+| CONTROL_FLOWdatetimeFunctionCONTROL_FLOW
+// Original: | localtimeFunction
+| CONTROL_FLOWlocaltimeFunctionCONTROL_FLOW
+// Original: | localdatetimeFunction
+| CONTROL_FLOWlocaldatetimeFunctionCONTROL_FLOW
+;
+
+// Original: dateFunction
+CONTROL_FLOWdateFunctionCONTROL_FLOW
+// Original: : CURRENT_DATE
+: CONTROL_FLOWCURRENT_DATECONTROL_FLOW
+// Original: | DATE LEFT_PAREN dateFunctionParameters? RIGHT_PAREN
+// Original: | DATE LEFT_PAREN dateFunctionParameters? PUNCTUATION_OPERATOR
+| CONTROL_FLOWDATECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdateFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: timeFunction
+CONTROL_FLOWtimeFunctionCONTROL_FLOW
+// Original: : CURRENT_TIME
+: CONTROL_FLOWCURRENT_TIMECONTROL_FLOW
+// Original: | ZONED_TIME LEFT_PAREN timeFunctionParameters? RIGHT_PAREN
+// Original: | ZONED_TIME LEFT_PAREN timeFunctionParameters? PUNCTUATION_OPERATOR
+| CONTROL_FLOWZONED_TIMECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWtimeFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: localtimeFunction
+CONTROL_FLOWlocaltimeFunctionCONTROL_FLOW
+// Original: : LOCAL_TIME (LEFT_PAREN timeFunctionParameters? RIGHT_PAREN)?
+// Original: : LOCAL_TIME (LEFT_PAREN timeFunctionParameters? PUNCTUATION_OPERATOR)?
+: LOCAL_TIME (PUNCTUATION_OPERATOR timeFunctionParameters? PUNCTUATION_OPERATOR)?
+;
+
+// Original: datetimeFunction
+CONTROL_FLOWdatetimeFunctionCONTROL_FLOW
+// Original: : CURRENT_TIMESTAMP
+: CONTROL_FLOWCURRENT_TIMESTAMPCONTROL_FLOW
+// Original: | ZONED_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
+// Original: | ZONED_DATETIME LEFT_PAREN datetimeFunctionParameters? PUNCTUATION_OPERATOR
+| CONTROL_FLOWZONED_DATETIMECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdatetimeFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: localdatetimeFunction
+CONTROL_FLOWlocaldatetimeFunctionCONTROL_FLOW
+// Original: : LOCAL_TIMESTAMP
+: CONTROL_FLOWLOCAL_TIMESTAMPCONTROL_FLOW
+// Original: | LOCAL_DATETIME LEFT_PAREN datetimeFunctionParameters? RIGHT_PAREN
+// Original: | LOCAL_DATETIME LEFT_PAREN datetimeFunctionParameters? PUNCTUATION_OPERATOR
+| CONTROL_FLOWLOCAL_DATETIMECONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdatetimeFunctionParametersCONTROL_FLOW? CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: dateFunctionParameters
+CONTROL_FLOWdateFunctionParametersCONTROL_FLOW
+// Original: : dateString
+: CONTROL_FLOWdateStringCONTROL_FLOW
+// Original: | recordConstructor
+| CONTROL_FLOWrecordConstructorCONTROL_FLOW
+;
+
+// Original: timeFunctionParameters
+CONTROL_FLOWtimeFunctionParametersCONTROL_FLOW
+// Original: : timeString
+: CONTROL_FLOWtimeStringCONTROL_FLOW
+// Original: | recordConstructor
+| CONTROL_FLOWrecordConstructorCONTROL_FLOW
+;
+
+// Original: datetimeFunctionParameters
+CONTROL_FLOWdatetimeFunctionParametersCONTROL_FLOW
+// Original: : datetimeString
+: CONTROL_FLOWdatetimeStringCONTROL_FLOW
+// Original: | recordConstructor
+| CONTROL_FLOWrecordConstructorCONTROL_FLOW
+;
+
+// 20.28 <duration value expression>
+
+// The implemenation should enforce that the data type is a duration value.
+// Original: durationValueExpression
+CONTROL_FLOWdurationValueExpressionCONTROL_FLOW
+// Original: : valueExpression
+: CONTROL_FLOWvalueExpressionCONTROL_FLOW
+;
+
+// Original: datetimeSubtraction
+CONTROL_FLOWdatetimeSubtractionCONTROL_FLOW
+// Original: : DURATION_BETWEEN LEFT_PAREN datetimeSubtractionParameters RIGHT_PAREN temporalDurationQualifier?
+// Original: : DURATION_BETWEEN LEFT_PAREN datetimeSubtractionParameters PUNCTUATION_OPERATOR temporalDurationQualifier?
+// Original: : DATA_TYPE LEFT_PAREN datetimeSubtractionParameters PUNCTUATION_OPERATOR temporalDurationQualifier?
+: DATA_TYPE PUNCTUATION_OPERATOR datetimeSubtractionParameters PUNCTUATION_OPERATOR temporalDurationQualifier?
+;
+
+// Original: datetimeSubtractionParameters
+CONTROL_FLOWdatetimeSubtractionParametersCONTROL_FLOW
+// Original: : datetimeValueExpression1 COMMA datetimeValueExpression2
+: CONTROL_FLOWdatetimeValueExpression1CONTROL_FLOW CONTROL_FLOWCOMMACONTROL_FLOW CONTROL_FLOWdatetimeValueExpression2CONTROL_FLOW
+;
+
+// Original: datetimeValueExpression1
+CONTROL_FLOWdatetimeValueExpression1CONTROL_FLOW
+// Original: : datetimeValueExpression
+: CONTROL_FLOWdatetimeValueExpressionCONTROL_FLOW
+;
+
+// Original: datetimeValueExpression2
+CONTROL_FLOWdatetimeValueExpression2CONTROL_FLOW
+// Original: : datetimeValueExpression
+: CONTROL_FLOWdatetimeValueExpressionCONTROL_FLOW
+;
+
+// 20.29 <duration value function>
+
+// Original: durationValueFunction
+CONTROL_FLOWdurationValueFunctionCONTROL_FLOW
+// Original: : durationFunction
+: CONTROL_FLOWdurationFunctionCONTROL_FLOW
+// Original: | absoluteValueExpression
+| CONTROL_FLOWabsoluteValueExpressionCONTROL_FLOW
+;
+
+// Original: durationFunction
+CONTROL_FLOWdurationFunctionCONTROL_FLOW
+// Original: : DURATION LEFT_PAREN durationFunctionParameters RIGHT_PAREN
+// Original: : DURATION LEFT_PAREN durationFunctionParameters PUNCTUATION_OPERATOR
+: CONTROL_FLOWDURATIONCONTROL_FLOW CONTROL_FLOWLEFT_PARENCONTROL_FLOW CONTROL_FLOWdurationFunctionParametersCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW
+;
+
+// Original: durationFunctionParameters
+CONTROL_FLOWdurationFunctionParametersCONTROL_FLOW
+// Original: : durationString
+: CONTROL_FLOWdurationStringCONTROL_FLOW
+// Original: | recordConstructor
+| CONTROL_FLOWrecordConstructorCONTROL_FLOW
+;
+
+// Original: // 21.1 Names and Variables
+// CONTROL_FLOW21CONTROL_FLOW.CONTROL_FLOW1CONTROL_FLOW CONTROL_FLOWNamesCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWVariablesCONTROL_FLOW
+
+// Original: objectName
+CONTROL_FLOWobjectNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: objectNameOrBindingVariable
+CONTROL_FLOWobjectNameOrBindingVariableCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+;
+
+// Original: directoryName
+CONTROL_FLOWdirectoryNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: schemaName
+CONTROL_FLOWschemaNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: graphName
+CONTROL_FLOWgraphNameCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+// Original: | delimitedGraphName
+| CONTROL_FLOWdelimitedGraphNameCONTROL_FLOW
+;
+
+// Original: delimitedGraphName
+CONTROL_FLOWdelimitedGraphNameCONTROL_FLOW
+// Original: // DELIMITED_IDENTIFIER
+// CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
+// Original: : DOUBLE_QUOTED_CHARACTER_SEQUENCE
+: CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
+| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: graphTypeName
+CONTROL_FLOWgraphTypeNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: nodeTypeName
+CONTROL_FLOWnodeTypeNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: edgeTypeName
+CONTROL_FLOWedgeTypeNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: bindingTableName
+CONTROL_FLOWbindingTableNameCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+// Original: | delimitedBindingTableName
+| CONTROL_FLOWdelimitedBindingTableNameCONTROL_FLOW
+;
+
+// Original: delimitedBindingTableName
+CONTROL_FLOWdelimitedBindingTableNameCONTROL_FLOW
+// Original: // DELIMITED_IDENTIFIER
+// CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
+// Original: : DOUBLE_QUOTED_CHARACTER_SEQUENCE
+: CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
+| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: procedureName
+CONTROL_FLOWprocedureNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: labelName
+CONTROL_FLOWlabelNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: propertyName
+CONTROL_FLOWpropertyNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: fieldName
+CONTROL_FLOWfieldNameCONTROL_FLOW
+// Original: : identifier
+: CONTROL_FLOWidentifierCONTROL_FLOW
+;
+
+// Original: elementVariable
+CONTROL_FLOWelementVariableCONTROL_FLOW
+// Original: : bindingVariable
+: CONTROL_FLOWbindingVariableCONTROL_FLOW
+;
+
+// Original: pathVariable
+CONTROL_FLOWpathVariableCONTROL_FLOW
+// Original: : bindingVariable
+: CONTROL_FLOWbindingVariableCONTROL_FLOW
+;
+
+// Original: subpathVariable
+CONTROL_FLOWsubpathVariableCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+;
+
+// Original: bindingVariable
+CONTROL_FLOWbindingVariableCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+;
+
+// 21.2 <literal>
+
+// Original: unsignedLiteral
+CONTROL_FLOWunsignedLiteralCONTROL_FLOW
+// Original: : unsignedNumericLiteral
+: CONTROL_FLOWunsignedNumericLiteralCONTROL_FLOW
+// Original: | generalLiteral
+| CONTROL_FLOWgeneralLiteralCONTROL_FLOW
+;
+
+// Original: generalLiteral
+CONTROL_FLOWgeneralLiteralCONTROL_FLOW
+// Original: : BOOLEAN_LITERAL
+: CONTROL_FLOWBOOLEAN_LITERALCONTROL_FLOW
+// Original: | characterStringLiteral
+| CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
+// Original: | BYTE_STRING_LITERAL
+| CONTROL_FLOWBYTE_STRING_LITERALCONTROL_FLOW
+// Original: | temporalLiteral
+| CONTROL_FLOWtemporalLiteralCONTROL_FLOW
+// Original: | durationLiteral
+| CONTROL_FLOWdurationLiteralCONTROL_FLOW
+// Original: | nullLiteral
+| CONTROL_FLOWnullLiteralCONTROL_FLOW
+// Original: | listLiteral
+| CONTROL_FLOWlistLiteralCONTROL_FLOW
+// Original: | recordLiteral
+| CONTROL_FLOWrecordLiteralCONTROL_FLOW
+;
+
+// Original: temporalLiteral
+CONTROL_FLOWtemporalLiteralCONTROL_FLOW
+// Original: : dateLiteral
+: CONTROL_FLOWdateLiteralCONTROL_FLOW
+// Original: | timeLiteral
+| CONTROL_FLOWtimeLiteralCONTROL_FLOW
+// Original: | datetimeLiteral
+| CONTROL_FLOWdatetimeLiteralCONTROL_FLOW
+// Original: //    | sqlDatetimeLiteral
+//    | CONTROL_FLOWsqlDatetimeLiteralCONTROL_FLOW
+;
+
+// Original: dateLiteral
+CONTROL_FLOWdateLiteralCONTROL_FLOW
+// Original: : DATE dateString
+: CONTROL_FLOWDATECONTROL_FLOW CONTROL_FLOWdateStringCONTROL_FLOW
+;
+
+// Original: timeLiteral
+CONTROL_FLOWtimeLiteralCONTROL_FLOW
+// Original: : TIME timeString
+: CONTROL_FLOWTIMECONTROL_FLOW CONTROL_FLOWtimeStringCONTROL_FLOW
+;
+
+// Original: datetimeLiteral
+CONTROL_FLOWdatetimeLiteralCONTROL_FLOW
+// Original: : (DATETIME | TIMESTAMP) datetimeString
+: (CONTROL_FLOWDATETIMECONTROL_FLOW | CONTROL_FLOWTIMESTAMPCONTROL_FLOW) CONTROL_FLOWdatetimeStringCONTROL_FLOW
+;
+
+// Original: listLiteral
+CONTROL_FLOWlistLiteralCONTROL_FLOW
+// Original: : listValueConstructorByEnumeration
+: CONTROL_FLOWlistValueConstructorByEnumerationCONTROL_FLOW
+;
+
+// Original: recordLiteral
+CONTROL_FLOWrecordLiteralCONTROL_FLOW
+// Original: : recordConstructor
+: CONTROL_FLOWrecordConstructorCONTROL_FLOW
+;
+
+// Original: identifier
+CONTROL_FLOWidentifierCONTROL_FLOW
+// Original: : regularIdentifier
+: CONTROL_FLOWregularIdentifierCONTROL_FLOW
+// Original: // DELIMITED_IDENTIFIER
+// CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
+// Original: | DOUBLE_QUOTED_CHARACTER_SEQUENCE
+| CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
+| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: regularIdentifier
+CONTROL_FLOWregularIdentifierCONTROL_FLOW
+// Original: : REGULAR_IDENTIFIER
+: CONTROL_FLOWREGULAR_IDENTIFIERCONTROL_FLOW
+// Original: | nonReservedWords
+| CONTROL_FLOWnonReservedWordsCONTROL_FLOW
+;
+
+// Original: timeZoneString
+CONTROL_FLOWtimeZoneStringCONTROL_FLOW
+// Original: : characterStringLiteral
+: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
+;
+
+// Original: characterStringLiteral
+CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
+// Original: : SINGLE_QUOTED_CHARACTER_SEQUENCE
+: CONTROL_FLOWSINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: | DOUBLE_QUOTED_CHARACTER_SEQUENCE
+| CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: unsignedNumericLiteral
+CONTROL_FLOWunsignedNumericLiteralCONTROL_FLOW
+// Original: : exactNumericLiteral
+: CONTROL_FLOWexactNumericLiteralCONTROL_FLOW
+// Original: | approximateNumericLiteral
+| CONTROL_FLOWapproximateNumericLiteralCONTROL_FLOW
+;
+
+// Original: exactNumericLiteral
+CONTROL_FLOWexactNumericLiteralCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
+// Original: | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+| CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
+// Original: | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
+| CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
+// Original: | UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
+| CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
+// Original: | unsignedInteger
+| CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+;
+
+// Original: approximateNumericLiteral
+CONTROL_FLOWapproximateNumericLiteralCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+// Original: | UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
+| CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
+// Original: | UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+| CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+// Original: | UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
+| CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+;
+
+// Original: unsignedInteger
+CONTROL_FLOWunsignedIntegerCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_INTEGER
+// Original: : DATA_TYPE
+: CONTROL_FLOWDATA_TYPECONTROL_FLOW
+// Original: | UNSIGNED_HEXADECIMAL_INTEGER
+| CONTROL_FLOWUNSIGNED_HEXADECIMAL_INTEGERCONTROL_FLOW
+// Original: | UNSIGNED_OCTAL_INTEGER
+// Original: | DATA_TYPE
+| CONTROL_FLOWDATA_TYPECONTROL_FLOW
+// Original: | UNSIGNED_BINARY_INTEGER
+| CONTROL_FLOWUNSIGNED_BINARY_INTEGERCONTROL_FLOW
+;
+
+// Original: unsignedDecimalInteger
+CONTROL_FLOWunsignedDecimalIntegerCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_INTEGER
+// Original: : DATA_TYPE
+: CONTROL_FLOWDATA_TYPECONTROL_FLOW
+;
+
+// Original: nullLiteral
+CONTROL_FLOWnullLiteralCONTROL_FLOW
+// Original: : NULL
+: CONTROL_FLOWNULLCONTROL_FLOW
+;
+
+// Original: dateString
+CONTROL_FLOWdateStringCONTROL_FLOW
+// Original: : characterStringLiteral
+: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
+;
+
+// Original: timeString
+CONTROL_FLOWtimeStringCONTROL_FLOW
+// Original: : characterStringLiteral
+: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
+;
+
+// Original: datetimeString
+CONTROL_FLOWdatetimeStringCONTROL_FLOW
+// Original: : characterStringLiteral
+: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
+;
+
+// Original: durationLiteral
+CONTROL_FLOWdurationLiteralCONTROL_FLOW
+// Original: : DURATION durationString
+: CONTROL_FLOWDURATIONCONTROL_FLOW CONTROL_FLOWdurationStringCONTROL_FLOW
+// Original: //    | sqlIntervalLiteral
+//    | CONTROL_FLOWsqlIntervalLiteralCONTROL_FLOW
+;
+
+// Original: durationString
+CONTROL_FLOWdurationStringCONTROL_FLOW
+// Original: : characterStringLiteral
+: CONTROL_FLOWcharacterStringLiteralCONTROL_FLOW
+;
+
+// Original: nodeSynonym
+CONTROL_FLOWnodeSynonymCONTROL_FLOW
+// Original: : NODE
+: CONTROL_FLOWNODECONTROL_FLOW
+// Original: | VERTEX
+| CONTROL_FLOWVERTEXCONTROL_FLOW
+;
+
+// Original: edgesSynonym
+CONTROL_FLOWedgesSynonymCONTROL_FLOW
+// Original: : EDGES
+: CONTROL_FLOWEDGESCONTROL_FLOW
+// Original: | RELATIONSHIPS
+| CONTROL_FLOWRELATIONSHIPSCONTROL_FLOW
+;
+
+// Original: edgeSynonym
+CONTROL_FLOWedgeSynonymCONTROL_FLOW
+// Original: : EDGE
+: CONTROL_FLOWEDGECONTROL_FLOW
+// Original: | RELATIONSHIP
+| CONTROL_FLOWRELATIONSHIPCONTROL_FLOW
+;
+
+// Original: // 21.1 Names and Variables
+// CONTROL_FLOW21CONTROL_FLOW.CONTROL_FLOW1CONTROL_FLOW CONTROL_FLOWNamesCONTROL_FLOW CONTROL_FLOWandCONTROL_FLOW CONTROL_FLOWVariablesCONTROL_FLOW
+
+// Original: IMPLIES
+CONTROL_FLOWIMPLIESCONTROL_FLOW
+// Original: : RIGHT_DOUBLE_ARROW
+: CONTROL_FLOWRIGHT_DOUBLE_ARROWCONTROL_FLOW
+// Original: | 'IMPLIES'
+| 'CONTROL_FLOW'
+;
+
+// Original: fragment PARAMETER_NAME
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWPARAMETER_NAMECONTROL_FLOW
+// Original: : SEPARATED_IDENTIFIER
+: CONTROL_FLOWSEPARATED_IDENTIFIERCONTROL_FLOW
+;
+
+// 21.2 <literal>
+
+// Original: nonReservedWords
+CONTROL_FLOWnonReservedWordsCONTROL_FLOW
+// Original: : ACYCLIC
+: CONTROL_FLOWACYCLICCONTROL_FLOW
+// Original: | BINDING
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | BINDINGS
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | CONNECTING
+| CONTROL_FLOWCONNECTINGCONTROL_FLOW
+// Original: | DESTINATION
+| CONTROL_FLOWDESTINATIONCONTROL_FLOW
+// Original: | DIFFERENT
+| CONTROL_FLOWDIFFERENTCONTROL_FLOW
+// Original: | DIRECTED
+| CONTROL_FLOWDIRECTEDCONTROL_FLOW
+// Original: | EDGE
+| CONTROL_FLOWEDGECONTROL_FLOW
+// Original: | EDGES
+| CONTROL_FLOWEDGESCONTROL_FLOW
+// Original: | ELEMENT
+| CONTROL_FLOWELEMENTCONTROL_FLOW
+// Original: | ELEMENTS
+| CONTROL_FLOWELEMENTSCONTROL_FLOW
+// Original: | FIRST
+| CONTROL_FLOWFIRSTCONTROL_FLOW
+// Original: | GRAPH
+| CONTROL_FLOWGRAPHCONTROL_FLOW
+// Original: | GROUPS
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | KEEP
+| CONTROL_FLOWKEEPCONTROL_FLOW
+// Original: | LABEL
+| CONTROL_FLOWLABELCONTROL_FLOW
+// Original: | LABELED
+| CONTROL_FLOWLABELEDCONTROL_FLOW
+// Original: | LABELS
+| CONTROL_FLOWLABELSCONTROL_FLOW
+// Original: | LAST
+| CONTROL_FLOWLASTCONTROL_FLOW
+// Original: | NFC
+| CONTROL_FLOWNFCCONTROL_FLOW
+// Original: | NFD
+| CONTROL_FLOWNFDCONTROL_FLOW
+// Original: | NFKC
+| CONTROL_FLOWNFKCCONTROL_FLOW
+// Original: | NFKD
+| CONTROL_FLOWNFKDCONTROL_FLOW
+// Original: | NO
+| CONTROL_FLOWNOCONTROL_FLOW
+// Original: | NODE
+| CONTROL_FLOWNODECONTROL_FLOW
+// Original: | NORMALIZED
+| CONTROL_FLOWNORMALIZEDCONTROL_FLOW
+// Original: | ONLY
+| CONTROL_FLOWONLYCONTROL_FLOW
+// Original: | ORDINALITY
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | PROPERTY
+| CONTROL_FLOWPROPERTYCONTROL_FLOW
+// Original: | READ
+| CONTROL_FLOWREADCONTROL_FLOW
+// Original: | RELATIONSHIP
+| CONTROL_FLOWRELATIONSHIPCONTROL_FLOW
+// Original: | RELATIONSHIPS
+| CONTROL_FLOWRELATIONSHIPSCONTROL_FLOW
+// Original: | REPEATABLE
+| CONTROL_FLOWREPEATABLECONTROL_FLOW
+// Original: | SHORTEST
+| CONTROL_FLOWSHORTESTCONTROL_FLOW
+// Original: | SIMPLE
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | SOURCE
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | TABLE
+| CONTROL_FLOWTABLECONTROL_FLOW
+// Original: | TEMP
+| CONTROL_FLOWTEMPCONTROL_FLOW
+// Original: | TO
+// Original: | KEYWORD
+| CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: | TRAIL
+| CONTROL_FLOWTRAILCONTROL_FLOW
+// Original: | TRANSACTION
+| CONTROL_FLOWTRANSACTIONCONTROL_FLOW
+// Original: | TYPE
+| CONTROL_FLOWTYPECONTROL_FLOW
+// Original: | UNDIRECTED
+| CONTROL_FLOWUNDIRECTEDCONTROL_FLOW
+// Original: | VERTEX
+| CONTROL_FLOWVERTEXCONTROL_FLOW
+// Original: | WALK
+| CONTROL_FLOWWALKCONTROL_FLOW
+// Original: | WITHOUT
+| CONTROL_FLOWWITHOUTCONTROL_FLOW
+// Original: | WRITE
+| CONTROL_FLOWWRITECONTROL_FLOW
+// Original: | ZONE
+| CONTROL_FLOWZONECONTROL_FLOW
+;
+
+// Original: BOOLEAN_LITERAL
+CONTROL_FLOWBOOLEAN_LITERALCONTROL_FLOW
+// Original: : 'TRUE'
+: 'LITERAL'
+// Original: | 'FALSE'
+| 'LITERAL'
+| 'UNKNOWN'
+;
+
+// Original: SINGLE_QUOTED_CHARACTER_SEQUENCE
+CONTROL_FLOWSINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: : NO_ESCAPE? UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
+: CONTROL_FLOWNO_ESCAPECONTROL_FLOW? CONTROL_FLOWUNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: DOUBLE_QUOTED_CHARACTER_SEQUENCE
+CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: : NO_ESCAPE? UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
+: CONTROL_FLOWNO_ESCAPECONTROL_FLOW? CONTROL_FLOWUNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: ACCENT_QUOTED_CHARACTER_SEQUENCE
+CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: :NO_ESCAPE? UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
+:CONTROL_FLOWNO_ESCAPECONTROL_FLOW? CONTROL_FLOWUNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: NO_ESCAPE
+CONTROL_FLOWNO_ESCAPECONTROL_FLOW
+// Original: : COMMERCIAL_AT
+: CONTROL_FLOWCOMMERCIAL_ATCONTROL_FLOW
+;
+
+// Original: fragment UNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCE
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNBROKEN_SINGLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: : QUOTE SINGLE_QUOTED_CHARACTER_REPRESENTATION* QUOTE
+: CONTROL_FLOWQUOTECONTROL_FLOW CONTROL_FLOWSINGLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW* CONTROL_FLOWQUOTECONTROL_FLOW
+;
+
+// Original: fragment UNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCE
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNBROKEN_DOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: : DOUBLE_QUOTE DOUBLE_QUOTED_CHARACTER_REPRESENTATION* DOUBLE_QUOTE
+: CONTROL_FLOWDOUBLE_QUOTECONTROL_FLOW CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW* CONTROL_FLOWDOUBLE_QUOTECONTROL_FLOW
+;
+
+// Original: fragment UNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCE
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNBROKEN_ACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: : GRAVE_ACCENT ACCENT_QUOTED_CHARACTER_REPRESENTATION* GRAVE_ACCENT
+: CONTROL_FLOWGRAVE_ACCENTCONTROL_FLOW CONTROL_FLOWACCENT_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW* CONTROL_FLOWGRAVE_ACCENTCONTROL_FLOW
+;
+
+// Original: fragment SINGLE_QUOTED_CHARACTER_REPRESENTATION:
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSINGLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW:
+(ESCAPED_CHARACTER | ~['\\\r\n])+
+;
+
+// Original: fragment DOUBLE_QUOTED_CHARACTER_REPRESENTATION:
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW:
+(ESCAPED_CHARACTER | ~["\\\r\n])+
+;
+
+// Original: fragment ACCENT_QUOTED_CHARACTER_REPRESENTATION:
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWACCENT_QUOTED_CHARACTER_REPRESENTATIONCONTROL_FLOW:
+(ESCAPED_CHARACTER | ~[`\\\r\n])+
+;
+
+// Original: fragment ESCAPED_CHARACTER
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_CHARACTERCONTROL_FLOW
+// Original: : ESCAPED_REVERSE_SOLIDUS
+: CONTROL_FLOWESCAPED_REVERSE_SOLIDUSCONTROL_FLOW
+// Original: | ESCAPED_QUOTE
+| CONTROL_FLOWESCAPED_QUOTECONTROL_FLOW
+// Original: | ESCAPED_DOUBLE_QUOTE
+| CONTROL_FLOWESCAPED_DOUBLE_QUOTECONTROL_FLOW
+// Original: | ESCAPED_GRAVE_ACCENT
+| CONTROL_FLOWESCAPED_GRAVE_ACCENTCONTROL_FLOW
+// Original: | ESCAPED_TAB
+| CONTROL_FLOWESCAPED_TABCONTROL_FLOW
+// Original: | ESCAPED_BACKSPACE
+| CONTROL_FLOWESCAPED_BACKSPACECONTROL_FLOW
+// Original: | ESCAPED_NEW_LINE
+| CONTROL_FLOWESCAPED_NEW_LINECONTROL_FLOW
+// Original: | ESCAPED_CARRIAGE_RETURN
+| CONTROL_FLOWESCAPED_CARRIAGE_RETURNCONTROL_FLOW
+// Original: | ESCAPED_FORM_FEED
+| CONTROL_FLOWESCAPED_FORM_FEEDCONTROL_FLOW
+// Original: | ESCAPED_UNICODE4_DIGIT_VALUE
+| CONTROL_FLOWESCAPED_UNICODE4_DIGIT_VALUECONTROL_FLOW
+// Original: | ESCAPED_UNICODE6_DIGIT_VALUE
+| CONTROL_FLOWESCAPED_UNICODE6_DIGIT_VALUECONTROL_FLOW
+;
+
+// Original: fragment ESCAPED_REVERSE_SOLIDUS: REVERSE_SOLIDUS REVERSE_SOLIDUS;
+// Original: fragment ESCAPED_REVERSE_SOLIDUS: PUNCTUATION_OPERATOR PUNCTUATION_OPERATOR;
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_REVERSE_SOLIDUSCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW;
+// Original: fragment ESCAPED_QUOTE: REVERSE_SOLIDUS QUOTE;
+// Original: fragment ESCAPED_QUOTE: PUNCTUATION_OPERATOR QUOTE;
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_QUOTECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWQUOTECONTROL_FLOW;
+// Original: fragment ESCAPED_DOUBLE_QUOTE: REVERSE_SOLIDUS DOUBLE_QUOTE;
+// Original: fragment ESCAPED_DOUBLE_QUOTE: PUNCTUATION_OPERATOR DOUBLE_QUOTE;
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_DOUBLE_QUOTECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWDOUBLE_QUOTECONTROL_FLOW;
+// Original: fragment ESCAPED_GRAVE_ACCENT: REVERSE_SOLIDUS GRAVE_ACCENT;
+// Original: fragment ESCAPED_GRAVE_ACCENT: PUNCTUATION_OPERATOR GRAVE_ACCENT;
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_GRAVE_ACCENTCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWGRAVE_ACCENTCONTROL_FLOW;
+// Original: fragment ESCAPED_TAB: REVERSE_SOLIDUS 't';
+// Original: fragment ESCAPED_TAB: PUNCTUATION_OPERATOR 't';
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_TABCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWtCONTROL_FLOW';
+// Original: fragment ESCAPED_BACKSPACE: REVERSE_SOLIDUS 'b';
+// Original: fragment ESCAPED_BACKSPACE: PUNCTUATION_OPERATOR 'b';
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_BACKSPACECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWbCONTROL_FLOW';
+// Original: fragment ESCAPED_NEW_LINE: REVERSE_SOLIDUS 'n';
+// Original: fragment ESCAPED_NEW_LINE: PUNCTUATION_OPERATOR 'n';
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_NEW_LINECONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWnCONTROL_FLOW';
+// Original: fragment ESCAPED_CARRIAGE_RETURN: REVERSE_SOLIDUS 'r';
+// Original: fragment ESCAPED_CARRIAGE_RETURN: PUNCTUATION_OPERATOR 'r';
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_CARRIAGE_RETURNCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWrCONTROL_FLOW';
+// Original: fragment ESCAPED_FORM_FEED: REVERSE_SOLIDUS 'f';
+// Original: fragment ESCAPED_FORM_FEED: PUNCTUATION_OPERATOR 'f';
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_FORM_FEEDCONTROL_FLOW: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWfCONTROL_FLOW';
+// Original: fragment ESCAPED_UNICODE4_DIGIT_VALUE:
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_UNICODE4_DIGIT_VALUECONTROL_FLOW:
+// Original: REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+// Original: PUNCTUATION_OPERATOR 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWuCONTROL_FLOW' CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW;
+// Original: fragment ESCAPED_UNICODE6_DIGIT_VALUE:
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWESCAPED_UNICODE6_DIGIT_VALUECONTROL_FLOW:
+// Original: REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+// Original: PUNCTUATION_OPERATOR 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW 'CONTROL_FLOWuCONTROL_FLOW' CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW;
+
+// Todo: Finish this. It is tricky how it interacts with <separator>
+// Original: BYTE_STRING_LITERAL
+CONTROL_FLOWBYTE_STRING_LITERALCONTROL_FLOW
+// Original: : 'X' QUOTE SPACE* (HEX_DIGIT SPACE* HEX_DIGIT SPACE*)* QUOTE
+: 'CONTROL_FLOWXCONTROL_FLOW' CONTROL_FLOWQUOTECONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW* (CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW* CONTROL_FLOWHEX_DIGITCONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW*)* CONTROL_FLOWQUOTECONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION EXACT_NUMBER_SUFFIX
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION APPROXIMATE_NUMBER_SUFFIX
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION EXACT_NUMBER_SUFFIX
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION APPROXIMATE_NUMBER_SUFFIX
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_INTEGER EXACT_NUMBER_SUFFIX
+// Original: : DATA_TYPE EXACT_NUMBER_SUFFIX
+: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
+CONTROL_FLOWUNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_INTEGER APPROXIMATE_NUMBER_SUFFIX
+// Original: : DATA_TYPE APPROXIMATE_NUMBER_SUFFIX
+: CONTROL_FLOWDATA_TYPECONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+;
+
+// Original: UNSIGNED_DECIMAL_INTEGER
+// Original: DATA_TYPE
+CONTROL_FLOWDATA_TYPECONTROL_FLOW
+// Original: : DIGIT (UNDERSCORE? DIGIT)*
+: DIGIT (PUNCTUATION_OPERATOR? DIGIT)*
+;
+
+// Original: fragment EXACT_NUMBER_SUFFIX
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWEXACT_NUMBER_SUFFIXCONTROL_FLOW
+: 'M'
+;
+
+// Original: fragment UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATIONCONTROL_FLOW
+// Original: : MANTISSA 'E' EXPONENT
+: CONTROL_FLOWMANTISSACONTROL_FLOW 'CONTROL_FLOWECONTROL_FLOW' CONTROL_FLOWEXPONENTCONTROL_FLOW
+;
+
+// Original: fragment MANTISSA
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWMANTISSACONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_IN_COMMON_NOTATION
+: CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW
+// Original: | UNSIGNED_DECIMAL_INTEGER
+// Original: | DATA_TYPE
+| CONTROL_FLOWDATA_TYPECONTROL_FLOW
+;
+
+// Original: fragment EXPONENT
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWEXPONENTCONTROL_FLOW
+// Original: : SIGNED_DECIMAL_INTEGER
+: CONTROL_FLOWSIGNED_DECIMAL_INTEGERCONTROL_FLOW
+;
+
+// Original: fragment UNSIGNED_DECIMAL_IN_COMMON_NOTATION
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUNSIGNED_DECIMAL_IN_COMMON_NOTATIONCONTROL_FLOW
+// Original: : UNSIGNED_DECIMAL_INTEGER (PERIOD UNSIGNED_DECIMAL_INTEGER?)
+// Original: : DATA_TYPE (PERIOD DATA_TYPE?)
+: DATA_TYPE (PUNCTUATION_OPERATOR DATA_TYPE?)
+// Original: | PERIOD UNSIGNED_DECIMAL_INTEGER
+// Original: | PERIOD DATA_TYPE
+| CONTROL_FLOWPERIODCONTROL_FLOW CONTROL_FLOWDATA_TYPECONTROL_FLOW
+;
+
+// Original: fragment SIGNED_DECIMAL_INTEGER
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSIGNED_DECIMAL_INTEGERCONTROL_FLOW
+// Original: : (PLUS_SIGN | MINUS_SIGN)? UNSIGNED_DECIMAL_INTEGER
+// Original: : (PLUS_SIGN | MINUS_SIGN)? DATA_TYPE
+: (CONTROL_FLOWPLUS_SIGNCONTROL_FLOW | CONTROL_FLOWMINUS_SIGNCONTROL_FLOW)? CONTROL_FLOWDATA_TYPECONTROL_FLOW
+;
+
+// Original: UNSIGNED_HEXADECIMAL_INTEGER
+CONTROL_FLOWUNSIGNED_HEXADECIMAL_INTEGERCONTROL_FLOW
+: '0x' ('_'? HEX_DIGIT)+
+;
+
+// Original: UNSIGNED_OCTAL_INTEGER
+// Original: DATA_TYPE
+CONTROL_FLOWDATA_TYPECONTROL_FLOW
+: '0o' ('_'? OCTAL_DIGIT)+
+;
+
+// Original: UNSIGNED_BINARY_INTEGER
+CONTROL_FLOWUNSIGNED_BINARY_INTEGERCONTROL_FLOW
+: '0b' ('_'? BINARY_DIGIT)+
+;
+
+// Original: fragment APPROXIMATE_NUMBER_SUFFIX
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWAPPROXIMATE_NUMBER_SUFFIXCONTROL_FLOW
+: 'F'
+| 'D'
+;
+
+// 21.3 <token>, <separator>, and <identifier>
+
+// Original: // Reserved words
+// CONTROL_FLOWReservedCONTROL_FLOW CONTROL_FLOWwordsCONTROL_FLOW
+ABS: 'ABS';
+ACOS: 'ACOS';
+ALL: 'ALL';
+ALL_DIFFERENT: 'ALL_DIFFERENT';
+AND: 'AND';
+ANY: 'ANY';
+ARRAY: 'ARRAY';
+AS: 'AS';
+ASC: 'ASC';
+ASCENDING: 'ASCENDING';
+ASIN: 'ASIN';
+AT: 'AT';
+ATAN: 'ATAN';
+AVG: 'AVG';
+BIG: 'BIG';
+BIGINT: 'BIGINT';
+BINARY: 'BINARY';
+BOOL: 'BOOL';
+BOOLEAN: 'BOOLEAN';
+BOTH: 'BOTH';
+BTRIM: 'BTRIM';
+BY: 'BY';
+BYTE_LENGTH: 'BYTE_LENGTH';
+BYTES: 'BYTES';
+CALL: 'CALL';
+CARDINALITY: 'CARDINALITY';
+CASE: 'CASE';
+CAST: 'CAST';
+CEIL: 'CEIL';
+CEILING: 'CEILING';
+CHAR: 'CHAR';
+CHAR_LENGTH: 'CHAR_LENGTH';
+CHARACTER_LENGTH: 'CHARACTER_LENGTH';
+CHARACTERISTICS: 'CHARACTERISTICS';
+CLOSE: 'CLOSE';
+COALESCE: 'COALESCE';
+COLLECT_LIST: 'COLLECT_LIST';
+COMMIT: 'COMMIT';
+COPY: 'COPY';
+COS: 'COS';
+COSH: 'COSH';
+COT: 'COT';
+COUNT: 'COUNT';
+CREATE: 'CREATE';
+CURRENT_DATE: 'CURRENT_DATE';
+CURRENT_GRAPH: 'CURRENT_GRAPH';
+CURRENT_PROPERTY_GRAPH: 'CURRENT_PROPERTY_GRAPH';
+CURRENT_SCHEMA: 'CURRENT_SCHEMA';
+CURRENT_TIME: 'CURRENT_TIME';
+CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
+DATE: 'DATE';
+DATETIME: 'DATETIME';
+DAY: 'DAY';
+DEC: 'DEC';
+DECIMAL: 'DECIMAL';
+DEGREES: 'DEGREES';
+DELETE: 'DELETE';
+DESC: 'DESC';
+DESCENDING: 'DESCENDING';
+DETACH: 'DETACH';
+DISTINCT: 'DISTINCT';
+DOUBLE: 'DOUBLE';
+DROP: 'DROP';
+DURATION: 'DURATION';
+DURATION_BETWEEN: 'DURATION_BETWEEN';
+ELEMENT_ID: 'ELEMENT_ID';
+ELSE: 'ELSE';
+END: 'END';
+EXCEPT: 'EXCEPT';
+EXISTS: 'EXISTS';
+EXP: 'EXP';
+FILTER: 'FILTER';
+FINISH: 'FINISH';
+FLOAT: 'FLOAT';
+FLOAT16: 'FLOAT16';
+FLOAT32: 'FLOAT32';
+FLOAT64: 'FLOAT64';
+FLOAT128: 'FLOAT128';
+FLOAT256: 'FLOAT256';
+FLOOR: 'FLOOR';
+FOR: 'FOR';
+FROM: 'FROM';
+GROUP: 'GROUP';
+HAVING: 'HAVING';
+HOME_GRAPH: 'HOME_GRAPH';
+HOME_PROPERTY_GRAPH: 'HOME_PROPERTY_GRAPH';
+HOME_SCHEMA: 'HOME_SCHEMA';
+HOUR: 'HOUR';
+IF: 'IF';
+IN: 'IN';
+INSERT: 'INSERT';
+INT: 'INT';
+INTEGER: 'INTEGER';
+INT8: 'INT8';
+INTEGER8: 'INTEGER8';
+INT16: 'INT16';
+INTEGER16: 'INTEGER16';
+INT32: 'INT32';
+INTEGER32: 'INTEGER32';
+INT64: 'INT64';
+INTEGER64: 'INTEGER64';
+INT128: 'INT128';
+INTEGER128: 'INTEGER128';
+INT256: 'INT256';
+INTEGER256: 'INTEGER256';
+INTERSECT: 'INTERSECT';
+INTERVAL: 'INTERVAL';
+IS: 'IS';
+LEADING: 'LEADING';
+LEFT: 'LEFT';
+LET: 'LET';
+LIKE: 'LIKE';
+LIMIT: 'LIMIT';
+LIST: 'LIST';
+LN: 'LN';
+LOCAL: 'LOCAL';
+LOCAL_DATETIME: 'LOCAL_DATETIME';
+LOCAL_TIME: 'LOCAL_TIME';
+LOCAL_TIMESTAMP: 'LOCAL_TIMESTAMP';
+LOG: 'LOG';
+LOG10: 'LOG10';
+LOWER: 'LOWER';
+LTRIM: 'LTRIM';
+MATCH: 'MATCH';
+MAX: 'MAX';
+MIN: 'MIN';
+MINUTE: 'MINUTE';
+MOD: 'MOD';
+MONTH: 'MONTH';
+NEXT: 'NEXT';
+NODETACH: 'NODETACH';
+NORMALIZE: 'NORMALIZE';
+NOT: 'NOT';
+NOTHING: 'NOTHING';
+NULL: 'NULL';
+NULLS: 'NULLS';
+NULLIF: 'NULLIF';
+OCTET_LENGTH: 'OCTET_LENGTH';
+OF: 'OF';
+OFFSET: 'OFFSET';
+OPTIONAL: 'OPTIONAL';
+OR: 'OR';
+ORDER: 'ORDER';
+OTHERWISE: 'OTHERWISE';
+PARAMETER: 'PARAMETER';
+PARAMETERS: 'PARAMETERS';
+PATH: 'PATH';
+PATH_LENGTH: 'PATH_LENGTH';
+PATHS: 'PATHS';
+PERCENTILE_CONT: 'PERCENTILE_CONT';
+PERCENTILE_DISC: 'PERCENTILE_DISC';
+POWER: 'POWER';
+PRECISION: 'PRECISION';
+PROPERTY_EXISTS: 'PROPERTY_EXISTS';
+RADIANS: 'RADIANS';
+REAL: 'REAL';
+RECORD: 'RECORD';
+REMOVE: 'REMOVE';
+REPLACE: 'REPLACE';
+RESET: 'RESET';
+RETURN: 'RETURN';
+RIGHT: 'RIGHT';
+ROLLBACK: 'ROLLBACK';
+RTRIM: 'RTRIM';
+SAME: 'SAME';
+SCHEMA: 'SCHEMA';
+SECOND: 'SECOND';
+SELECT: 'SELECT';
+SESSION: 'SESSION';
+SESSION_USER: 'SESSION_USER';
+SET: 'SET';
+SIGNED: 'SIGNED';
+SIN: 'SIN';
+SINH: 'SINH';
+SIZE: 'SIZE';
+SKIP_RESERVED_WORD: 'SKIP';
+SMALL: 'SMALL';
+SMALLINT: 'SMALLINT';
+SQRT: 'SQRT';
+START: 'START';
+STDDEV_POP: 'STDDEV_POP';
+STDDEV_SAMP: 'STDDEV_SAMP';
+STRING: 'STRING';
+SUM: 'SUM';
+TAN: 'TAN';
+TANH: 'TANH';
+THEN: 'THEN';
+TIME: 'TIME';
+TIMESTAMP: 'TIMESTAMP';
+TRAILING: 'TRAILING';
+TRIM: 'TRIM';
+TYPED: 'TYPED';
+UBIGINT: 'UBIGINT';
+UINT: 'UINT';
+UINT8: 'UINT8';
+UINT16: 'UINT16';
+UINT32: 'UINT32';
+UINT64: 'UINT64';
+UINT128: 'UINT128';
+UINT256: 'UINT256';
+UNION: 'UNION';
+UNSIGNED: 'UNSIGNED';
+UPPER: 'UPPER';
+USE: 'USE';
+USMALLINT: 'USMALLINT';
+VALUE: 'VALUE';
+VARBINARY: 'VARBINARY';
+VARCHAR: 'VARCHAR';
+VARIABLE: 'VARIABLE';
+WHEN: 'WHEN';
+WHERE: 'WHERE';
+WITH: 'WITH';
+XOR: 'XOR';
+YEAR: 'YEAR';
+YIELD: 'YIELD';
+ZONED: 'ZONED';
+ZONED_DATETIME: 'ZONED_DATETIME';
+ZONED_TIME: 'ZONED_TIME';
+
+// Original: // Prereserved words
+// CONTROL_FLOWPrereservedCONTROL_FLOW CONTROL_FLOWwordsCONTROL_FLOW
+ABSTRACT: 'ABSTRACT';
+AGGREGATE: 'AGGREGATE';
+AGGREGATES: 'AGGREGATES';
+ALTER: 'ALTER';
+CATALOG: 'CATALOG';
+CLEAR: 'CLEAR';
+CLONE: 'CLONE';
+CONSTRAINT: 'CONSTRAINT';
+CURRENT_ROLE: 'CURRENT_ROLE';
+CURRENT_USER: 'CURRENT_USER';
+DATA: 'DATA';
+DIRECTORY: 'DIRECTORY';
+DRYRUN: 'DRYRUN';
+EXACT: 'EXACT';
+EXISTING: 'EXISTING';
+FUNCTION: 'FUNCTION';
+GQLSTATUS: 'GQLSTATUS';
+GRANT: 'GRANT';
+INSTANT: 'INSTANT';
+INFINITY: 'INFINITY';
+NUMBER: 'NUMBER';
+NUMERIC: 'NUMERIC';
+ON: 'ON';
+OPEN: 'OPEN';
+PARTITION: 'PARTITION';
+PROCEDURE: 'PROCEDURE';
+PRODUCT: 'PRODUCT';
+PROJECT: 'PROJECT';
+QUERY: 'QUERY';
+RECORDS: 'RECORDS';
+REFERENCE: 'REFERENCE';
+RENAME: 'RENAME';
+REVOKE: 'REVOKE';
+SUBSTRING: 'SUBSTRING';
+SYSTEM_USER: 'SYSTEM_USER';
+TEMPORAL: 'TEMPORAL';
+UNIQUE: 'UNIQUE';
+UNIT: 'UNIT';
+VALUES: 'VALUES';
+
+// Original: // Nonreserved words
+// CONTROL_FLOWNonreservedCONTROL_FLOW CONTROL_FLOWwordsCONTROL_FLOW
+ACYCLIC: 'ACYCLIC';
+BINDING: 'BINDING';
+BINDINGS: 'BINDINGS';
+CONNECTING: 'CONNECTING';
+DESTINATION: 'DESTINATION';
+DIFFERENT: 'DIFFERENT';
+DIRECTED: 'DIRECTED';
+EDGE: 'EDGE';
+EDGES: 'EDGES';
+ELEMENT: 'ELEMENT';
+ELEMENTS: 'ELEMENTS';
+FIRST: 'FIRST';
+GRAPH: 'GRAPH';
+GROUPS: 'GROUPS';
+KEEP: 'KEEP';
+LABEL: 'LABEL';
+LABELED: 'LABELED';
+LABELS: 'LABELS';
+LAST: 'LAST';
+NFC: 'NFC';
+NFD: 'NFD';
+NFKC: 'NFKC';
+NFKD: 'NFKD';
+NO: 'NO';
+NODE: 'NODE';
+NORMALIZED: 'NORMALIZED';
+ONLY: 'ONLY';
+ORDINALITY: 'ORDINALITY';
+PROPERTY: 'PROPERTY';
+READ: 'READ';
+RELATIONSHIP: 'RELATIONSHIP';
+RELATIONSHIPS: 'RELATIONSHIPS';
+REPEATABLE: 'REPEATABLE';
+SHORTEST: 'SHORTEST';
+SIMPLE: 'SIMPLE';
+SOURCE: 'SOURCE';
+TABLE: 'TABLE';
+TEMP: 'TEMP';
+TO: 'TO';
+TRAIL: 'TRAIL';
+TRANSACTION: 'TRANSACTION';
+TYPE: 'TYPE';
+UNDIRECTED: 'UNDIRECTED';
+VERTEX: 'VERTEX';
+WALK: 'WALK';
+WITHOUT: 'WITHOUT';
+WRITE: 'WRITE';
+ZONE: 'ZONE';
+
+// Original: fragment SEPARATED_IDENTIFIER
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSEPARATED_IDENTIFIERCONTROL_FLOW
+// Original: : DELIMITED_IDENTIFIER
+: CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
+// Original: | EXTENDED_IDENTIFIER
+| CONTROL_FLOWEXTENDED_IDENTIFIERCONTROL_FLOW
+;
+
+// Original: REGULAR_IDENTIFIER
+CONTROL_FLOWREGULAR_IDENTIFIERCONTROL_FLOW
+: IDENTIFIER_START IDENTIFIER_EXTEND*
+;
+
+// Original: fragment EXTENDED_IDENTIFIER
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWEXTENDED_IDENTIFIERCONTROL_FLOW
+: IDENTIFIER_EXTEND+
+;
+
+// Original: fragment DELIMITED_IDENTIFIER
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWDELIMITED_IDENTIFIERCONTROL_FLOW
+// Original: : DOUBLE_QUOTED_CHARACTER_SEQUENCE
+: CONTROL_FLOWDOUBLE_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+// Original: | ACCENT_QUOTED_CHARACTER_SEQUENCE
+| CONTROL_FLOWACCENT_QUOTED_CHARACTER_SEQUENCECONTROL_FLOW
+;
+
+// Original: SUBSTITUTED_PARAMETER_REFERENCE
+CONTROL_FLOWSUBSTITUTED_PARAMETER_REFERENCECONTROL_FLOW
+// Original: : DOUBLE_DOLLAR_SIGN PARAMETER_NAME
+// Original: : PUNCTUATION_OPERATOR PARAMETER_NAME
+: CONTROL_FLOWPUNCTUATION_OPERATORCONTROL_FLOW CONTROL_FLOWPARAMETER_NAMECONTROL_FLOW
+;
+
+// Original: GENERAL_PARAMETER_REFERENCE
+CONTROL_FLOWGENERAL_PARAMETER_REFERENCECONTROL_FLOW
+// Original: : DOLLAR_SIGN PARAMETER_NAME
+: CONTROL_FLOWDOLLAR_SIGNCONTROL_FLOW CONTROL_FLOWPARAMETER_NAMECONTROL_FLOW
+;
+
+// Original: fragment IDENTIFIER_START
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWIDENTIFIER_STARTCONTROL_FLOW
+// Original: : ID_Start
+: CONTROL_FLOWID_StartCONTROL_FLOW
+// Original: | Pc
+| CONTROL_FLOWPcCONTROL_FLOW
+;
+
+// Original: fragment IDENTIFIER_EXTEND
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWIDENTIFIER_EXTENDCONTROL_FLOW
+// Original: : ID_Continue
+: CONTROL_FLOWID_ContinueCONTROL_FLOW
+;
+
+// Original: fragment ID_Start
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWID_StartCONTROL_FLOW
+: [\p{ID_Start}]
+;
+
+// Original: fragment ID_Continue
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWID_ContinueCONTROL_FLOW
+: [\p{ID_Continue}]
+;
+
+MULTISET_ALTERNATION_OPERATOR: '|+|';
+
+BRACKET_RIGHT_ARROW: ']->';
+BRACKET_TILDE_RIGHT_ARROW: ']~>';
+CONCATENATION_OPERATOR: '||';
+DOUBLE_COLON: '::';
+DOUBLE_DOLLAR_SIGN: '$$';
+DOUBLE_PERIOD: '..';
+GREATER_THAN_OR_EQUALS_OPERATOR: '>=';
+LEFT_ARROW: '<-';
+LEFT_ARROW_TILDE: '<~';
+LEFT_ARROW_BRACKET: '<-[';
+LEFT_ARROW_TILDE_BRACKET: '<~[';
+LEFT_MINUS_RIGHT: '<->';
+LEFT_MINUS_SLASH: '<-/';
+LEFT_TILDE_SLASH: '<~/';
+LESS_THAN_OR_EQUALS_OPERATOR: '<=';
+MINUS_LEFT_BRACKET: '-[';
+MINUS_SLASH: '-/';
+NOT_EQUALS_OPERATOR: '<>';
+RIGHT_ARROW: '->';
+RIGHT_BRACKET_MINUS: ']-';
+RIGHT_BRACKET_TILDE: ']~';
+RIGHT_DOUBLE_ARROW: '=>';
+SLASH_MINUS: '/-';
+SLASH_MINUS_RIGHT: '/->';
+SLASH_TILDE: '/~';
+SLASH_TILDE_RIGHT: '/~>';
+TILDE_LEFT_BRACKET: '~[';
+TILDE_RIGHT_ARROW: '~>';
+TILDE_SLASH: '~/';
+
+// Original: // 21.4 GQL terminal characters
+// CONTROL_FLOW21CONTROL_FLOW.CONTROL_FLOW4CONTROL_FLOW CONTROL_FLOWGQLCONTROL_FLOW CONTROL_FLOWterminalCONTROL_FLOW CONTROL_FLOWcharactersCONTROL_FLOW
+
+AMPERSAND: '&';
+ASTERISK: '*';
+COLON: ':';
+COMMA: ',';
+COMMERCIAL_AT: '@';
+DOLLAR_SIGN: '$';
+DOUBLE_QUOTE: '"';
+EQUALS_OPERATOR: '=';
+EXCLAMATION_MARK: '!';
+RIGHT_ANGLE_BRACKET: '>';
+GRAVE_ACCENT: '`';
+LEFT_BRACE: '{';
+LEFT_BRACKET: '[';
+LEFT_PAREN: '(';
+LEFT_ANGLE_BRACKET: '<';
+MINUS_SIGN: '-';
+PERCENT: '%';
+PERIOD: '.';
+PLUS_SIGN: '+';
+QUESTION_MARK: '?';
+QUOTE: '\'';
+REVERSE_SOLIDUS: '\\';
+RIGHT_BRACE: '}';
+RIGHT_BRACKET: ']';
+RIGHT_PAREN: ')';
+SOLIDUS: '/';
+TILDE: '~';
+UNDERSCORE: '_';
+VERTICAL_BAR: '|';
+
+// Original: fragment HEX_DIGIT
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWHEX_DIGITCONTROL_FLOW
+: [0-9a-f]
+;
+
+// Original: fragment DIGIT
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWDIGITCONTROL_FLOW
+: [0-9]
+;
+
+// Original: fragment OCTAL_DIGIT
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWOCTAL_DIGITCONTROL_FLOW
+: [0-7]
+;
+
+// Original: fragment BINARY_DIGIT
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWBINARY_DIGITCONTROL_FLOW
+: [0-1]
+;
+
+// Original: SP
+// Original: KEYWORD
+CONTROL_FLOWKEYWORDCONTROL_FLOW
+// Original: : (WHITESPACE)+
+: (KEYWORD)+
+-> channel(HIDDEN)
+;
+
+// Original: WHITESPACE
+CONTROL_FLOWWHITESPACECONTROL_FLOW
+// Original: : SPACE
+: CONTROL_FLOWSPACECONTROL_FLOW
+// Original: | TAB
+| CONTROL_FLOWTABCONTROL_FLOW
+// Original: | LF
+| CONTROL_FLOWLFCONTROL_FLOW
+// Original: | VT
+| CONTROL_FLOWVTCONTROL_FLOW
+// Original: | FF
+| CONTROL_FLOWFFCONTROL_FLOW
+// Original: | CR
+| CONTROL_FLOWCRCONTROL_FLOW
+// Original: | FS
+| CONTROL_FLOWFSCONTROL_FLOW
+// Original: | GS
+| CONTROL_FLOWGSCONTROL_FLOW
+// Original: | RS
+| CONTROL_FLOWRSCONTROL_FLOW
+// Original: | US
+| CONTROL_FLOWUSCONTROL_FLOW
+| '\u1680'
+| '\u180e'
+| '\u2000'
+| '\u2001'
+| '\u2002'
+| '\u2003'
+| '\u2004'
+| '\u2005'
+| '\u2006'
+| '\u2008'
+| '\u2009'
+| '\u200a'
+| '\u2028'
+| '\u2029'
+| '\u205f'
+| '\u3000'
+| '\u00a0'
+| '\u2007'
+| '\u202f'
+;
+
+BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
+
+SIMPLE_COMMENT_SOLIDUS: '//' ~[\r\n]* -> channel(HIDDEN);
+
+SIMPLE_COMMENT_MINUS: '--' ~[\r\n]* -> channel(HIDDEN);
+
+// Original: fragment GS : [\u001D];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWGSCONTROL_FLOW : [\CONTROL_FLOWu001DCONTROL_FLOW];
+
+// Original: fragment FS : [\u001C];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWFSCONTROL_FLOW : [\CONTROL_FLOWu001CCONTROL_FLOW];
+
+// Original: fragment CR : [\r];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWCRCONTROL_FLOW : [\CONTROL_FLOWrCONTROL_FLOW];
+
+// Original: fragment Sc : [\p{Sc}];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWScCONTROL_FLOW : [\CONTROL_FLOWpCONTROL_FLOW{CONTROL_FLOWScCONTROL_FLOW}];
+
+// Original: fragment SPACE : [ ];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWSPACECONTROL_FLOW : [ ];
+
+// Original: fragment Pc : [\p{Pc}];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWPcCONTROL_FLOW : [\CONTROL_FLOWpCONTROL_FLOW{CONTROL_FLOWPcCONTROL_FLOW}];
+
+// Original: fragment TAB : [\t];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWTABCONTROL_FLOW : [\CONTROL_FLOWtCONTROL_FLOW];
+
+// Original: fragment LF : [\n];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWLFCONTROL_FLOW : [\CONTROL_FLOWnCONTROL_FLOW];
+
+// Original: fragment VT : [\u000B];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWVTCONTROL_FLOW : [\CONTROL_FLOWu000BCONTROL_FLOW];
+
+// Original: fragment US : [\u001F];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWUSCONTROL_FLOW : [\CONTROL_FLOWu001FCONTROL_FLOW];
+
+// Original: fragment FF: [\f];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWFFCONTROL_FLOW: [\CONTROL_FLOWfCONTROL_FLOW];
+
+// Original: fragment RS: [\u001E];
+CONTROL_FLOWfragmentCONTROL_FLOW CONTROL_FLOWRSCONTROL_FLOW: [\CONTROL_FLOWu001ECONTROL_FLOW];
diff --git a/developers/ANTLR/LexBasic.g4 b/developers/ANTLR/LexBasic.g4
new file mode 100644 (file)
index 0000000..761e3db
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * [The "BSD license"]
+ *  Copyright (c) 2014-2015 Gerald Rosenberg
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *  3. The name of the author may not be used to endorse or promote products
+ *     derived from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * A generally reusable set of fragments for import in to Lexer grammars.
+ *
+ *     Modified 2015.06.16 gbr -
+ *     -- generalized for inclusion into the ANTLRv4 grammar distribution
+ *
+ */
+
+// $antlr-format alignTrailingComments on, columnLimit 130, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments off
+// $antlr-format useTab off, allowShortRulesOnASingleLine off, allowShortBlocksOnASingleLine on, alignSemicolons hanging
+// $antlr-format alignColons hanging
+
+lexer grammar LexBasic;
+
+// ======================================================
+// Lexer fragments
+//
+// -----------------------------------
+// Whitespace & Comments
+
+fragment Ws
+    : Hws
+    | Vws
+    ;
+
+fragment Hws
+    : [ \t]
+    ;
+
+fragment Vws
+    : [\r\n\f]
+    ;
+
+fragment BlockComment
+    : '/*' .*? ('*/' | EOF)
+    ;
+
+fragment DocComment
+    : '/**' .*? ('*/' | EOF)
+    ;
+
+fragment LineComment
+    : '//' ~ [\r\n]*
+    ;
+
+// -----------------------------------
+// Escapes
+// Any kind of escaped character that we can embed within ANTLR literal strings.
+
+fragment EscSeq
+    : Esc ([btnfr"'\\] | UnicodeEsc | . | EOF)
+    ;
+
+fragment EscAny
+    : Esc .
+    ;
+
+fragment UnicodeEsc
+    : 'u' (HexDigit (HexDigit (HexDigit HexDigit?)?)?)?
+    ;
+
+// -----------------------------------
+// Numerals
+
+fragment DecimalNumeral
+    : '0'
+    | [1-9] DecDigit*
+    ;
+
+// -----------------------------------
+// Digits
+
+fragment HexDigit
+    : [0-9a-fA-F]
+    ;
+
+fragment DecDigit
+    : [0-9]
+    ;
+
+// -----------------------------------
+// Literals
+
+fragment BoolLiteral
+    : 'true'
+    | 'false'
+    ;
+
+fragment CharLiteral
+    : SQuote (EscSeq | ~ ['\r\n\\]) SQuote
+    ;
+
+fragment SQuoteLiteral
+    : SQuote (EscSeq | ~ ['\r\n\\])* SQuote
+    ;
+
+fragment DQuoteLiteral
+    : DQuote (EscSeq | ~ ["\r\n\\])* DQuote
+    ;
+
+fragment USQuoteLiteral
+    : SQuote (EscSeq | ~ ['\r\n\\])*
+    ;
+
+// -----------------------------------
+// Character ranges
+
+fragment NameChar
+    : NameStartChar
+    | '0' .. '9'
+    | Underscore
+    | '\u00B7'
+    | '\u0300' .. '\u036F'
+    | '\u203F' .. '\u2040'
+    ;
+
+fragment NameStartChar
+    : 'A' .. 'Z'
+    | 'a' .. 'z'
+    | '\u00C0' .. '\u00D6'
+    | '\u00D8' .. '\u00F6'
+    | '\u00F8' .. '\u02FF'
+    | '\u0370' .. '\u037D'
+    | '\u037F' .. '\u1FFF'
+    | '\u200C' .. '\u200D'
+    | '\u2070' .. '\u218F'
+    | '\u2C00' .. '\u2FEF'
+    | '\u3001' .. '\uD7FF'
+    | '\uF900' .. '\uFDCF'
+    | '\uFDF0' .. '\uFFFD'
+    // ignores | ['\u10000-'\uEFFFF]
+    ;
+
+// -----------------------------------
+// Types
+
+fragment Int
+    : 'int'
+    ;
+
+// -----------------------------------
+// Symbols
+
+fragment Esc
+    : '\\'
+    ;
+
+fragment Colon
+    : ':'
+    ;
+
+fragment DColon
+    : '::'
+    ;
+
+fragment SQuote
+    : '\''
+    ;
+
+fragment DQuote
+    : '"'
+    ;
+
+fragment LParen
+    : '('
+    ;
+
+fragment RParen
+    : ')'
+    ;
+
+fragment LBrace
+    : '{'
+    ;
+
+fragment RBrace
+    : '}'
+    ;
+
+fragment LBrack
+    : '['
+    ;
+
+fragment RBrack
+    : ']'
+    ;
+
+fragment RArrow
+    : '->'
+    ;
+
+fragment Lt
+    : '<'
+    ;
+
+fragment Gt
+    : '>'
+    ;
+
+fragment Equal
+    : '='
+    ;
+
+fragment Question
+    : '?'
+    ;
+
+fragment Star
+    : '*'
+    ;
+
+fragment Plus
+    : '+'
+    ;
+
+fragment PlusAssign
+    : '+='
+    ;
+
+fragment Underscore
+    : '_'
+    ;
+
+fragment Pipe
+    : '|'
+    ;
+
+fragment Dollar
+    : '$'
+    ;
+
+fragment Comma
+    : ','
+    ;
+
+fragment Semi
+    : ';'
+    ;
+
+fragment Dot
+    : '.'
+    ;
+
+fragment Range
+    : '..'
+    ;
+
+fragment At
+    : '@'
+    ;
+
+fragment Pound
+    : '#'
+    ;
+
+fragment Tilde
+    : '~'
+    ;
\ No newline at end of file
diff --git a/developers/ANTLR/LexerAdaptor.java b/developers/ANTLR/LexerAdaptor.java
new file mode 100644 (file)
index 0000000..338000e
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ [The "BSD licence"]
+ Copyright (c) 2005-2007 Terence Parr
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+//package org.antlr.parser.antlr4;
+
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.Lexer;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.misc.Interval;
+
+public abstract class LexerAdaptor extends Lexer {
+
+    /**
+     *  Generic type for OPTIONS, TOKENS and CHANNELS
+     */
+    private static final int PREQUEL_CONSTRUCT = -10;
+    private static final int OPTIONS_CONSTRUCT = -11;
+
+    public LexerAdaptor(CharStream input) {
+        super(input);
+    }
+
+    /**
+     * Track whether we are inside of a rule and whether it is lexical parser. _currentRuleType==Token.INVALID_TYPE
+     * means that we are outside of a rule. At the first sign of a rule name reference and _currentRuleType==invalid, we
+     * can assume that we are starting a parser rule. Similarly, seeing a token reference when not already in rule means
+     * starting a token rule. The terminating ';' of a rule, flips this back to invalid type.
+     *
+     * This is not perfect logic but works. For example, "grammar T;" means that we start and stop a lexical rule for
+     * the "T;". Dangerous but works.
+     *
+     * The whole point of this state information is to distinguish between [..arg actions..] and [charsets]. Char sets
+     * can only occur in lexical rules and arg actions cannot occur.
+     */
+    private int _currentRuleType = Token.INVALID_TYPE;
+
+    private boolean insideOptionsBlock = false;
+
+    public int getCurrentRuleType() {
+        return _currentRuleType;
+    }
+
+    public void setCurrentRuleType(int ruleType) {
+        this._currentRuleType = ruleType;
+    }
+
+    protected void handleBeginArgument() {
+        if (inLexerRule()) {
+            pushMode(ANTLRv4Lexer.LexerCharSet);
+            more();
+        } else {
+            pushMode(ANTLRv4Lexer.Argument);
+        }
+    }
+
+    protected void handleEndArgument() {
+        popMode();
+        if (_modeStack.size() > 0) {
+            setType(ANTLRv4Lexer.ARGUMENT_CONTENT);
+        }
+    }
+
+    protected void handleEndAction() {
+        int oldMode = _mode;
+        int newMode = popMode();
+        boolean isActionWithinAction = _modeStack.size() > 0
+            && newMode == ANTLRv4Lexer.TargetLanguageAction
+            && oldMode == newMode;
+
+        if (isActionWithinAction) {
+            setType(ANTLRv4Lexer.ACTION_CONTENT);
+        }
+    }
+
+    @Override
+    public Token emit() {
+        if ((_type == ANTLRv4Lexer.OPTIONS || _type == ANTLRv4Lexer.TOKENS || _type == ANTLRv4Lexer.CHANNELS)
+                && getCurrentRuleType() == Token.INVALID_TYPE) { // enter prequel construct ending with an RBRACE
+            setCurrentRuleType(PREQUEL_CONSTRUCT);
+        } else if (_type == ANTLRv4Lexer.OPTIONS && getCurrentRuleType() == ANTLRv4Lexer.TOKEN_REF)
+        {
+            setCurrentRuleType(OPTIONS_CONSTRUCT);
+        } else if (_type == ANTLRv4Lexer.RBRACE && getCurrentRuleType() == PREQUEL_CONSTRUCT) { // exit prequel construct
+            setCurrentRuleType(Token.INVALID_TYPE);
+        } else if (_type == ANTLRv4Lexer.RBRACE && getCurrentRuleType() == OPTIONS_CONSTRUCT)
+        { // exit options
+            setCurrentRuleType(ANTLRv4Lexer.TOKEN_REF);
+        } else if (_type == ANTLRv4Lexer.AT && getCurrentRuleType() == Token.INVALID_TYPE) { // enter action
+            setCurrentRuleType(ANTLRv4Lexer.AT);
+        } else if (_type == ANTLRv4Lexer.SEMI && getCurrentRuleType() == OPTIONS_CONSTRUCT)
+        { // ';' in options { .... }. Don't change anything.
+        } else if (_type == ANTLRv4Lexer.END_ACTION && getCurrentRuleType() == ANTLRv4Lexer.AT) { // exit action
+            setCurrentRuleType(Token.INVALID_TYPE);
+        } else if (_type == ANTLRv4Lexer.ID) {
+            String firstChar = _input.getText(Interval.of(_tokenStartCharIndex, _tokenStartCharIndex));
+            if (Character.isUpperCase(firstChar.charAt(0))) {
+                _type = ANTLRv4Lexer.TOKEN_REF;
+            } else {
+                _type = ANTLRv4Lexer.RULE_REF;
+            }
+
+            if (getCurrentRuleType() == Token.INVALID_TYPE) { // if outside of rule def
+                setCurrentRuleType(_type); // set to inside lexer or parser rule
+            }
+        } else if (_type == ANTLRv4Lexer.SEMI) { // exit rule def
+            setCurrentRuleType(Token.INVALID_TYPE);
+        }
+
+        return super.emit();
+    }
+
+    private boolean inLexerRule() {
+        return getCurrentRuleType() == ANTLRv4Lexer.TOKEN_REF;
+    }
+
+    @SuppressWarnings("unused")
+    private boolean inParserRule() { // not used, but added for clarity
+        return getCurrentRuleType() == ANTLRv4Lexer.RULE_REF;
+    }
+
+    @Override
+    public void reset() {
+        setCurrentRuleType(Token.INVALID_TYPE);
+        insideOptionsBlock = false;
+        super.reset();
+    }   
+}
diff --git a/developers/ANTLR/lexer_rules.g4 b/developers/ANTLR/lexer_rules.g4
new file mode 100644 (file)
index 0000000..a9925cd
--- /dev/null
@@ -0,0 +1,448 @@
+fragment SINGLE_QUOTED_CHARACTER_REPRESENTATION:
+(ESCAPED_CHARACTER | ~['\\\r\n])+
+;
+fragment DOUBLE_QUOTED_CHARACTER_REPRESENTATION:
+(ESCAPED_CHARACTER | ~["\\\r\n])+
+;
+fragment ACCENT_QUOTED_CHARACTER_REPRESENTATION:
+(ESCAPED_CHARACTER | ~[`\\\r\n])+
+;
+fragment ESCAPED_REVERSE_SOLIDUS: REVERSE_SOLIDUS REVERSE_SOLIDUS;
+fragment ESCAPED_QUOTE: REVERSE_SOLIDUS QUOTE;
+fragment ESCAPED_DOUBLE_QUOTE: REVERSE_SOLIDUS DOUBLE_QUOTE;
+fragment ESCAPED_GRAVE_ACCENT: REVERSE_SOLIDUS GRAVE_ACCENT;
+fragment ESCAPED_TAB: REVERSE_SOLIDUS 't';
+fragment ESCAPED_BACKSPACE: REVERSE_SOLIDUS 'b';
+fragment ESCAPED_NEW_LINE: REVERSE_SOLIDUS 'n';
+fragment ESCAPED_CARRIAGE_RETURN: REVERSE_SOLIDUS 'r';
+fragment ESCAPED_FORM_FEED: REVERSE_SOLIDUS 'f';
+fragment ESCAPED_UNICODE4_DIGIT_VALUE:
+REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+fragment ESCAPED_UNICODE6_DIGIT_VALUE:
+REVERSE_SOLIDUS 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
+: 'X' QUOTE SPACE* (HEX_DIGIT SPACE* HEX_DIGIT SPACE*)* QUOTE
+;
+: DIGIT (UNDERSCORE? DIGIT)*
+;
+: '0x' ('_'? HEX_DIGIT)+
+;
+ABS: 'ABS';
+ACOS: 'ACOS';
+ALL: 'ALL';
+ALL_DIFFERENT: 'ALL_DIFFERENT';
+AND: 'AND';
+ANY: 'ANY';
+ARRAY: 'ARRAY';
+AS: 'AS';
+ASC: 'ASC';
+ASCENDING: 'ASCENDING';
+ASIN: 'ASIN';
+AT: 'AT';
+ATAN: 'ATAN';
+AVG: 'AVG';
+BIG: 'BIG';
+BIGINT: 'BIGINT';
+BINARY: 'BINARY';
+BOOL: 'BOOL';
+BOOLEAN: 'BOOLEAN';
+BOTH: 'BOTH';
+BTRIM: 'BTRIM';
+BY: 'BY';
+BYTE_LENGTH: 'BYTE_LENGTH';
+BYTES: 'BYTES';
+CALL: 'CALL';
+CARDINALITY: 'CARDINALITY';
+CASE: 'CASE';
+CAST: 'CAST';
+CEIL: 'CEIL';
+CEILING: 'CEILING';
+CHAR: 'CHAR';
+CHAR_LENGTH: 'CHAR_LENGTH';
+CHARACTER_LENGTH: 'CHARACTER_LENGTH';
+CHARACTERISTICS: 'CHARACTERISTICS';
+CLOSE: 'CLOSE';
+COALESCE: 'COALESCE';
+COLLECT_LIST: 'COLLECT_LIST';
+COMMIT: 'COMMIT';
+COPY: 'COPY';
+COS: 'COS';
+COSH: 'COSH';
+COT: 'COT';
+COUNT: 'COUNT';
+CREATE: 'CREATE';
+CURRENT_DATE: 'CURRENT_DATE';
+CURRENT_GRAPH: 'CURRENT_GRAPH';
+CURRENT_PROPERTY_GRAPH: 'CURRENT_PROPERTY_GRAPH';
+CURRENT_SCHEMA: 'CURRENT_SCHEMA';
+CURRENT_TIME: 'CURRENT_TIME';
+CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
+DATE: 'DATE';
+DATETIME: 'DATETIME';
+DAY: 'DAY';
+DEC: 'DEC';
+DECIMAL: 'DECIMAL';
+DEGREES: 'DEGREES';
+DELETE: 'DELETE';
+DESC: 'DESC';
+DESCENDING: 'DESCENDING';
+DETACH: 'DETACH';
+DISTINCT: 'DISTINCT';
+DOUBLE: 'DOUBLE';
+DROP: 'DROP';
+DURATION: 'DURATION';
+DURATION_BETWEEN: 'DURATION_BETWEEN';
+ELEMENT_ID: 'ELEMENT_ID';
+ELSE: 'ELSE';
+END: 'END';
+EXCEPT: 'EXCEPT';
+EXISTS: 'EXISTS';
+EXP: 'EXP';
+FILTER: 'FILTER';
+FINISH: 'FINISH';
+FLOAT: 'FLOAT';
+FLOAT16: 'FLOAT16';
+FLOAT32: 'FLOAT32';
+FLOAT64: 'FLOAT64';
+FLOAT128: 'FLOAT128';
+FLOAT256: 'FLOAT256';
+FLOOR: 'FLOOR';
+FOR: 'FOR';
+FROM: 'FROM';
+GROUP: 'GROUP';
+HAVING: 'HAVING';
+HOME_GRAPH: 'HOME_GRAPH';
+HOME_PROPERTY_GRAPH: 'HOME_PROPERTY_GRAPH';
+HOME_SCHEMA: 'HOME_SCHEMA';
+HOUR: 'HOUR';
+IF: 'IF';
+IN: 'IN';
+INSERT: 'INSERT';
+INT: 'INT';
+INTEGER: 'INTEGER';
+INT8: 'INT8';
+INTEGER8: 'INTEGER8';
+INT16: 'INT16';
+INTEGER16: 'INTEGER16';
+INT32: 'INT32';
+INTEGER32: 'INTEGER32';
+INT64: 'INT64';
+INTEGER64: 'INTEGER64';
+INT128: 'INT128';
+INTEGER128: 'INTEGER128';
+INT256: 'INT256';
+INTEGER256: 'INTEGER256';
+INTERSECT: 'INTERSECT';
+INTERVAL: 'INTERVAL';
+IS: 'IS';
+LEADING: 'LEADING';
+LEFT: 'LEFT';
+LET: 'LET';
+LIKE: 'LIKE';
+LIMIT: 'LIMIT';
+LIST: 'LIST';
+LN: 'LN';
+LOCAL: 'LOCAL';
+LOCAL_DATETIME: 'LOCAL_DATETIME';
+LOCAL_TIME: 'LOCAL_TIME';
+LOCAL_TIMESTAMP: 'LOCAL_TIMESTAMP';
+LOG: 'LOG';
+LOG10: 'LOG10';
+LOWER: 'LOWER';
+LTRIM: 'LTRIM';
+MATCH: 'MATCH';
+MAX: 'MAX';
+MIN: 'MIN';
+MINUTE: 'MINUTE';
+MOD: 'MOD';
+MONTH: 'MONTH';
+NEXT: 'NEXT';
+NODETACH: 'NODETACH';
+NORMALIZE: 'NORMALIZE';
+NOT: 'NOT';
+NOTHING: 'NOTHING';
+NULL: 'NULL';
+NULLS: 'NULLS';
+NULLIF: 'NULLIF';
+OCTET_LENGTH: 'OCTET_LENGTH';
+OF: 'OF';
+OFFSET: 'OFFSET';
+OPTIONAL: 'OPTIONAL';
+OR: 'OR';
+ORDER: 'ORDER';
+OTHERWISE: 'OTHERWISE';
+PARAMETER: 'PARAMETER';
+PARAMETERS: 'PARAMETERS';
+PATH: 'PATH';
+PATH_LENGTH: 'PATH_LENGTH';
+PATHS: 'PATHS';
+PERCENTILE_CONT: 'PERCENTILE_CONT';
+PERCENTILE_DISC: 'PERCENTILE_DISC';
+POWER: 'POWER';
+PRECISION: 'PRECISION';
+PROPERTY_EXISTS: 'PROPERTY_EXISTS';
+RADIANS: 'RADIANS';
+REAL: 'REAL';
+RECORD: 'RECORD';
+REMOVE: 'REMOVE';
+REPLACE: 'REPLACE';
+RESET: 'RESET';
+RETURN: 'RETURN';
+RIGHT: 'RIGHT';
+ROLLBACK: 'ROLLBACK';
+RTRIM: 'RTRIM';
+SAME: 'SAME';
+SCHEMA: 'SCHEMA';
+SECOND: 'SECOND';
+SELECT: 'SELECT';
+SESSION: 'SESSION';
+SESSION_USER: 'SESSION_USER';
+SET: 'SET';
+SIGNED: 'SIGNED';
+SIN: 'SIN';
+SINH: 'SINH';
+SIZE: 'SIZE';
+SKIP_RESERVED_WORD: 'SKIP';
+SMALL: 'SMALL';
+SMALLINT: 'SMALLINT';
+SQRT: 'SQRT';
+START: 'START';
+STDDEV_POP: 'STDDEV_POP';
+STDDEV_SAMP: 'STDDEV_SAMP';
+STRING: 'STRING';
+SUM: 'SUM';
+TAN: 'TAN';
+TANH: 'TANH';
+THEN: 'THEN';
+TIME: 'TIME';
+TIMESTAMP: 'TIMESTAMP';
+TRAILING: 'TRAILING';
+TRIM: 'TRIM';
+TYPED: 'TYPED';
+UBIGINT: 'UBIGINT';
+UINT: 'UINT';
+UINT8: 'UINT8';
+UINT16: 'UINT16';
+UINT32: 'UINT32';
+UINT64: 'UINT64';
+UINT128: 'UINT128';
+UINT256: 'UINT256';
+UNION: 'UNION';
+UNSIGNED: 'UNSIGNED';
+UPPER: 'UPPER';
+USE: 'USE';
+USMALLINT: 'USMALLINT';
+VALUE: 'VALUE';
+VARBINARY: 'VARBINARY';
+VARCHAR: 'VARCHAR';
+VARIABLE: 'VARIABLE';
+WHEN: 'WHEN';
+WHERE: 'WHERE';
+WITH: 'WITH';
+XOR: 'XOR';
+YEAR: 'YEAR';
+YIELD: 'YIELD';
+ZONED: 'ZONED';
+ZONED_DATETIME: 'ZONED_DATETIME';
+ZONED_TIME: 'ZONED_TIME';
+ABSTRACT: 'ABSTRACT';
+AGGREGATE: 'AGGREGATE';
+AGGREGATES: 'AGGREGATES';
+ALTER: 'ALTER';
+CATALOG: 'CATALOG';
+CLEAR: 'CLEAR';
+CLONE: 'CLONE';
+CONSTRAINT: 'CONSTRAINT';
+CURRENT_ROLE: 'CURRENT_ROLE';
+CURRENT_USER: 'CURRENT_USER';
+DATA: 'DATA';
+DIRECTORY: 'DIRECTORY';
+DRYRUN: 'DRYRUN';
+EXACT: 'EXACT';
+EXISTING: 'EXISTING';
+FUNCTION: 'FUNCTION';
+GQLSTATUS: 'GQLSTATUS';
+GRANT: 'GRANT';
+INSTANT: 'INSTANT';
+INFINITY: 'INFINITY';
+NUMBER: 'NUMBER';
+NUMERIC: 'NUMERIC';
+ON: 'ON';
+OPEN: 'OPEN';
+PARTITION: 'PARTITION';
+PROCEDURE: 'PROCEDURE';
+PRODUCT: 'PRODUCT';
+PROJECT: 'PROJECT';
+QUERY: 'QUERY';
+RECORDS: 'RECORDS';
+REFERENCE: 'REFERENCE';
+RENAME: 'RENAME';
+REVOKE: 'REVOKE';
+SUBSTRING: 'SUBSTRING';
+SYSTEM_USER: 'SYSTEM_USER';
+TEMPORAL: 'TEMPORAL';
+UNIQUE: 'UNIQUE';
+UNIT: 'UNIT';
+VALUES: 'VALUES';
+ACYCLIC: 'ACYCLIC';
+BINDING: 'BINDING';
+BINDINGS: 'BINDINGS';
+CONNECTING: 'CONNECTING';
+DESTINATION: 'DESTINATION';
+DIFFERENT: 'DIFFERENT';
+DIRECTED: 'DIRECTED';
+EDGE: 'EDGE';
+EDGES: 'EDGES';
+ELEMENT: 'ELEMENT';
+ELEMENTS: 'ELEMENTS';
+FIRST: 'FIRST';
+GRAPH: 'GRAPH';
+GROUPS: 'GROUPS';
+KEEP: 'KEEP';
+LABEL: 'LABEL';
+LABELED: 'LABELED';
+LABELS: 'LABELS';
+LAST: 'LAST';
+NFC: 'NFC';
+NFD: 'NFD';
+NFKC: 'NFKC';
+NFKD: 'NFKD';
+NO: 'NO';
+NODE: 'NODE';
+NORMALIZED: 'NORMALIZED';
+ONLY: 'ONLY';
+ORDINALITY: 'ORDINALITY';
+PROPERTY: 'PROPERTY';
+READ: 'READ';
+RELATIONSHIP: 'RELATIONSHIP';
+RELATIONSHIPS: 'RELATIONSHIPS';
+REPEATABLE: 'REPEATABLE';
+SHORTEST: 'SHORTEST';
+SIMPLE: 'SIMPLE';
+SOURCE: 'SOURCE';
+TABLE: 'TABLE';
+TEMP: 'TEMP';
+TO: 'TO';
+TRAIL: 'TRAIL';
+TRANSACTION: 'TRANSACTION';
+TYPE: 'TYPE';
+UNDIRECTED: 'UNDIRECTED';
+VERTEX: 'VERTEX';
+WALK: 'WALK';
+WITHOUT: 'WITHOUT';
+WRITE: 'WRITE';
+ZONE: 'ZONE';
+MULTISET_ALTERNATION_OPERATOR: '|+|';
+BRACKET_RIGHT_ARROW: ']->';
+BRACKET_TILDE_RIGHT_ARROW: ']~>';
+CONCATENATION_OPERATOR: '||';
+DOUBLE_COLON: '::';
+DOUBLE_DOLLAR_SIGN: '$$';
+DOUBLE_PERIOD: '..';
+GREATER_THAN_OR_EQUALS_OPERATOR: '>=';
+LEFT_ARROW: '<-';
+LEFT_ARROW_TILDE: '<~';
+LEFT_ARROW_BRACKET: '<-[';
+LEFT_ARROW_TILDE_BRACKET: '<~[';
+LEFT_MINUS_RIGHT: '<->';
+LEFT_MINUS_SLASH: '<-/';
+LEFT_TILDE_SLASH: '<~/';
+LESS_THAN_OR_EQUALS_OPERATOR: '<=';
+MINUS_LEFT_BRACKET: '-[';
+MINUS_SLASH: '-/';
+NOT_EQUALS_OPERATOR: '<>';
+RIGHT_ARROW: '->';
+RIGHT_BRACKET_MINUS: ']-';
+RIGHT_BRACKET_TILDE: ']~';
+RIGHT_DOUBLE_ARROW: '=>';
+SLASH_MINUS: '/-';
+SLASH_MINUS_RIGHT: '/->';
+SLASH_TILDE: '/~';
+SLASH_TILDE_RIGHT: '/~>';
+TILDE_LEFT_BRACKET: '~[';
+TILDE_RIGHT_ARROW: '~>';
+TILDE_SLASH: '~/';
+AMPERSAND: '&';
+ASTERISK: '*';
+COLON: ':';
+COMMA: ',';
+COMMERCIAL_AT: '@';
+DOLLAR_SIGN: '$';
+DOUBLE_QUOTE: '"';
+EQUALS_OPERATOR: '=';
+EXCLAMATION_MARK: '!';
+RIGHT_ANGLE_BRACKET: '>';
+GRAVE_ACCENT: '`';
+LEFT_BRACE: '{';
+LEFT_BRACKET: '[';
+LEFT_PAREN: '(';
+LEFT_ANGLE_BRACKET: '<';
+MINUS_SIGN: '-';
+PERCENT: '%';
+PERIOD: '.';
+PLUS_SIGN: '+';
+QUESTION_MARK: '?';
+QUOTE: '\'';
+REVERSE_SOLIDUS: '\\';
+RIGHT_BRACE: '}';
+RIGHT_BRACKET: ']';
+RIGHT_PAREN: ')';
+SOLIDUS: '/';
+TILDE: '~';
+UNDERSCORE: '_';
+VERTICAL_BAR: '|';
+fragment HEX_DIGIT
+: [0-9a-f]
+;
+fragment DIGIT
+: [0-9]
+;
+SP
+: (WHITESPACE)+
+-> channel(HIDDEN)
+;
+WHITESPACE
+: SPACE
+| TAB
+| LF
+| VT
+| FF
+| CR
+| FS
+| GS
+| RS
+| US
+| '\u1680'
+| '\u180e'
+| '\u2000'
+| '\u2001'
+| '\u2002'
+| '\u2003'
+| '\u2004'
+| '\u2005'
+| '\u2006'
+| '\u2008'
+| '\u2009'
+| '\u200a'
+| '\u2028'
+| '\u2029'
+| '\u205f'
+| '\u3000'
+| '\u00a0'
+| '\u2007'
+| '\u202f'
+;
+BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
+SIMPLE_COMMENT_SOLIDUS: '//' ~[\r\n]* -> channel(HIDDEN);
+SIMPLE_COMMENT_MINUS: '--' ~[\r\n]* -> channel(HIDDEN);
+fragment GS : [\u001D];
+fragment FS : [\u001C];
+fragment CR : [\r];
+fragment Sc : [\p{Sc}];
+fragment SPACE : [ ];
+fragment Pc : [\p{Pc}];
+fragment TAB : [\t];
+fragment LF : [\n];
+fragment VT : [\u000B];
+fragment US : [\u001F];
+fragment FF: [\f];
+fragment RS: [\u001E];
diff --git a/developers/Somnus/.gitignore b/developers/Somnus/.gitignore
new file mode 100644 (file)
index 0000000..2db43ed
--- /dev/null
@@ -0,0 +1,4 @@
+
+*
+!/.gitignore
+
diff --git a/developers/build.gradle b/developers/build.gradle
new file mode 100644 (file)
index 0000000..47348ce
--- /dev/null
@@ -0,0 +1,13 @@
+
+
+
+
+
+// start of node_label recognizer functions list
+
+
+// end of DAG definition
+
+
+
+
diff --git a/developers/dependency_graph_definition.groovy b/developers/dependency_graph_definition.groovy
new file mode 100644 (file)
index 0000000..ec9028b
--- /dev/null
@@ -0,0 +1,387 @@
+/*
+ Here the developer describes the build environment and the graph of
+ dependencies between files to be built.
+
+ Each file is given a 'node'.  The node label is a path
+ to the file, existing or not. Node's can also be 'symbolic'
+ in that the label does not correspond to a file.
+
+ File paths are relative to the developer's directory.  Also
+ known as $DEVELOPER_HOME.
+
+ The program that processes this file is
+ `executor/build_from_dependency_graph.groovy`.  There are more notes and
+ definitions there.
+*/
+
+
+/*--------------------------------------------------------------------------------
+ The build environment
+
+ Each tool has its '_IN' and '_OUT' directories that are referenced in
+ their build scripts. This keeps references in the build script local.
+ (Flow of files between tools can be seen in the overlapping definitions
+ among the various _IN and _OUT directories.)
+
+ These suffixes are sometimes used to eliminate ambiguity:
+
+ _FN  = File Name
+ _FP  = File Path (last element of the FP is the FN)
+ _DN  = Directory Name
+ _DP  = Directory path (last element of the DP is the DN)
+
+ _FNL = File Name list
+ _FPL = File Path List 
+ _DNL = Directory path list
+ _DPL = Directory path list
+
+ Files in a _LEAF directory can not be built, and should never be deleted by the tools.
+
+*/
+
+def env = [:]
+
+// Required shell environment variables
+def varName_List = [
+  'REPO_HOME'
+  ,'PROJECT'
+  ,'ENV_BUILD_VERSION'
+  ,'DEVELOPER_HOME'
+]
+varName_List.each { varName ->
+  env[varName] = System.getenv(varName) ?: ""
+}
+
+// Optional shell environment variables
+def varNameOptional_List = [
+  'CLASSPATH'
+]
+varNameOptional_List.each { varName ->
+  env[varName] = System.getenv(varName) ?: ""
+}
+
+env.CLASSPATH += ":${env.ANTLR_JAR}"
+
+// tools used in build scripts
+def JAVA_COMP_FP = "${env.JAVA_HOME}/bin/javac"   // Java compiler path
+def JAVA_INTERP_FP = "${env.JAVA_HOME}/bin/java"  // Java interpreter path
+def JAVA_ARCHIVE_FP = "${env.JAVA_HOME}/bin/jar"  // Java archive tool path
+
+def dir_map = [
+  'ANTLR_IN_LEAF'       : 'ANTLR/'
+  ,'ANTLR_OUT'           : 'javac/ANTLR/'
+  ,'ANTLR_OUT_PARENT'    : 'javac/' // required by the antlr command to be a base for OUT
+  ,'EXECUTOR_IN'         : 'executor/'
+  ,'JAVA_COMP_IN'        : 'javac/'
+  ,'JAVA_COMP_IN_LEAF': 'javac/leaf/'
+  ,'JAVA_COMP_IN_ANTLR'  : 'javac/ANTLR/'
+  ,'JAVA_COMP_IN_SYN'    : 'javac/synthesized/'
+  ,'JAVA_COMP_OUT'       : 'jvm/'
+  ,'JVM_IN'              : 'jvm/'
+  ,'TEMP'                : 'Erebus/'
+]
+
+env.CLASSPATH += ":${dir_map.JVM_IN}"
+
+dir_map.JAVA_COMP_IN_LIST = 
+  "${dir_map.JAVA_COMP_IN_LEAF}" 
+  +":${dir_map.JAVA_COMP_IN_ANTLR}" 
+  +":${dir_map.JAVA_COMP_IN_SYN}"
+
+//--------------------------------------------------------------------------------
+// required environment variable check.  Will add additional preface checks here
+// should they become available.
+//
+
+// a helper function for `environment_check`
+def print_missing_var_list(missing_var_list){
+  if(missing_var_list.isEmpty()){
+    // Print nothing if the list is empty
+    return
+  } else if(missing_var_list.size() == 1){
+    println "This environment variable was not set: ${missing_var_list[0]}"
+  } else {
+    println "These environment variables were not set: ${missing_var_list.join(' ,')}"
+  }
+}
+
+task environment_check {
+  dependsOn ':installTools'
+  doFirst {
+
+    println "CLASSPATH: ${env.CLASSPATH}"
+    println "JAVA_COMP_IN_LIST: ${dir_map.JAVA_COMP_IN_LIST}"
+    
+    // did the required variables have definitions?
+    def error_missing = false
+    def error_project = false
+    def missing_var_list = [] // To collect missing environment variables
+    varName_List.each { varName ->
+      if(!env[varName]){
+        error_missing = true
+        missing_var_list << varName
+      }
+    }
+    print_missing_var_list(missing_var_list)
+    
+    // did the required variables have definitions?
+    if(env.PROJECT != "GQL_to_Cypher"){
+      error_project = true
+      println "Expected project 'GQL_to_Cypher' ,but found '${env.PROJECT}'."
+    }
+    if(error_missing || error_project){
+      throw new GradleException("Bailing due to missing environment variables.")
+    }
+  }
+  doLast {
+    println "================================================================================"
+    println "Building project .."
+  }
+}
+
+/*--------------------------------------------------------------------------------
+  Map keyed on label node definitions
+
+*/
+
+def node_map = [
+
+  "all" : [
+    ,type: "symbol"
+    ,neighbor: [
+      "ANTLR_OUT_FL"
+      ,"RuleNameList"
+      ,"RuleNameListRegx"
+      ,"Synthesize_SyntaxAnnotate"
+      ,"Synthesize_SyntaxAnnotate_PrintVisitor"
+      ,"Synthesize_SyntaxAnnotate_PrintVisitorMethod"
+    ]
+  ]
+
+  "ANTLR_OUT_FL" : [
+    ,type: "symbol"
+    ,neighbor: ["${dir_map.EXECUTOR_IN}/ANTLR_OUT_FL"]
+  ]
+
+  ,"RuleNameList" : [
+    ,type: "symbol"
+    ,neighbor: ["${dir_map.EXECUTOR_IN}/RuleNameList"]
+  ]
+
+  ,"RuleNameListRegx" : [
+    ,type: "symbol"
+    ,neighbor: ["${dir_map.EXECUTOR_IN}/RuleNameListRegx"]
+  ]
+
+  ,"Synthesize_SyntaxAnnotate" : [
+    ,type: "symbol"
+    ,neighbor: [
+      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"
+      ,"${dir_map.EXECUTOR_IN}/Synthesize_SyntaxAnnotate"
+    ]
+  ]
+
+  "Synthesize_SyntaxAnnotate.class" : [
+    type: 'path' , // It's a path type node
+    ,neighbor: [
+      "${dir_map.JAVA_COMP_IN_LEAF}/Synthesize_SyntaxAnnotate.java" , // Dependency
+      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"  // Dependency
+    ]
+    ,build: { node ,neighbor ->
+      def javac_cmd = "${JAVA_COMP_FP} -d ${dir_map.JAVA_COMP_OUT} ${neighbor.join(' ')}"
+      javac_cmd.execute().waitFor()
+    }
+  ]
+
+  ,"Synthesize_SyntaxAnnotate_PrintVisitor" : [
+    ,type: "symbol"
+    ,neighbor: [
+      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"
+      ,"${dir_map.JAVA_COMP_IN_LEAF}/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java"
+      ,"${dir_map.EXECUTOR_IN}/Synthesize_SyntaxAnnotate_PrintVisitor"
+    ]
+  ]
+
+  ,"Synthesize_SyntaxAnnotate_PrintVisitorMethod" : [
+    ,type: "symbol"
+    ,neighbor: [
+      "${dir_map.JAVA_COMP_IN_LEAF}/StringUtils.java"
+      ,"${dir_map.EXECUTOR_IN}/Synthesize_SyntaxAnnotate_PrintVisitorMethod"
+    ]
+  ]
+]
+
+
+
+//--------------------------------------------------------------------------------
+// node making functions
+//
+
+// javac/leaf/<x> returns leaf node for javac/leaf/<x>
+def node_leaf_f(node_label) {
+  def leafNodePattern = ~/${dir_map['JAVA_COMP_IN_LEAF']}(.*)/
+  def match = node_label =~ leafNodePattern
+  if (!match) {
+    return [status: "no_match"]
+  }
+  def baseName = match[0][1]
+
+  def leafFilePath = "${dir_map['JAVA_COMP_IN_LEAF']}${baseName}"
+  def leafFile = new File(leafFilePath)
+  if (!leafFile.exists()) {
+    return [status: "no_match"]
+  }
+
+  return [
+    status: "matched"
+    ,label: node_label
+    ,type: "leaf"
+    ,neighbor: []
+  ]
+}
+
+// given executor/<x> returns node to build script wrapping jvm/<x>.jar
+def node_executor_f(node) {
+
+  def match = node =~ /^(executor\/)(${base})$/
+  if (!match) {
+    return [status: "no_match"]
+  }
+  def baseName = match[0][2]
+
+  def jarFilePath = "${dir_map['JVM_IN']}${baseName}.jar"
+  def wrapperFilePath = "${dir_map['EXECUTOR_IN']}${baseName}"
+
+  def jarFile = new File(jarFilePath)
+  if (!jarFile.exists()) {
+    return [status: "no_match"]
+  }
+
+  return [
+    status: "matched"
+    ,label: node
+    ,type: "path"
+    ,neighbor: [jarFilePath]
+    ,must_have: [jarFilePath]
+    ,build: { node ,neighbor -> 
+
+      // The script for wrapping the jar file:
+      def wrapper =
+      """
+      #!/usr/bin/env bash
+      ${dir_map['JAVA_INTERP']} -cp \${CLASSPATH}:${dir_map['JVM_IN']}:${dir_map['JVM_IN']}/${baseName}.jar ${baseName} \\\$\\@
+      """
+      
+      new File(wrapperFilePath).withWriter('UTF-8') { writer ->
+        writer.write(wrapper)
+      }
+
+      println "Creating executable wrapper script for ${baseName} in executor directory."
+      "chmod +x ${wrapperFilePath}".execute().text
+    }
+  ]
+}
+
+// given javac/ANTLR/<x>.java, returns node to build grammar <x>.g4
+def node_grammar_f(node) {
+
+  def match = node =~ /^(${dir_map['ANTLR_OUT']})(${base})(Lexer|Parser|BaseListener|Listener|BaseVisitor|Visitor)\.java$/
+  if( !match ){
+    return [status: "no_match"]
+  }
+
+  def grammarName = match[0][2]
+  def outputType = match[0][3]
+
+  def grammarFilePath = "${dir_map['ANTLR_IN_LEAF']}${grammarName}.g4"
+  def grammarFile = new File(grammarFilePath)
+
+  if( !grammarFile.exists() ){
+    return [status: "no_match"]
+  }
+
+  return [
+    status: "matched"
+    ,label: node
+    ,type: "path"
+    ,neighbor: [grammarFilePath]
+  ]
+}
+
+// given <x>.class returns node to build <x>.class from <x>.java
+def node_class_f(node) {
+
+  def match = node =~ /^(${dir_map['JAVA_COMP_OUT']})(${base})\.class$/
+  if( !match ){
+    return [status: "no_match"]
+  }
+
+  def baseName = match[0][2]
+  def javaFilePath = "${dir_map['JAVA_COMP_IN_PRIMARY_DIR']}/${baseName}.java"
+  def javaFile = new File(javaFilePath)
+
+  if( !javaFile.exists() ){
+    return [status: "no_match"]
+  }
+
+  return [
+    status: "matched",
+    label: node,
+    type: "path",  // It's a path node since we're building the .class file
+    neighbor: [javaFilePath],  // The corresponding .java file
+    build: { node, neighbor ->
+        def javac_cmd = "${JAVA_COMP_FP} -d ${dir_map.JAVA_COMP_OUT} -sourcepath ${dir_map.JAVA_COMP_IN_DL} ${neighbor[0]}"
+        javac_cmd.execute().waitFor()
+    }
+  ]
+}
+
+// given <x>.jar returns node to build <x>.jar from <x>.class
+def node_jar_f(node) {
+
+  // Use the symbolic name and base patterns
+  def match = node =~ /^(${dir_map['JAVA_COMP_OUT']})(${base})\.jar$/
+
+  if( !match ){
+    return [status: "no_match"]
+  }
+
+  def baseName = match[0][2]
+  def classFilePath = "${dir_map['JAVA_COMP_OUT']}${baseName}.class"
+  def classFile = new File(classFilePath)
+
+  if( !classFile.exists() ){
+    return [status: "no_match"]
+  }
+
+  return [
+    status: "matched"
+    ,label: node
+    ,type: "path"
+    ,neighbor: [classFilePath]
+    ,build: { node ,neighbor ->
+      println "Building jar for ${baseName}"
+      def command = "${ext.javaHome}/bin/jar cf ${baseName}.jar -C ${dir_map['JAVA_COMP_OUT']} ${baseName}.class"
+      return command.execute().text;
+    }
+  ]
+}
+
+// list of the recognizer functions
+def node_f_list = [
+  node_leaf_f
+  ,node_executor_f
+  ,node_grammar_f
+  ,node_class_f
+  ,node_jar_f
+]
+
+// comprehensions to make regexprs more readable
+def base = "[a-zA-Z0-9_-]+"
+def ext = "[a-zA-Z0-9_-]+$"
+def name = "${base}\\.${ext}"
+def path = ".+/${name}"
+
+
+
+// LocalWords:  wellformed
diff --git a/developers/executor/ANTLR_OUT_FL b/developers/executor/ANTLR_OUT_FL
new file mode 100755 (executable)
index 0000000..c1ba0df
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -cp :/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:/var/user_data/Thomas-developer/GQL_to_Cypher/developer/jvm:/var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar:jvm:jvm/ANTLR_OUT_FL.jar ANTLR_OUT_FL $@
diff --git a/developers/executor/build_from_dependency_graph.groovy b/developers/executor/build_from_dependency_graph.groovy
new file mode 100644 (file)
index 0000000..5023600
--- /dev/null
@@ -0,0 +1,604 @@
+/*
+ Some terms:
+
+ a node is either malformed or 'wellformed'.  A wellformed node meets
+ the criteria set forth by `well_formed_node_q`.
+
+ 'node': a dictionary, hopefully a wellformed one
+ 'file node': a 'path' or 'leaf' type node.
+ 'node file': for 'path' or 'leaf' nodes, path relative to the developer's directory.
+
+ This code makes use of the following node properties:
+ - label: Unique label string. Used to reference nodes.
+ - type: The type of the node: 'leaf' ,'symbol' ,or 'path'.
+ - neighbor: list of the neighbor nodes labels
+ - must_have: list of node labels
+ - build: Code that builds the node.
+ - mark: a set of 'mark' tokens optionally placed on a node
+
+ For 'path' and 'leaf' type nodes, the node label is a file path.  Relative paths
+ are relative to the developer's directory.
+
+ The dependency graph is defined by the `lookup` function. `lookup` when given
+ a node label returns the node, if found, or null.
+
+*/
+
+/*--------------------------------------------------------------------------------
+  DAG adjectives
+
+  node undefined for undefined node?
+*/
+
+def all_node_type_set = ['symbol' ,'path' ,'leaf'] as Set
+def persistent_node_mark_set = ['cycle_member' ,'wellformed' ,'build_failed'] as Set
+def leaf_q = { node -> node && node.type && node.type == 'leaf' }
+def marked_q = { node -> node && node.mark && !node.mark.isEmpty() }
+
+// 'wellformed' and `cycle_member` marks set by `well_formed_q` function
+// 'build_failed' set by `run_build_scripts_f`
+def marked_good_q(node){
+  return (
+    node 
+    && node.mark 
+    && ('wellformed' in node.mark) 
+    && !('cycle_member' in node.mark)
+    && !('build_failed' in node.mark)
+  )
+}
+
+def set_mark(node ,mark){
+  node.mark = node.mark ?: [] as Set
+  node.mark << mark
+}
+
+def clear_mark(node ,mark){
+  if( node.mark ) node.mark.remove(mark)
+}
+
+def file_exists_q(node_label) {
+  def node_path = Paths.get(node_label)
+  return Files.exists(node_path)
+}
+
+
+/*--------------------------------------------------------------------------------
+ Wellformed Node Check
+
+ The developer defines the nodes, so their form needs to be checked.
+
+ early bail on node not defined
+ legal path in the build directory makedir -p ... not really a acquirement 
+
+*/
+def all_form_error_set = [
+  'no_node_label'
+  ,'no_such_node_type'
+  ,'neighbor_property_value_not_a_list'
+  ,'unregistered_mark'
+  ,'symbol_has_build_code'
+  ,'symbol_has_no_dependencies'
+  ,'missing_required_build_code'
+  ,'build_target_has_no_dependencies'
+  ,'leaf_has_neighbor_property'
+  ,'leaf_has_neighbor'
+]
+def wellformed_q = { node -> 
+  def form_error_set = [] as Set
+
+  if( 
+    !node.label || node.label.length() == 0 
+  ) 
+    form_error_set << 'no_node_label'
+
+  if( 
+    !node.type || !(node.type in all_node_type_set) 
+  ) 
+    form_error_set << 'no_such_node_type'
+
+  if(
+    node.neighbor 
+    && !(node.neighbor instanceof List)
+  )
+    form_error_set << 'neighbor_property_value_not_a_list'
+
+  if( 
+    node.mark
+    && (node.mark instance of Set)
+    && ! (node.mark.every {it in persistent_node_mark_set})
+  ) 
+    form_error_set << 'unregistered_mark'
+
+  if( 
+    node.type == "symbol" 
+    && node.build
+  )
+    form_error_set << 'symbol_has_build_code'
+
+  // an empty symbol would not participate in building anything
+  // mightbe shouldbe a warning.
+  if( 
+    node.type == "symbol" 
+    && ( !node.neighbor || node.neighbor.isEmpty() )
+  )
+    form_error_set << 'symbol_has_no_dependencies'
+
+  if( 
+    node.type == "path" 
+    && (!node.build || !(node.build instanceof Closure))
+  )
+    form_error_set << 'missing_required_build_code'
+
+  // have to build the path from something, really?  what if the build
+  // code is a generator?
+  if( 
+    node.type == "path" 
+    && ( !node.neighbor || node.neighbor.isEmpty() )
+  )
+    form_error_set << 'build_target_has_no_dependencies'
+
+  if( 
+    node.type == "leaf" 
+    && node.neighbor
+  ){
+    form_error_set << 'leaf_has_neighbor_property'
+    if( !node.neighbor.isEmpty()  )
+      form_error_set << 'leaf_has_neighbor'
+  }
+
+  return form_error_set
+}
+
+/*--------------------------------------------------------------------------------
+ A well formed graph checker.  Traverses entire graph and marks nodes
+ that are not well formed or that are part of a cycle.
+
+*/
+
+// given a node label list, adds the 'wellformed' mark to wellformed nodes.
+def mark_the_wellformed_f(node_label_list ,boolean verbose = true){
+  def all_wellformed = true
+
+  def neighbors = node_label_list.collect{ neighbor_label ->
+    def neighbor_node = lookup(neighbor_label)
+    def form_errors = wellformed_q(neighbor_node)
+    if(form_errors.isEmpty()){
+      neighbor_node.mark = neighbor_node.mark ?: [] as Set
+      neighbor_node.mark << 'wellformed'
+    } else {
+      all_wellformed = false
+      if(verbose){
+        if(neighbor_node.label && neighbor_node.label.length() > 0){
+          print("node ${neighbor_node.label} is malformed due to:")
+        } else {
+          print("anonymous node is malformed due to:")
+        }
+        form_errors.each { error -> print(" ${error}") }
+        println("")
+      }
+    }
+    neighbor_label
+  }
+
+  return all_wellformed ? 'all_wellformed' : 'exists_malformed'
+}
+
+// descends un-visited leftmost path, while marking nodes as wellformed and if
+// they are put of a cycle.
+def markup_graph_f_descend(path_stack ,boolean verbose = true){
+  def ret_value = [] as Set
+  def local_path = path_stack.collect{ it[0] }
+  def local_node_label = local_path[-1]
+  def cycle_start_index
+
+  do{
+    // Check for a cycle in the local path
+    cycle_start_index = local_path[0..-2].findIndexOf{ it == local_node_label }
+    if(cycle_start_index != -1){ // Cycle detected
+      ret_value << 'cycle_found'
+      if(verbose) print "markup_graph_f_descend:: dependency cycle found:"
+      local_path[cycle_start_index..-1].each{ cycle_node_label ->
+        def cycle_node = lookup(cycle_node_label)
+        if(verbose) print " ${cycle_node.label}"
+        cycle_node.mark = cycle_node.mark ?: [] as Set // Initialize mark set if needed
+        cycle_node.mark << 'cycle_member'
+      }
+      if(verbose) println ""
+      // we can not continue searching after the loop so ,we pop back to treat
+      // the first node in the loop as though a leaf node.
+      path_stack = path_stack[0..cycle_start_index]
+      return ret_value
+    }
+
+    // a 'de-facto' leaf node test subtleties here because we have not yet
+    // determined if the nodes we are wellformed. This is purposeful ,as
+    // this function does not know about the relationships between the 
+    // possible error marks.
+    def local_node = lookup(local_node_label)
+    if(local_node.neighbor.isEmpty()){
+      ret_value << 'defacto_leaf_node'
+      return ret_value
+    }
+
+    // Mark the wellformed nodes and get the result
+    def result = mark_the_wellformed_f(local_node.neighbor ,verbose)
+    if(result == 'exists_malformed'){
+      ret_value << 'exists_malformed'
+    }
+    
+    // Descend further into the tree.
+    path_stack << local_node.neighbor.clone()
+    local_node_label = local_node.neighbor[0]
+    local_path << local_node_label
+  }while(true)
+}
+
+
+
+/*--------------------------------------------------------------------------------
+ This function defines the graph.
+
+ Lookup attempts to lookup a node label in the node_map, and failing that, it
+ tries each label pattern recognition function in order.
+
+ lookup_marked_good can be run after `wellformed_graph_f` has marked up the
+ graph.  It will only return a node if a) found b) that is 'good'.
+ Note the `marked_good_q` adjective above.
+
+*/
+def lookup(node_label ,verbose = false){
+  def lookup_node = node_map[node_label]
+  if( lookup_node ){
+    lookup_node.label = node_label
+  } else {
+    def match_result
+    for(func in node_f_list){
+      match_result = func(node_label)
+      if(match_result.status == "matched"){
+        lookup_node = match_result
+        break
+      }
+    }
+  }
+  if( !lookup_node ){
+    if( verbose ) println "lookup:: Node ${node_label} could not be found."
+    return null
+  }
+  return lookup_node
+}
+
+// mark aware lookup function
+def lookup_marked_good(node_label ,verbose = false){
+  def node = lookup(node_label ,verbose)
+  if( node && marked_good_q(node) ) return node;
+  return null;
+}
+
+
+/*
+ Given `root_node_labels` of a DAG. Applies `node_function` to each node in a
+ depth-first traversal order.  Returns a set of error tokens encountered
+ during traversal.
+
+ `wellformed_graph_q` must be run on the DAG before this function is called ,or
+ `lookup_marked_good` will not function correctly.
+*/
+def all_DAG_DF(root_node_labels ,node_function ,boolean verbose = true) {
+  def error_token_set = [] as Set
+
+  if (root_node_labels.isEmpty()) return error_token_set
+
+  def visited = [] as Set
+  def in_traversal_order = []
+  def stack = []
+
+  root_node_labels.each { root_label ->
+    stack << root_label
+  }
+
+  do {
+    def node_label = stack.pop()
+    
+    def node = lookup_marked_good(node_label ,verbose)
+    if (!node) {
+      error_token_set << 'lookup_fail'
+      continue
+    }
+
+    if (node.label in visited) continue
+    visited << node.label
+
+    in_traversal_order << node
+
+    node.neighbor.each { neighbor_label ->
+      stack << neighbor_label
+    }
+  } while (!stack.isEmpty())
+
+  in_traversal_order.reverse().each { node ->
+    node_function(node ,error_token_set ,verbose)
+  }
+
+  return error_token_set
+}
+
+
+/*--------------------------------------------------------------------------------
+ run the build scripts
+   depends upon is_acyclic having already marked up the graph.
+*/
+
+import java.nio.file.Files
+import java.nio.file.Paths
+
+// a symbol dependency is good ,as long as it is built before the node in question
+def good_dependency_q(node_labels) {
+  return node_labels.every { node_label ->
+    def node = lookup_marked_good(node_label)
+    if (!node) return false
+    if (node.type in ['path' ,'leaf'] && !file_exists_q(node.label)) return false
+    return true
+  }
+}
+
+/* 
+ Given a node label and a list of node labels ,returns true if the file at the
+ node label in the first argument is newer than all the files at the
+ corresponding node labels in the second list.
+*/
+def newer_than_all(node_label ,node_label_list) {
+  def node_path = Paths.get(node_label)
+  if (!Files.exists(node_path)) return false
+
+  def node_last_modified = Files.getLastModifiedTime(node_path).toMillis()
+
+  return node_label_list.every { label ->
+    def path = Paths.get(label)
+    if (!Files.exists(path)) return false
+    def last_modified = Files.getLastModifiedTime(path).toMillis()
+    return node_last_modified > last_modified
+  }
+}
+
+def can_be_built_q(node){
+  if( !marked_good_q(node) ) return false;
+  if( 
+    (node.type == 'symbol' || type == 'path')
+    && !good_dependency_q( node.neighbor )
+  ){
+    return false
+  }
+  if(
+    node.type == 'leaf'
+    && !file_exists_q(node.label)
+  ){ 
+    return false;
+  }
+  return true
+}
+
+// `can_be_build_q` must be true for this to be meaningful:
+def should_be_built_q(node ,verbose = true) {
+  if(node.type == 'leaf') return false
+  if(node.type == 'symbol') return true
+  if( node.type == 'path') return !newer_than_all(node.label ,node.neighbor)
+  println("should_be_build_q:: unrecognized node type ,so assuming it should not be built.")
+  return false
+}
+
+/*
+ Runs build scripts for the given root_node_labels in a depth-first traversal order.
+ Uses `all_DAG_DF` to traverse the graph and applies the build function to each node.
+
+ Be sure that `wellformed_graph_q` has been run on DAG.
+
+ Be sure that the 'build_failed' marks have been cleared if this is not the
+ first build attempt.
+*/
+def run_build_scripts_f(root_node_labels ,boolean verbose = true){
+  if( root_node_labels.isEmpty() ) return
+
+  // Define the function to be applied to each node
+  def node_function = { node ,error_token_set ->
+
+    if( !can_be_built_q(node) ){
+      println("Skipping build for ${node.label} due to dependency problems or found leaf is missing")
+      return
+    }
+
+    if( !should_be_built_q(node) ){
+      if(verbose) println("${node.label} already up to date")
+      return
+    }
+
+    // if we get here, node can and should be built
+
+    println("Running build script for ${node.label}")
+    node.build(node ,node.neighbor)
+
+    // Check if the build updated the target file
+    if( should_be_built_q(node) ){
+      println("Build failed for ${node.label}")
+      set_mark(node ,'build_failed')
+    }
+
+  }
+
+  // Apply the function to all nodes in a depth-first manner
+  all_DAG_DF(root_node_labels ,node_function ,verbose)
+}
+
+
+------------------------------------
+
+def run_build_scripts_f( root_node_labels ,boolean verbose = true ){
+  if( root_node_labels.isEmpty() ) return
+
+  def visited = [] as Set
+  def build_order = []
+  def stack = []
+
+  root_node_labels.each{ root_label ->
+    stack << root_label
+  }
+
+  do{
+    def node_label = stack.pop()
+    def node = lookup( node_label ,verbose )
+    if( !node ) continue
+
+    if( node.label in visited ) continue
+    visited << node.label
+
+    if( !marked_good_q( node ) ){
+      if( verbose ) println( "Skipping malformed node ${node.label}" )
+      continue
+    }
+
+    // Clear the build_failed mark
+    node.mark.remove( 'build_failed' )
+
+    // reverse to be consistent in using the left subtree first
+    node.neighbor.reverse().each{ neighbor_label ->
+      stack << neighbor_label
+    }
+
+    build_order << node
+  }while( !stack.isEmpty() )
+
+  build_order.reverse().each{ node ->
+    def build_status = build_status_q( node ,verbose )
+    if( build_status == 'should_build' ){
+      println( "Running build script for ${node.label}" )
+      node.build( node ,node.neighbor )
+
+      // Check if the build updated the target file
+      if( build_status_q( node ,verbose ) == 'should_build' ){
+        println( "Build failed for ${node.label}" )
+        node.mark = node.mark ?: [] as Set
+        node.mark << 'build_failed'
+      }
+    } else if( build_status == 'dependency_problem' ){
+      println( "Skipping build for ${node.label} due to dependency problems" )
+    } else if( build_status == 'leaf' ){
+      println( "Skipping build for leaf node ${node.label}" )
+    }
+  }
+}
+
+
+--------------------------------------------------------------------------------
+def clean(nodes_to_clean) {
+  def all_dependencies = node_map["all"].neighbor.clone()
+  nodes_to_clean.each { node ->
+    all_dependencies.remove(node)
+  }
+
+  def must_have_nodes = []
+  all_dependencies.each { node ->
+    def node_info = node_map[node]
+    if (node_info.must_have) {
+      must_have_nodes += node_info.must_have
+    }
+  }
+
+  def to_clean_list = []
+  nodes_to_clean.each { node ->
+    if (!must_have_nodes.contains(node) && node_map[node].type == "path") {
+      to_clean_list += node
+    }
+  }
+
+  to_clean_list.each { node ->
+    def file_path = node_map[node].label
+    def file = new File(file_path)
+    if (file.exists()) {
+      file.delete()
+      println "Deleted file: ${file_path}"
+    }
+  }
+}
+
+
+--------------------------------------------------------------------------------
+def mark_for_clean_q( node ){
+  if( node.type == 'leaf' ) return false
+
+  if( node.type == 'symbol' || node.type == 'path' ){
+    def dependencies = node.neighbor.findAll{ neighbor_label ->
+      def neighbor_node = lookup( neighbor_label )
+      return good_dependency_q( neighbor_node )
+    }
+    return dependencies.size() == node.neighbor.size()
+  }
+
+  return false
+}
+
+def clean_nodes(root_node_labels ,boolean verbose = true){
+  if( root_node_labels.isEmpty() ) return
+
+  def visited = [] as Set
+  def clean_order = []
+  def stack = []
+
+  root_node_labels.each{ root_label ->
+    stack << root_label
+  }
+
+  do{
+    def node_label = stack.pop()
+    def node = lookup( node_label ,verbose )
+    if( !node ) continue
+
+    if( node.label in visited ) continue
+    visited << node.label
+
+    if( !marked_good_q( node ) ){
+      if( verbose ) println( "Skipping malformed node ${node.label}" )
+      continue
+    }
+
+    // reverse to be consistent in using the left subtree first
+    node.neighbor.reverse().each{ neighbor_label ->
+      stack << neighbor_label
+    }
+
+    clean_order << node
+  }while( !stack.isEmpty() )
+
+  clean_order.reverse().each{ node ->
+    if( mark_for_clean_q( node ) ){
+      def can_clean = true
+      node.uses?.each{ used_label ->
+        def used_node = lookup( used_label )
+        if( used_node && !mark_for_clean_q( used_node ) ){
+          can_clean = false
+          if( verbose ) println( "Cannot clean ${node.label} because it uses ${used_node.label}" )
+        }
+      }
+      if( can_clean ){
+        println( "Cleaning node ${node.label}" )
+        node.clean( node ,node.neighbor )
+      } else {
+        if( verbose ) println( "Skipping node ${node.label} due to dependency problems" )
+      }
+    } else if( node.type == 'leaf' ){
+      if( verbose ) println( "Skipping leaf node ${node.label}" )
+    } else {
+      if( verbose ) println( "Skipping node ${node.label} due to dependency problems" )
+    }
+  }
+}
+
+
+// LocalWords:  FN FPL DN DNL RuleNameListRegx RuleNameList PrintVisitorMethod
+// LocalWords:  PrintVisitor SyntaxAnnotate wellformed defacto acyclic
+g
+
+
+
+
+// LocalWords:  wellformed unvisited
diff --git a/developers/executor/cat_w_names b/developers/executor/cat_w_names
new file mode 100755 (executable)
index 0000000..5a3d173
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+# Check if any arguments are provided (input files or directories)
+if [ $# -eq 0 ]; then
+  echo "Usage: $0 <file1> [file2 ...]"
+  exit 1
+fi
+
+# Loop through all provided arguments (files or directories)
+for file in "$@"; do
+  if [ -f "$file" ]; then
+    echo "#--------------------------------------------------------------------------------"
+    echo "# Filename: ${file}"
+    echo "#"
+    cat "$file"
+  fi
+done
diff --git a/developers/executor/clean b/developers/executor/clean
new file mode 100755 (executable)
index 0000000..c8c3091
--- /dev/null
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+
+# Clean targets:
+#
+# 1. > clean temp[orary] - removes files from ./temporary except for .githolder
+#
+# 2. General clean targets:
+#
+#    > clean all # removes all things make built, and thus can be replaced by running make again.
+#    > clean program # removes all built ${EXECUTOR_IN_DIR} scripts and corresponding jar files
+#    > clean class # removes the class files
+#    > clean grammar # removes the generated java grammar files
+#
+# 3. Specific clean targets:
+#
+#    > clean all <program_name> # cleans all files built while building the program
+#    > clean program <program_name> # removes the script and jar file for the given program
+#    > clean grammar <grammar_name> - similar to clean:grammar, but only for the named grammar
+
+# Function to display usage message
+display_usage() {
+  echo "Usage: clean <all [<program_name>] | program [<program_name>] | grammar [<name>] | class | temp[orary]>"
+}
+
+# Function to check if a program is in EXECUTOR_IN_FPL
+is_program_in_fpl() {
+  local program="$1"
+  for prog in $EXECUTOR_IN_FPL; do
+    if [[ "$prog" == *"$program"* ]]; then
+      return 0
+    fi
+  done
+  return 1
+}
+
+# Function to delete a program
+delete_program() {
+  local program="$1"
+  if is_program_in_fpl "$program"; then
+    echo "Deleting program files for '$program'"
+    rm -f "${EXECUTOR_IN_DIR}/$program" "$JAVA_COMP_OUT_DIR/$program.jar" "$JAVA_COMP_OUT_DIR/$program.class"
+  else
+    echo "Error: Program '$program' is not recognized or is not listed in EXECUTOR_IN_FPL."
+    return 1
+  fi
+}
+
+# Command parser
+clean_command_parser() {
+  local token_list=($@)
+  local token_count=${#token_list[@]}
+  local command=${token_list[0]}
+  local arg=${token_list[1]}
+
+  if [ "$token_count" -eq 0 ]; then
+    display_usage
+  elif [ "$token_count" -eq 1 ]; then
+    case "$command" in
+      "temporary" | "temp")
+        ${EXECUTOR_IN_DIR}/clean_directory "$TEMP_DIR"
+        ;;
+      "all")
+        ${EXECUTOR_IN_DIR}/clean_directory "$TEMP_DIR"
+        ${EXECUTOR_IN_DIR}/clean_grammar
+        ${EXECUTOR_IN_DIR}/clean_file_list "JAVA_COMP_OUT_FPL"
+        ${EXECUTOR_IN_DIR}/clean_file_list "JAR_OUT_FPL"
+        ${EXECUTOR_IN_DIR}/clean_file_list "EXECUTOR_IN_FPL"
+        ;;
+      "program")
+        ${EXECUTOR_IN_DIR}/clean_file_list "JAR_OUT_FPL"
+        ${EXECUTOR_IN_DIR}/clean_file_list "EXECUTOR_IN_FPL"
+        ;;
+      "class")
+        ${EXECUTOR_IN_DIR}/clean_file_list "JAVA_COMP_OUT_FPL"
+        ;;
+      "grammar")
+        ${EXECUTOR_IN_DIR}/clean_grammar
+        ;;
+      *)
+        echo "Unknown clean option: $command"
+        ;;
+    esac
+  elif [ "$token_count" -eq 2 ]; then
+    case "$command" in
+      "all")
+        # Program name is $arg.
+        delete_program "$arg"
+        # Custom cleaning for each program.
+        case "$arg" in
+          "Tree_Test")
+            ${EXECUTOR_IN_DIR}/clean_grammar "GQL_Test"
+            ;;
+          "Tree_20240412")
+            ${EXECUTOR_IN_DIR}/clean_grammar "GQL_20240412"
+            ;;
+          "PrintRuleNameList")
+            : 
+            ;;
+          *)
+            echo "Unknown program: $arg"
+            ;;
+        esac
+        ;;
+      "program")
+        # Program name is $arg.
+        delete_program "$arg"
+        ;;
+      "grammar")
+        # Grammar name is $arg.
+        ${EXECUTOR_IN_DIR}/clean_grammar "$arg"
+        ;;
+      *)
+        echo "Unknown clean command: $command"
+        ;;
+    esac
+  else
+    echo "Clean commands are at most two tokens, but we found: $token_count"
+  fi
+}
+
+cd "$DEVELOPER_HOME" || { echo "Failed to change directory to" "$DEVELOPER_HOME"; exit 1; }
+source ${EXECUTOR_IN_DIR}/env_build
+clean_command_parser $@
diff --git a/developers/executor/clean_directory b/developers/executor/clean_directory
new file mode 100755 (executable)
index 0000000..873d400
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# helper function for `clean`, though can be called directly
+
+if [ -z "$1" ]; then
+  echo "Error: Directory argument is empty"
+elif [ ! -d "$1" ]; then
+  echo "Error: Directory $1 does not exist"
+else
+  echo "Cleaning directory: $1"
+  find "$1" -mindepth 1 -maxdepth 1 ! -name '.githolder' -exec rm -rf {} +
+  touch "$1/.githolder"
+fi
diff --git a/developers/executor/clean_file_list b/developers/executor/clean_file_list
new file mode 100755 (executable)
index 0000000..d9af5d9
--- /dev/null
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+# helper function for `clean`, though can be called directly
+
+if [ -z "$1" ]; then
+  exit 0
+fi
+
+# Determine the directory where the script is located
+script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# Use `env -i` to clear the environment and then source `env_build` from the script's directory
+env -i bash -c "
+
+source '${script_dir}/env_build'
+
+var_name='$1'
+#echo 'var_name is: ' \$var_name
+if [ -z \"\$var_name\" ]; then
+  echo 'USAGE: clean_file_list <env_variable_name>'
+  exit 1
+fi
+
+# Check if the variable is defined in the current environment
+if [ -z \"\$(eval echo \\$\$var_name)\" ]; then
+  echo 'Error: Environment variable \"\$var_name\" is not defined in env_build.'
+  exit 1
+fi
+
+# Check if the variable name contains 'PRIMARY' (case insensitive)
+if [[ \"\$var_name\" =~ [Pp][Rr][Ii][Mm][Aa][Rr][Yy] ]]; then
+  echo 'Error: Environment variable \"\$var_name\" contains \"PRIMARY\" so listed files were not deleted.'
+  exit 1
+fi
+
+# Check if the variable name ends with '_FPL'
+if [[ ! \"\$var_name\" =~ _FPL$ ]]; then
+  echo 'Error: Environment variable \"\$var_name\" must end with \"_FPL\".'
+  exit 1
+fi
+
+# Get the file list from the environment variable
+file_list=\$(eval echo \\$\$var_name)
+echo \$var_name \"=\" \$file_list
+
+if [ -z \"\$file_list\" ]; then
+  exit 0
+fi
+
+for file in \$file_list; do
+  if [ -e \"\$file\" ]; then
+    echo rm -f \"\$file\"
+    rm -f \"\$file\"
+  fi
+done
+" "$1"
diff --git a/developers/executor/clean_grammar b/developers/executor/clean_grammar
new file mode 100755 (executable)
index 0000000..9e90319
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# helper function for `clean`, though can be called directly
+
+# Check if required variables are set
+if [ -z "$ANTLR_GRAMMAR_LIST" ] || [ -z "$ANTLR_OUT_DIR" ]; then
+  echo "Error: Required environment variables ANTLR_GRAMMAR_LIST and ANTLR_OUT_DIR are not set."
+  exit 1
+fi
+
+# Function to delete a specific grammar
+delete_grammar() {
+  local grammar=$1
+  # echo "Attempting to delete grammar: $grammar"
+  if [ -z "$grammar" ]; then
+    echo "Error: Grammar name is empty"
+  elif echo "$ANTLR_GRAMMAR_LIST" | grep -qw "$grammar"; then
+    rm -f "$ANTLR_OUT_DIR/$grammar"*
+    echo "Deleted files starting with $grammar in $ANTLR_OUT_DIR"
+  else
+    echo "Invalid grammar name: $grammar"
+  fi
+}
+
+# If no argument is given, delete all grammars
+if [ -z "$1" ]; then
+  echo "Cleaning all grammar builds."
+  for grammar in $ANTLR_GRAMMAR_LIST; do
+    delete_grammar "$grammar"
+  done
+else
+  echo "Argument provided: $1"
+  delete_grammar "$1"
+fi
diff --git a/developers/executor/clean_program b/developers/executor/clean_program
new file mode 100755 (executable)
index 0000000..b2ca550
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# helper function for `clean`, though can be called directly
+
+# Check if required variables are set
+if [ -z "${EXECUTOR_IN_FPL}" ] || [ -z "${EXECUTOR_IN_DIR}" ]; then
+  echo "Error: Required environment variables EXECUTOR_IN_FPL and EXECUTOR_IN_DIR are not set."
+  exit 1
+fi
+
+# Function to delete a specific program
+delete_program() {
+  local program=$1
+  # echo "Attempting to delete program: $program"
+  if [ -z "$program" ]; then
+    echo "Error: Program name is empty"
+  elif echo "$ANTLR_PROGRAM_LIST" | grep -qw "$program"; then
+    rm -f "$ANTLR_OUT_DIR/$program"*
+    echo "Deleted files starting with $program in $ANTLR_OUT_DIR"
+  else
+    echo "Invalid program name: $program"
+  fi
+}
+
+# If no argument is given, delete all programs
+if [ -z "$1" ]; then
+  echo "removing all program and their jars."
+  for program in ${EXECUTOR_IN_FPL}; do
+    delete_program "$program"
+  done
+else
+  echo "rmoving program $1 and its jar."
+  delete_program "$1"
+fi
diff --git a/developers/executor/gradle b/developers/executor/gradle
new file mode 100755 (executable)
index 0000000..60ca7d7
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+if [[ -z "${DEVELOPER_HOME}" || -z "${EXECUTOR_IN_DIR}" ]]; then
+  echo "required variables not set. As seen by:"
+  echo "  DEVELOPER_HOME: $DEVELOPER_HOME"
+  echo "  EXECUTOR_IN_DIR: $EXECUTOR_IN_DIR"
+  exit 1
+fi
+
+cd "$DEVELOPER_HOME"
+
+# in case there have been edits to the environment
+source "${EXECUTOR_IN_DIR}"/env_build
+
+"${GRADLE_HOME}"/bin/gradle --project-dir ${REPO_HOME} "$@"
diff --git a/developers/experiment/.githolder b/developers/experiment/.githolder
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/developers/experiment/script2.sh b/developers/experiment/script2.sh
new file mode 100644 (file)
index 0000000..68b62b2
--- /dev/null
@@ -0,0 +1,16 @@
+# Create the env_GP file in the executor directory
+cat << 'EOF' > ../executor/env_GP
+#!/bin/bash
+# Environment setup for GP
+export GP_PROMPT="GP> "
+export PS1="\[$(tput setaf 2)\]\u@\h:\w$GP_PROMPT\[$(tput sgr0)\] "
+EOF
+
+# Make sure the file is executable
+chmod +x ../executor/env_GP
+
+# Source the env_GP file to set up the environment
+source ../executor/env_GP
+
+# Now let's see the current directory contents
+ls -l
diff --git a/developers/javac/ANTLR/.gitignore b/developers/javac/ANTLR/.gitignore
new file mode 100644 (file)
index 0000000..2db43ed
--- /dev/null
@@ -0,0 +1,4 @@
+
+*
+!/.gitignore
+
diff --git a/developers/javac/leaf/ANTLR_OUT_FL.java b/developers/javac/leaf/ANTLR_OUT_FL.java
new file mode 100644 (file)
index 0000000..f852af5
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+  Run the command with no arguments for a usage message.
+
+  Accepts an antlr grammar file name of the form: [path/]<name>[Lexer/Parser][.g4]
+
+  Prints a space-separated list of files antlr4 would output.
+
+  The <name>Lexer or <name>Parser suffix, or absence thereof, tell this program if
+  antlr would create lexer and parser files, or both.
+
+
+*/
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ANTLR_OUT_FL {
+
+  private static final String USAGE_MESSAGE = 
+    "Usage: ANTLR_OUT_FL <grammar-name> "
+    +" [-visitor (default)] [-no-visitor] "
+    +" [-listener] [-no-listener (default)] "
+    +" [-tokens] [-no-tokens (default)] "
+    +" [-path <path>]"
+    ;
+
+  public static void main(String[] args) {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    boolean visitor = true;
+    boolean noListener = true;
+    boolean noTokens = true;
+    String outputPath = "";
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        case "-visitor":
+          visitor = true;
+          break;
+        case "-no-visitor":
+          visitor = false;
+          break;
+        case "-listener":
+          noListener = false;
+          break;
+        case "-no-listener":
+          noListener = true;
+          break;
+        case "-tokens":
+          noTokens = false;
+          break;
+        case "-no-tokens":
+          noTokens = true;
+          break;
+        case "-path":
+          // Ensure the next argument exists and isn't another option
+          if (i + 1 < args.length && !args[i + 1].startsWith("-")) {
+            outputPath = args[++i];  // Get the next argument as the path
+            if (!outputPath.endsWith("/")) {
+              outputPath += "/";  // Ensure the path ends with a slash
+            }
+          } else {
+            System.err.println("expected argument after option: " + args[i]);
+            error = true;
+          }
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      System.exit(error ? 1 : 0);
+    }
+    if (argList.size() != 1) {
+      System.err.println("Expected exactly one non-option argument.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String grammarName = argList.get(0);
+
+    List<String> generatedFiles = generateFileList(grammarName, visitor, noListener, noTokens, outputPath);
+
+    // Print the files in a space-separated format on a single line
+    if (!generatedFiles.isEmpty()) {
+      System.out.print(generatedFiles.get(0)); // Print the first file
+      for (int i = 1; i < generatedFiles.size(); i++) {
+        System.out.print(" " + generatedFiles.get(i)); // Print space and each subsequent file
+      }
+    }
+    System.out.println(); // Print a newline at the end
+  }
+
+  public static List<String> generateFileList(String grammarName, boolean visitor, boolean noListener, boolean noTokens, String outputPath) {
+    String baseName = new File(grammarName).getName().replace(".g4", "");
+    List<String> fileList = new ArrayList<>();
+
+    // Determine if this is a lexer, parser, or both
+    boolean isLexer = baseName.endsWith("Lexer");
+    boolean isParser = baseName.endsWith("Parser");
+    boolean isCombined = !isLexer && !isParser;
+
+    if (isLexer || isCombined) {
+      // Lexer files
+      fileList.add(outputPath + baseName + "Lexer.java");
+      if (!noTokens) fileList.add(outputPath + baseName + "Lexer.tokens");
+    }
+
+    if (isParser || isCombined) {
+      // Parser files
+      fileList.add(outputPath + baseName + "Parser.java");
+      if (!noTokens) fileList.add(outputPath + baseName + ".tokens");
+
+      // Listener-related files
+      if (!noListener) {
+        fileList.add(outputPath + baseName + "Listener.java");
+        fileList.add(outputPath + baseName + "BaseListener.java");
+      }
+
+      // Visitor-related files
+      if (visitor) {
+        fileList.add(outputPath + baseName + "Visitor.java");
+        fileList.add(outputPath + baseName + "BaseVisitor.java");
+      }
+    }
+
+    return fileList;
+  }
+}
diff --git a/developers/javac/leaf/Arithmetic_Echo.java b/developers/javac/leaf/Arithmetic_Echo.java
new file mode 100644 (file)
index 0000000..8fadf28
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+Takes an 'Ariethemetic' grammar source file.  Parses it. Runs through the parse tree
+and recreates the source file.
+
+*/
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Arithmetic_Echo {
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE =
+    "Usage: Arithmetic_Echo [-version] <source-file-path>";
+
+  public static void main(String[] args) throws IOException {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }        
+    }
+    if (argList.size() != 1) {
+      System.err.println("Expected exactly one non-option argument.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String inputFile = argList.get(0);
+    String input = Files.readString(Paths.get(inputFile));
+
+    try {
+      // Direct instantiation without reflection
+      ArithmeticLexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
+      CommonTokenStream tokens = new CommonTokenStream(lexer);
+      ArithmeticParser parser = new ArithmeticParser(tokens);
+
+      // Directly calling the start rule method
+      ParseTree tree = parser.program(); // Assuming 'program' is the start rule
+
+      Arithmetic_Echo_PrintVisitor visitor = new Arithmetic_Echo_PrintVisitor(parser.getRuleNames());
+      String output = visitor.visit(tree);
+      System.out.println(output);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+}
diff --git a/developers/javac/leaf/Arithmetic_Echo_PrintVisitor.java b/developers/javac/leaf/Arithmetic_Echo_PrintVisitor.java
new file mode 100644 (file)
index 0000000..488d54a
--- /dev/null
@@ -0,0 +1,31 @@
+import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
+
+public class Arithmetic_Echo_PrintVisitor extends ArithmeticBaseVisitor<String> {
+  private final String[] ruleNames;
+
+  public Arithmetic_Echo_PrintVisitor(String[] ruleNames) {
+    this.ruleNames = ruleNames;
+  }
+
+  @Override
+  public String visitProgram(ArithmeticParser.ProgramContext ctx) {
+    return visit(ctx.expression());
+  }
+
+  @Override
+  public String visitExpression(ArithmeticParser.ExpressionContext ctx) {
+    if (ctx.INT() != null) {
+      return ctx.INT().getText();
+    } else if (ctx.getChildCount() == 3 && ctx.getChild(0).getText().equals("(")) {
+      // Handle parentheses
+      return visit(ctx.expression(0));  // Remove the extra parentheses
+    } else {
+      String left = visit(ctx.expression(0));
+      String right = visit(ctx.expression(1));
+      String operator = ctx.getChild(1).getText();
+      return "(" + left + " " + operator + " " + right + ")";
+    }
+  }
+
+}
+
diff --git a/developers/javac/leaf/Arithmetic_Echo__Test.java b/developers/javac/leaf/Arithmetic_Echo__Test.java
new file mode 100644 (file)
index 0000000..8e670b1
--- /dev/null
@@ -0,0 +1,134 @@
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Arithmetic_Echo__Test {
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE =
+    "Usage: Arithmetic_Echo__Test [-version]";
+
+  public static void main(String[] args) {
+    // if (args.length == 0) {
+    //   System.err.println(USAGE_MESSAGE);
+    //   System.exit(1);
+    // }
+    boolean error = false;
+    boolean version = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }        
+    }
+    if (argList.size() != 0) {
+      System.err.println("This program takes no arguments.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    Map<String, Boolean> tests = new HashMap<>();
+    tests.put("Arithmetic_Echo_0", Arithmetic_Echo_0());
+    tests.put("Arithmetic_Echo_1", Arithmetic_Echo_1());
+    tests.put("Arithmetic_Echo_2", Arithmetic_Echo_2());
+    tests.put("Arithmetic_Echo_3", Arithmetic_Echo_3());
+    tests.put("Arithmetic_Echo_4", Arithmetic_Echo_4());
+
+    TestBench.runTests(tests);
+  }
+
+  public static boolean Arithmetic_Echo_0() {
+    // Simple smoke test
+    try {
+      String input = "3 + 5";
+      String expectedOutput = "(3 + 5)";
+      String actualOutput = runSyntax(input);
+      return expectedOutput.equals(actualOutput);
+    } catch (Exception e) {
+      return false;
+    }
+  }
+
+  public static boolean Arithmetic_Echo_1() {
+    // Test with multiplication
+    try {
+      String input = "2 * 3";
+      String expectedOutput = "(2 * 3)";
+      String actualOutput = runSyntax(input);
+      return expectedOutput.equals(actualOutput);
+    } catch (Exception e) {
+      return false;
+    }
+  }
+
+  public static boolean Arithmetic_Echo_2() {
+    // Test with parentheses
+    try {
+      String input = "2 * (3 + 4)";
+      String expectedOutput = "(2 * (3 + 4))";
+      String actualOutput = runSyntax(input);
+      return expectedOutput.equals(actualOutput);
+    } catch (Exception e) {
+      return false;
+    }
+  }
+
+  public static boolean Arithmetic_Echo_3() {
+    // Test with division
+    try {
+      String input = "10 / 2";
+      String expectedOutput = "(10 / 2)";
+      String actualOutput = runSyntax(input);
+      return expectedOutput.equals(actualOutput);
+    } catch (Exception e) {
+      return false;
+    }
+  }
+
+  public static boolean Arithmetic_Echo_4() {
+    // Test with complex expression
+    try {
+      String input = "3 + 5 * (10 - 4)";
+      String expectedOutput = "(3 + (5 * (10 - 4)))";
+      String actualOutput = runSyntax(input);
+      return expectedOutput.equals(actualOutput);
+    } catch (Exception e) {
+      return false;
+    }
+  }
+
+  private static String runSyntax(String input) throws Exception {
+    Lexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
+    CommonTokenStream tokens = new CommonTokenStream(lexer);
+    ArithmeticParser parser = new ArithmeticParser(tokens);
+    Method startRule = parser.getClass().getMethod("program");
+    ParseTree tree = (ParseTree) startRule.invoke(parser);
+
+    Arithmetic_Echo_PrintVisitor visitor = new Arithmetic_Echo_PrintVisitor(parser.getRuleNames());
+    return visitor.visit(tree);
+  }
+}
diff --git a/developers/javac/leaf/Arithmetic_Swap.java b/developers/javac/leaf/Arithmetic_Swap.java
new file mode 100644 (file)
index 0000000..58e1caf
--- /dev/null
@@ -0,0 +1,69 @@
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Arithmetic_Swap {
+  private static final String USAGE_MESSAGE =
+    "Usage: Arithmetic_Swap [-version] <source-file-path>";
+
+  public static void main(String[] args) throws IOException {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    List<String> argList = new ArrayList<>();
+    for (String arg : args) {
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if (version) {
+      System.out.println("version 0.1");
+      System.exit(error ? 1 : 0);
+    }
+    if (argList.size() != 1) {
+      System.err.println("Expected exactly one non-option argument.");
+      error = true;
+    }
+    if (error) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String inputFile = argList.get(0);
+    String input = Files.readString(Paths.get(inputFile));
+
+    try {
+      ArithmeticLexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
+      CommonTokenStream tokens = new CommonTokenStream(lexer);
+      ArithmeticParser parser = new ArithmeticParser(tokens);
+      
+      ParseTree tree = parser.program();
+
+      Arithmetic_SwapVisitor swapVisitor = new Arithmetic_SwapVisitor();
+      ParseTree transformedTree = swapVisitor.visit(tree);
+
+      Arithmetic_Echo_PrintVisitor printVisitor = new Arithmetic_Echo_PrintVisitor(parser.getRuleNames());
+      String output = printVisitor.visit(transformedTree);
+
+      System.out.println(output);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+}
diff --git a/developers/javac/leaf/Arithmetic_SwapVisitor.java b/developers/javac/leaf/Arithmetic_SwapVisitor.java
new file mode 100644 (file)
index 0000000..f108735
--- /dev/null
@@ -0,0 +1,50 @@
+import org.antlr.v4.runtime.tree.*;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.misc.*;
+
+public class Arithmetic_SwapVisitor extends AbstractParseTreeVisitor<ParseTree> {
+
+    @Override
+    public ParseTree visit(ParseTree tree) {
+        if (tree instanceof ParserRuleContext) {
+            ParserRuleContext ctx = (ParserRuleContext) tree;
+            ParserRuleContext newCtx = new ParserRuleContext();
+
+            // Recursively visit all children and add them to the new context
+            for (int i = 0; i < ctx.getChildCount(); i++) {
+                ParseTree child = ctx.getChild(i);
+                ParseTree visitedChild = this.visit(child);
+                
+                // Add child if it's a valid type
+                if (visitedChild instanceof ParserRuleContext) {
+                    newCtx.addChild((ParserRuleContext) visitedChild);
+                } else if (visitedChild instanceof TerminalNode) {
+                    newCtx.addChild((TerminalNode) visitedChild);
+                }
+            }
+            return newCtx;
+        } else if (tree instanceof TerminalNode) {
+            TerminalNode node = (TerminalNode) tree;
+            // Swap operators based on text
+            switch (node.getText()) {
+                case "+":
+                    return createTerminalNode(node, ArithmeticParser.MINUS); // Swap + with -
+                case "-":
+                    return createTerminalNode(node, ArithmeticParser.PLUS);  // Swap - with +
+                case "*":
+                    return createTerminalNode(node, ArithmeticParser.DIVIDE); // Swap * with /
+                case "/":
+                    return createTerminalNode(node, ArithmeticParser.MULTIPLY); // Swap / with *
+                default:
+                    return node; // Return node as is for non-operator tokens
+            }
+        }
+        return null;
+    }
+
+    // Helper method to create a new TerminalNode with the swapped token
+    private TerminalNode createTerminalNode(TerminalNode oldNode, int newTokenType) {
+        Token newToken = new CommonToken(newTokenType, oldNode.getText());
+        return new TerminalNodeImpl(newToken);
+    }
+}
diff --git a/developers/javac/leaf/Arithmetic_SyntaxAnnotate.java b/developers/javac/leaf/Arithmetic_SyntaxAnnotate.java
new file mode 100644 (file)
index 0000000..0516db6
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+Takes an 'Ariethemetic' grammar source file.  Parses it. Outputs an annotated
+version of the source file while labeling what parts of the grammar the syntax
+objects belong to.  Note the -pp option.
+
+*/
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Arithmetic_SyntaxAnnotate {
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE = 
+    "Usage: Arithmetic_SyntaxAnnotate [-version] [-pp] <source-file>";
+
+  public static void main(String[] args) throws IOException {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    boolean pretty_print = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        case "-pp":
+          pretty_print = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }
+    }
+    if (argList.size() != 1) {
+      System.err.println("Expected exactly one non-option argument.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String input_file = argList.get(0);
+    String input = Files.readString(Paths.get(input_file));
+
+    try {
+      ArithmeticLexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
+      CommonTokenStream tokens = new CommonTokenStream(lexer);
+      ArithmeticParser parser = new ArithmeticParser(tokens);
+      ParseTree tree = parser.program();
+
+      Arithmetic_SyntaxAnnotate_PrintVisitor visitor = 
+        new Arithmetic_SyntaxAnnotate_PrintVisitor(parser.getRuleNames(), pretty_print);
+      String output = visitor.visit(tree);
+      System.out.println(output);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+}
diff --git a/developers/javac/leaf/Arithmetic_SyntaxAnnotate_PrintVisitor.java b/developers/javac/leaf/Arithmetic_SyntaxAnnotate_PrintVisitor.java
new file mode 100644 (file)
index 0000000..9831e54
--- /dev/null
@@ -0,0 +1,62 @@
+import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
+
+public class Arithmetic_SyntaxAnnotate_PrintVisitor extends ArithmeticBaseVisitor<String>{
+  private final String[] rule_names;
+  private final boolean pretty_print;
+
+  public Arithmetic_SyntaxAnnotate_PrintVisitor(String[] rule_names, boolean pretty_print){
+    this.rule_names = rule_names;
+    this.pretty_print = pretty_print;
+  }
+
+  private String indent(int level){
+    return "  ".repeat(level);
+  }
+
+  @Override
+  public String visitProgram(ArithmeticParser.ProgramContext ctx){
+    if(pretty_print){
+      StringBuilder result = new StringBuilder();
+      result.append("program\n").append(visitExpression(ctx.expression(), 1));
+      return result.toString();
+    }else{
+      return "program(" + visit(ctx.expression()) + ")";
+    }
+  }
+
+  @Override
+  public String visitExpression(ArithmeticParser.ExpressionContext ctx){
+    return visitExpression(ctx, 0);
+  }
+
+  private String visitExpression(ArithmeticParser.ExpressionContext ctx, int indent_level){
+    StringBuilder result = new StringBuilder();
+    if(pretty_print){
+      result.append(indent(indent_level)).append("expression(\n");
+      if( ctx.INT() != null ){
+        result.append(indent(indent_level + 1)).append("INT(").append(ctx.INT().getText()).append(")\n");
+      }else if( ctx.getChildCount() == 3 && ctx.getChild(0).getText().equals("(") ){
+        result.append(indent(indent_level + 1)).append("(\n");
+        result.append(visitExpression(ctx.expression(0), indent_level + 2));
+        result.append(indent(indent_level + 1)).append(")\n");
+      }else{
+        result.append(visitExpression(ctx.expression(0), indent_level + 1));
+        result.append(indent(indent_level + 1)).append("operator(").append(ctx.getChild(1).getText()).append(")\n");
+        result.append(visitExpression(ctx.expression(1), indent_level + 1));
+      }
+      result.append(indent(indent_level)).append(")\n");
+    }else{
+      if( ctx.INT() != null ){
+        result.append("INT(").append(ctx.INT().getText()).append(")");
+      }else if( ctx.getChildCount() == 3 && ctx.getChild(0).getText().equals("(") ){
+        result.append("(").append(visit(ctx.expression(0))).append(")");
+      }else{
+        String left = visit(ctx.expression(0));
+        String right = visit(ctx.expression(1));
+        String operator = "operator(" + ctx.getChild(1).getText() + ")";
+        result.append("expression(").append(left).append(" ").append(operator).append(" ").append(right).append(")");
+      }
+    }
+    return result.toString();
+  }
+}
diff --git a/developers/javac/leaf/Arithmetic_SyntaxAnnotate__Test.java b/developers/javac/leaf/Arithmetic_SyntaxAnnotate__Test.java
new file mode 100644 (file)
index 0000000..a80b690
--- /dev/null
@@ -0,0 +1,125 @@
+
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Arithmetic_SyntaxAnnotate__Test {
+
+  public static boolean Arithmetic_SyntaxAnnotate_0() {
+    return runTest(
+      "Arithmetic_SyntaxAnnotate__Test_0.txt"
+     ,"program(expression(INT(3) operator(+) INT(5)))"
+     );
+  }
+
+  public static boolean Arithmetic_SyntaxAnnotate_1() {
+    return runTest(
+      "Arithmetic_SyntaxAnnotate__Test_1.txt"
+      ,"program(expression(INT(3) operator(+) INT(5)))"
+   );
+  }
+
+  public static boolean Arithmetic_SyntaxAnnotate_2() {
+    return runTest(
+      "Arithmetic_SyntaxAnnotate__Test_2.txt" 
+      ,"program(expression(INT(2) operator(*) (expression(INT(3) operator(+) INT(4)))))"
+      );
+  }
+
+  public static boolean Arithmetic_SyntaxAnnotate_3() {
+    return runTest(
+      "Arithmetic_SyntaxAnnotate__Test_3.txt" 
+      ,"program(expression(INT(10) operator(/) INT(2)))"
+      );
+  }
+
+  public static boolean Arithmetic_SyntaxAnnotate_4() {
+    return runTest(
+      "Arithmetic_SyntaxAnnotate__Test_4.txt" 
+      ,"program(expression(INT(3) operator(+) expression(INT(5) operator(*) (expression(INT(10) operator(-) INT(4))))))"
+      );
+  }
+
+  private static boolean runTest(String filename ,String expectedOutput) {
+    try {
+      String input = Files.readString(Paths.get(filename));
+      String actualOutput = runSyntaxAnnotate(input);
+      return expectedOutput.equals(actualOutput);
+    } catch (Exception e) {
+      e.printStackTrace();
+      return false;
+    }
+  }
+
+  private static String runSyntaxAnnotate(String input) throws Exception {
+    Lexer lexer = new ArithmeticLexer(CharStreams.fromString(input));
+    CommonTokenStream tokens = new CommonTokenStream(lexer);
+    ArithmeticParser parser = new ArithmeticParser(tokens);
+    ParseTree tree = parser.program(); // Directly calling the start rule method
+
+    Arithmetic_SyntaxAnnotate_PrintVisitor visitor = new Arithmetic_SyntaxAnnotate_PrintVisitor(parser.getRuleNames() ,false);
+    return visitor.visit(tree);
+  }
+
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE = 
+    "Usage: Arithmetic_SyntaxAnnotate__Test [-version]";
+
+  public static void main(String[] args) {
+    // if (args.length == 0) {
+    //   System.err.println(USAGE_MESSAGE);
+    //   System.exit(1);
+    // }
+    boolean error = false;
+    boolean version = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }        
+    }
+    if (argList.size() != 0) {
+      System.err.println("This program takes no arguments.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    // Use LinkedHashMap to maintain order of test results
+    Map<String, Boolean> tests = new LinkedHashMap<>();
+    tests.put("Arithmetic_SyntaxAnnotate_0", Arithmetic_SyntaxAnnotate_0());
+    tests.put("Arithmetic_SyntaxAnnotate_1", Arithmetic_SyntaxAnnotate_1());
+    tests.put("Arithmetic_SyntaxAnnotate_2", Arithmetic_SyntaxAnnotate_2());
+    tests.put("Arithmetic_SyntaxAnnotate_3", Arithmetic_SyntaxAnnotate_3());
+    tests.put("Arithmetic_SyntaxAnnotate_4", Arithmetic_SyntaxAnnotate_4());
+
+    TestBench.runTests(tests);
+  }
+
+}
+
diff --git a/developers/javac/leaf/RuleNameList.java b/developers/javac/leaf/RuleNameList.java
new file mode 100644 (file)
index 0000000..c9b727c
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+  Accepts an grammar name (not a file path or file name) and outputs the rule
+  names found in the grammar.  
+
+  RuleNameList does not run antlr to build the grammar files, that must have
+  been done separately before this program is run.
+
+  RuleNameList produces a more reliable list than does RuleNameListRegx.
+
+  RuleNameList does not output terminal symbols (the lexer tokens).
+
+  Usage: ANTLRv4_RuleNames <input-file>
+*/
+
+import org.antlr.v4.runtime.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class RuleNameList {
+
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE =
+    "Usage: RuleNameList"
+    +" [-version]"
+    +" [-rule (default)] [-no-rule]"
+    +" [-token] [-no-token (default)]"
+    +" <grammar-name>"
+    ;
+
+  public static void main(String[] args) {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    boolean printRules = true;
+    boolean printTokens = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        case "-rule":
+          printRules = true;
+          break;
+        case "-no-rule":
+          printRules = false;
+          break;
+        case "-token":
+          printTokens = true;
+          break;
+        case "-no-token":
+          printTokens = false;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }        
+    }
+    if (argList.size() != 1) {
+      System.err.println("Expected exactly one non-option argument.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String grammarName = argList.get(0);
+    // in case the user provided a path instead of a name:
+    grammarName = Paths.get(grammarName).getFileName().toString().replace(".g4", "");
+
+    try {
+      // Dynamically load the appropriate lexer and parser
+      Class<?> lexerClass = Class.forName(grammarName + "Lexer");
+      Class<?> parserClass = Class.forName(grammarName + "Parser");
+
+      // Create instances of the lexer and parser
+      Lexer lexer = (Lexer) lexerClass.getConstructor(CharStream.class).newInstance(CharStreams.fromString(""));
+      CommonTokenStream tokens = new CommonTokenStream(lexer);
+      Parser parser = (Parser) parserClass.getConstructor(TokenStream.class).newInstance(tokens);
+
+      // Get the rule names from the parser
+      List<String> ruleNames = List.of(parser.getRuleNames());
+
+      // Get the token names from the lexer
+      List<String> tokenNames = List.of(lexer.getTokenNames());
+
+      // Print the rule names if requested
+      if (printRules) {
+        if (printTokens) {
+          System.out.println("#----------------------------------------");
+          System.out.println("# Rule names found in the grammar:");
+        }
+        for (String ruleName : ruleNames) {
+          System.out.println(ruleName);
+        }
+      }
+
+      // Print the token names if requested
+      if (printTokens) {
+        if (printRules) {
+          System.out.println("#----------------------------------------");
+          System.out.println("# Token names found in the grammar:");
+        }
+        for (String tokenName : tokenNames) {
+          System.out.println(tokenName);
+        }
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+}
diff --git a/developers/javac/leaf/RuleNameListRegx.java b/developers/javac/leaf/RuleNameListRegx.java
new file mode 100644 (file)
index 0000000..36ffb2b
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+Directly reads an ANTLR grammar file, a `.g4` file, and lists all the rules found in it.
+
+*/
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.ArrayList;
+import java.util.List;
+
+public class RuleNameListRegx {
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE =
+    "Usage: RuleNameListRegx [-version] <path-to-g4-file>";
+
+  public static void main(String[] args) {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    boolean pretty_print = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        case "-pp":
+          pretty_print = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }
+    }
+    if (argList.size() != 1) {
+      System.err.println("Expected exactly one non-option argument.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String filePath = argList.get(0);
+
+    try {
+      Set<String> ruleNames = new HashSet<>();
+      BufferedReader br = new BufferedReader(new FileReader(filePath));
+      StringBuilder content = new StringBuilder();
+      String line;
+      while ((line = br.readLine()) != null) {
+        content.append(line).append("\n");
+      }
+
+      // Updated pattern to handle multi-line rules
+      Pattern rulePattern = Pattern.compile("(?m)^\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*:");
+
+      Matcher matcher = rulePattern.matcher(content.toString());
+      while (matcher.find()) {
+        ruleNames.add(matcher.group(1));
+      }
+
+      System.out.println("Extracted Rules:");
+      for (String rule : ruleNames) {
+        System.out.println(rule);
+      }
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+  }
+}
diff --git a/developers/javac/leaf/StringUtils.java b/developers/javac/leaf/StringUtils.java
new file mode 100644 (file)
index 0000000..774e253
--- /dev/null
@@ -0,0 +1,18 @@
+public class StringUtils {
+
+    private static int spacesPerIndentLevel = 2; // Default to 2 spaces per indent level
+
+    public static void setSpacesPerIndentLevel(int spaces) {
+        spacesPerIndentLevel = spaces;
+    }
+
+    public static String indentString(String template, int indentLevel) {
+        String indent = " ".repeat(spacesPerIndentLevel * indentLevel);
+        String[] lines = template.split("\n");
+        StringBuilder indentedTemplate = new StringBuilder();
+        for (String line : lines) {
+            indentedTemplate.append(indent).append(line).append("\n");
+        }
+        return indentedTemplate.toString();
+    }
+}
diff --git a/developers/javac/leaf/Synthesize_SyntaxAnnotate.java b/developers/javac/leaf/Synthesize_SyntaxAnnotate.java
new file mode 100644 (file)
index 0000000..6f002f1
--- /dev/null
@@ -0,0 +1,166 @@
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Synthesize_SyntaxAnnotate {
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE = 
+    "Usage: Synthesize_SyntaxAnnotate [-version] <grammar-name> <output-file-path>";
+
+  public static void main(String[] args) throws IOException {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }        
+    }
+    if (argList.size() != 2) {
+      System.err.println("Expected exactly two non-option arguments.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String grammarName = argList.get(0);
+    // in case the user provided a path instead of a name:
+    grammarName = Paths.get(grammarName).getFileName().toString().replace(".g4", "");
+
+    String outputFile = argList.get(1);
+
+    synthesizeSyntaxAnnotateClass(grammarName, outputFile);
+  }
+
+  private static void synthesizeSyntaxAnnotateClass(String grammarName, String outputFile) throws IOException {
+    String className = grammarName + "_SyntaxAnnotate";
+    String lexerName = grammarName + "Lexer";
+    String parserName = grammarName + "Parser";
+    String visitorName = grammarName + "_SyntaxAnnotate_PrintVisitor";
+
+    // Template for the SyntaxAnnotate class
+    String classTemplate = """
+      /* This file generated by Synthesize_SyntaxAnnotate given the grammar 
+         name: ____4_.
+         
+         SyntaxAnnotate programs accept a source file, then echo the source file with
+         syntax annotation. Synthesize_SyntaxAnnotate produces a SyntaxAnnotate program
+         for a specific grammar.
+       */
+      import org.antlr.v4.runtime.*;
+      import org.antlr.v4.runtime.tree.*;
+      import java.io.IOException;
+      import java.nio.file.Files;
+      import java.nio.file.Paths;
+      import java.util.ArrayList;
+      import java.util.List;
+
+      public class ____0_ {
+        // Constant for the usage message
+        private static final String USAGE_MESSAGE =
+          "Usage: ____0_ [-version] [-pp] <source-file-path>";
+
+        public static void main(String[] args) throws IOException {
+          if (args.length == 0) {
+            System.err.println(USAGE_MESSAGE);
+            System.exit(1);
+          }
+          boolean error = false;
+          boolean version = false;
+          boolean pretty_print = false;
+          List<String> argList = new ArrayList<>();
+          for (int i = 0; i < args.length; i++) {
+            String arg = args[i];
+            if (arg.startsWith("-")) {
+              switch (arg) {
+              case "-version":
+                version = true;
+                break;
+              case "-pp":
+                pretty_print = true;
+                break;
+              default:
+                System.err.println("Unrecognized option: " + arg);
+                error = true;
+              }
+            } else {
+              argList.add(arg);
+            }
+          }
+          if(version){
+            System.out.println("version 0.1");
+            if(error){
+              System.exit(1);
+            }else{
+              System.exit(0);
+            }        
+          }
+          if (argList.size() != 1) {
+            System.err.println("Expected exactly one non-option argument.");
+            error = true;
+          }
+          if(error){
+            System.err.println(USAGE_MESSAGE);
+            System.exit(1);
+          }
+
+          String input_file = argList.get(0);
+          String input = Files.readString(Paths.get(input_file));
+
+          try {
+            ____1_ lexer = new ____1_(CharStreams.fromString(input));
+            CommonTokenStream tokens = new CommonTokenStream(lexer);
+            ____2_ parser = new ____2_(tokens);
+            ParseTree tree = parser.program();
+
+            ____3_ visitor = new ____3_(parser.getRuleNames(), pretty_print);
+            String output = visitor.visit(tree);
+            System.out.println(output);
+          } catch (Exception e) {
+            e.printStackTrace();
+          }
+        }
+      }
+      """;
+
+    // Fill in the blanks in the template
+    classTemplate = classTemplate.replace("____0_", className);
+    classTemplate = classTemplate.replace("____1_", lexerName);
+    classTemplate = classTemplate.replace("____2_", parserName);
+    classTemplate = classTemplate.replace("____3_", visitorName);
+    classTemplate = classTemplate.replace("____4_", grammarName);
+
+    // Write the synthesized class to the output file
+    Files.writeString(Paths.get(outputFile), classTemplate);
+  }
+}
+
+//  LocalWords:  SyntaxAnnotate
diff --git a/developers/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitor.java b/developers/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitor.java
new file mode 100644 (file)
index 0000000..ae508b0
--- /dev/null
@@ -0,0 +1,117 @@
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.tree.*;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
+import java.io.PrintWriter;
+
+public class Synthesize_SyntaxAnnotate_PrintVisitor {
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE = 
+    "Usage: Synthesize_SyntaxAnnotate_PrintVisitor"
+    +" [-version]"
+    +" <g4-grammar-file-path> <outputFile> [indent-level (default 0)]"
+    ;
+
+  public static void main(String[] args) throws IOException {
+  if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    int indentLevel = 0;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if (version) {
+      System.out.println("Version 0.1");
+      if (error) {
+        System.exit(1);
+      } else {
+        System.exit(0);
+      }
+    }
+    if (argList.size() < 2 || argList.size() > 3) {
+      System.err.println("Expected two or three non-option arguments.");
+      error = true;
+    }
+    if (error) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String grammarFilePath = argList.get(0);
+    String outputFile      = argList.get(1);
+    if (argList.size() == 3) {
+      indentLevel = Integer.parseInt(argList.get(2));
+    }
+
+    String grammarName = Paths.get(grammarFilePath).getFileName().toString().replace(".g4", "");
+    String parserName = grammarName + "Parser";
+    String visitorClassName = grammarName + "_SyntaxAnnotate_PrintVisitor";
+
+    // Parse the .g4 file
+    CharStream input = CharStreams.fromFileName(grammarFilePath);
+    ANTLRv4Lexer lexer = new ANTLRv4Lexer(input);
+    CommonTokenStream tokens = new CommonTokenStream(lexer);
+    ANTLRv4Parser parser = new ANTLRv4Parser(tokens);
+
+    // Extract rules
+    ParseTree tree = parser.grammarSpec();
+    List<String> ruleNames = extractRuleNames(parser);
+
+    // Synthesize the print methods
+    StringBuilder printMethods = new StringBuilder();
+    for (String ruleName : ruleNames) {
+      printMethods.append(Synthesize_SyntaxAnnotate_PrintVisitorMethod.synthesizePrintMethod(parserName, ruleName, indentLevel + 1));
+    }
+
+    // Template for the PrintVisitor class
+    String classTemplate = """
+      /* This file synthesized by Synthesize_SyntaxAnnotate_PrintVisitor.
+      */
+      import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
+
+      public class ____0_ extends AbstractParseTreeVisitor<String> {
+        private final String[] ruleNames;
+
+        public ____0_(String[] ruleNames) {
+          this.ruleNames = ruleNames;
+        }
+
+        ____1_
+      }
+      """;
+
+    classTemplate = classTemplate.replace("____0_", visitorClassName);
+    classTemplate = classTemplate.replace("____1_", printMethods.toString());
+
+    try (PrintWriter writer = new PrintWriter(outputFile)) {
+      writer.print(classTemplate);
+    }
+  }
+
+  private static List<String> extractRuleNames(Parser parser) {
+    // Extract rule names from the parser
+    return Arrays.asList(parser.getRuleNames());
+  }
+}
+
+//  LocalWords:  SyntaxAnnotate PrintVisitor
diff --git a/developers/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java b/developers/javac/leaf/Synthesize_SyntaxAnnotate_PrintVisitorMethod.java
new file mode 100644 (file)
index 0000000..35394bb
--- /dev/null
@@ -0,0 +1,90 @@
+import java.util.ArrayList;
+import java.util.List;
+import java.io.PrintWriter;
+
+public class Synthesize_SyntaxAnnotate_PrintVisitorMethod {
+  // Constant for the usage message
+  private static final String USAGE_MESSAGE = 
+    "Usage: Synthesize_SyntaxAnnotate_PrintVisitorMethod"
+    + " [-version]"
+    +" <grammar-name> <g4-rule-name> <output-file>"
+    ;
+
+  public static void main(String[] args) {
+    if (args.length == 0) {
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+    boolean error = false;
+    boolean version = false;
+    List<String> argList = new ArrayList<>();
+    for (int i = 0; i < args.length; i++) {
+      String arg = args[i];
+      if (arg.startsWith("-")) {
+        switch (arg) {
+        case "-version":
+          version = true;
+          break;
+        default:
+          System.err.println("Unrecognized option: " + arg);
+          error = true;
+        }
+      } else {
+        argList.add(arg);
+      }
+    }
+    if(version){
+      System.out.println("version 0.1");
+      if(error){
+        System.exit(1);
+      }else{
+        System.exit(0);
+      }        
+    }
+    if (argList.size() != 3) {
+      System.err.println("Expected exactly three non-option arguments.");
+      error = true;
+    }
+    if(error){
+      System.err.println(USAGE_MESSAGE);
+      System.exit(1);
+    }
+
+    String grammarName = argList.get(0);
+    String ruleName    = argList.get(1);
+    String outputFile  = argList.get(2);
+
+    String parserName = grammarName + "Parser";
+    
+    try {
+      PrintWriter writer = new PrintWriter(outputFile);
+      // start at indent level 0
+      writer.print(synthesizePrintMethod(parserName, ruleName, 0)); 
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+  public static String synthesizePrintMethod(String parserName, String ruleName, int indentLevel) {
+    // Template for the print method using text blocks
+    String template = """
+      public String visit____0_ (____1_.____0_Context ctx) {
+        StringBuilder result = new StringBuilder();
+        result.append("____0_(");
+        for (int i = 0; i < ctx.getChildCount(); i++) {
+          if (i > 0) result.append(", ");
+          result.append(visit(ctx.getChild(i)));
+        }
+        result.append(")");
+        return result.toString();
+      }
+      """;
+
+    // Fill in the blanks in the template
+    template = template.replace("____0_", ruleName);
+    template = template.replace("____1_", parserName);
+
+    // Indent the template
+    return StringUtils.indentString(template, indentLevel);
+  }
+}
diff --git a/developers/javac/leaf/TestBench.java b/developers/javac/leaf/TestBench.java
new file mode 100644 (file)
index 0000000..8bdcc67
--- /dev/null
@@ -0,0 +1,28 @@
+import java.util.Map;
+
+public class TestBench {
+
+    public static void runTests(Map<String, Boolean> tests) {
+        int totalTests = tests.size();
+        int passedTests = 0;
+        int failedTests = 0;
+
+        for (Map.Entry<String, Boolean> test : tests.entrySet()) {
+            try {
+                if (test.getValue()) {
+                    passedTests++;
+                } else {
+                    System.out.println("failed: " + test.getKey());
+                    failedTests++;
+                }
+            } catch (Exception e) {
+                System.out.println("failed: " + test.getKey());
+                failedTests++;
+            }
+        }
+
+        System.out.println("Total tests run: " + totalTests);
+        System.out.println("Total tests passed: " + passedTests);
+        System.out.println("Total tests failed: " + failedTests);
+    }
+}
diff --git a/developers/javac/synthesized/.gitignore b/developers/javac/synthesized/.gitignore
new file mode 100644 (file)
index 0000000..2db43ed
--- /dev/null
@@ -0,0 +1,4 @@
+
+*
+!/.gitignore
+
diff --git a/developers/jvm/.gitignore b/developers/jvm/.gitignore
new file mode 100644 (file)
index 0000000..2db43ed
--- /dev/null
@@ -0,0 +1,4 @@
+
+*
+!/.gitignore
+
diff --git a/developers/readers/#rule_list.txt# b/developers/readers/#rule_list.txt#
new file mode 100644 (file)
index 0000000..dd9812e
--- /dev/null
@@ -0,0 +1,368 @@
+Extracted Rules:
+PATH
+MONTH
+RIGHT_ARROW
+RIGHT_BRACKET_TILDE
+CREATE
+GROUPS
+TRIM
+CLOSE
+UINT32
+AGGREGATES
+FLOAT128
+LOG10
+FLOOR
+CATALOG
+YEAR
+CONNECTING
+CURRENT_PROPERTY_GRAPH
+NOTHING
+PARTITION
+INT16
+REVERSE_SOLIDUS
+BINDINGS
+LEFT_ANGLE_BRACKET
+LEFT
+NODE
+LEFT_BRACKET
+SIZE
+BIGINT
+SUM
+WHERE
+AS
+AT
+MIN
+QUERY
+TILDE_LEFT_BRACKET
+LEFT_ARROW_TILDE
+LTRIM
+VARCHAR
+SOURCE
+THEN
+XOR
+BINDING
+ALL_DIFFERENT
+SAME
+ORDINALITY
+CALL
+ALTER
+SET
+INT32
+BYTE_LENGTH
+PATHS
+RIGHT_PAREN
+CONSTRAINT
+PRECISION
+ASC
+GROUP
+UPPER
+ABS
+DELETE
+SMALL
+SIMPLE_COMMENT_MINUS
+VARIABLE
+BY
+OFFSET
+OCTET_LENGTH
+SKIP_RESERVED_WORD
+ELEMENT_ID
+INTERVAL
+DURATION_BETWEEN
+PROCEDURE
+YIELD
+STDDEV_POP
+POWER
+DOUBLE_DOLLAR_SIGN
+COLLECT_LIST
+INT8
+DETACH
+OPEN
+PERCENT
+STRING
+VARBINARY
+SIMPLE
+INTEGER8
+TO
+BRACKET_RIGHT_ARROW
+FLOAT16
+UNION
+DURATION
+SLASH_MINUS
+HOME_PROPERTY_GRAPH
+LOCAL_TIMESTAMP
+TYPED
+LEFT_ARROW
+FLOAT32
+DOUBLE_PERIOD
+DESC
+INTEGER32
+INTEGER128
+OPTIONAL
+PRODUCT
+DESCENDING
+PROPERTY_EXISTS
+LABEL
+LEFT_BRACE
+CURRENT_TIME
+REPLACE
+LABELS
+INTEGER
+NUMBER
+PROJECT
+INTEGER256
+PROPERTY
+PERCENTILE_DISC
+FOR
+UNIQUE
+TRAILING
+BTRIM
+UINT64
+BOOLEAN
+INTEGER16
+AVG
+NOT
+UBIGINT
+CEILING
+LOWER
+LAST
+SINH
+PATH_LENGTH
+INSTANT
+SIN
+END
+RELATIONSHIP
+HAVING
+LIST
+TANH
+TEMPORAL
+QUOTE
+MULTISET_ALTERNATION_OPERATOR
+BINARY
+ASINp
+UINT8
+DROP
+INFINITY
+RETURN
+ELEMENTS
+LEFT_ARROW_BRACKET
+SIGNED
+LEFT_MINUS_RIGHT
+SCHEMA
+NEXT
+RADIANS
+NORMALIZE
+GQLSTATUS
+RENAME
+BIG
+SLASH_TILDE_RIGHT
+FLOAT256
+FILTER
+MOD
+EXISTS
+INT64
+FLOAT64
+CONCATENATION_OPERATOR
+TIME
+COLON
+INTERSECT
+NORMALIZED
+WITH
+CLONE
+SLASH_MINUS_RIGHT
+RIGHT_BRACKET
+CURRENT_ROLE
+GRANT
+RELATIONSHIPS
+PLUS_SIGN
+DATETIME
+BOOL
+DIRECTORY
+DESTINATION
+START
+CHAR_LENGTH
+CHARACTER_LENGTH
+ZONED
+UNDERSCORE
+PERCENTILE_CONT
+DOUBLE_QUOTE
+SQRT
+INT128
+FINISH
+NULLIF
+SESSION_USER
+TABLE
+STDDEV_SAMP
+WHEN
+AGGREGATE
+VERTEX
+EXCLAMATION_MARK
+LOCAL
+DIRECTED
+ELSE
+CEIL
+CURRENT_GRAPH
+IF
+TYPE
+RIGHT_DOUBLE_ARROW
+PARAMETER
+CAST
+LOCAL_TIME
+GRAPH
+AMPERSAND
+SLASH_TILDE
+TRAIL
+IN
+LOG
+DISTINCT
+HOME_SCHEMA
+INT256
+IS
+EXACT
+LEADING
+FUNCTION
+INTEGER64
+CASE
+NODETACH
+NFKC
+NFKD
+DOLLAR_SIGN
+WITHOUT
+COUNT
+NOT_EQUALS_OPERATOR
+MINUS_LEFT_BRACKET
+MAX
+UNSIGNED
+CHAR
+TRANSACTION
+SYSTEM_USER
+LEFT_PAREN
+WRITE
+ORDER
+COMMERCIAL_AT
+REMOVE
+RIGHT
+VALUES
+DOUBLE
+COMMA
+GRAVE_ACCENT
+ZONED_DATETIME
+MINUS_SLASH
+NUMERIC
+REVOKE
+COS
+CURRENT_SCHEMA
+USE
+COT
+ASTERISK
+CHARACTERISTICS
+COPY
+SESSION
+TILDE_SLASH
+FIRST
+UNDIRECTED
+SELECT
+RECORDS
+ELEMENT
+ASCENDING
+LABELED
+HOME_GRAPH
+LOCAL_DATETIME
+REPEATABLE
+DAY
+UINT
+SIMPLE_COMMENT_SOLIDUS
+BYTES
+TAN
+ALL
+CURRENT_USER
+LN
+ARRAY
+SUBSTRING
+ZONE
+RECORD
+DECIMAL
+ONLY
+NFC
+FROM
+RESET
+VALUE
+LEFT_ARROW_TILDE_BRACKET
+NFD
+RIGHT_BRACKET_MINUS
+ZONED_TIME
+COALESCE
+QUESTION_MARK
+TIMESTAMP
+ACOS
+MINUTE
+EDGE
+GREATER_THAN_OR_EQUALS_OPERATOR
+BOTH
+NULL
+UNIT
+LEFT_TILDE_SLASH
+VERTICAL_BAR
+DIFFERENT
+KEEP
+LEFT_MINUS_SLASH
+BRACKETED_COMMENT
+PARAMETERS
+EXISTING
+EXCEPT
+SOLIDUS
+READ
+DATE
+SHORTEST
+LIKE
+DATA
+DRYRUN
+AND
+PERIOD
+OTHERWISE
+REAL
+INSERT
+CURRENT_DATE
+ATAN
+NO
+FLOAT
+LESS_THAN_OR_EQUALS_OPERATOR
+RIGHT_ANGLE_BRACKET
+CURRENT_TIMESTAMP
+HOUR
+LIMIT
+UINT16
+ANY
+UINT256
+ABSTRACT
+INT
+ROLLBACK
+OF
+REFERENCE
+CARDINALITY
+EDGES
+TILDE_RIGHT_ARROW
+COSH
+NULLS
+RTRIM
+ON
+BRACKET_TILDE_RIGHT_ARROW
+WALK
+RIGHT_BRACE
+DEC
+OR
+COMMIT
+MINUS_SIGN
+UINT128
+USMALLINT
+DOUBLE_COLON
+EQUALS_OPERATOR
+DEGREES
+TEMP
+ACYCLIC
+SMALLINT
+LET
+SECOND
+TILDE
+EXP
+MATCH
+CLEAR
diff --git a/developers/readers/.githolder b/developers/readers/.githolder
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/developers/readers/.ispell_antlr b/developers/readers/.ispell_antlr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/developers/readers/Cypher_GQL_differences.txt b/developers/readers/Cypher_GQL_differences.txt
new file mode 100644 (file)
index 0000000..227a5bf
--- /dev/null
@@ -0,0 +1,62 @@
+Seems to me, that creating a disjoint sub graph is identical to creating a new graph.  Perhaps we can work with that.  Why don't we create a master index of disjoint subgraphs in a header, then when a new graph is made we will add an entry in the index. 
+ChatGPT
+Creating a master index of disjoint subgraphs and managing them within a single Neo4j database is a practical approach. By using labels or properties to differentiate subgraphs, you can effectively manage multiple logical graphs within a single physical graph.
+
+    Here's a step-by-step approach to implement this:
+
+    Step 1: Create the Master Index
+    First, create a master index node that will store references to all disjoint subgraphs.
+
+    cypher
+
+    MERGE (index:GraphIndex {name: 'MasterIndex'})
+    Step 2: Create a New Graph
+    When creating a new graph, add an entry to the master index.
+
+    cypher
+
+    // Create a new graph and add an entry to the master index
+    MERGE (index:GraphIndex {name: 'MasterIndex'})
+    CREATE (graph:Graph {name: 'myNewGraph'})
+    MERGE (index)-[:CONTAINS]->(graph)
+
+    // Create nodes and relationships within the new graph
+    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Alice'})
+    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Bob'})
+    Step 3: Querying Subgraphs
+    To query a specific subgraph, use the label or properties associated with that subgraph.
+
+    cypher
+
+    MATCH (index:GraphIndex {name: 'MasterIndex'})-[:CONTAINS]->(graph:Graph {name: 'myNewGraph'})-[:HAS_NODE]->(person:Person:myNewGraph)
+    RETURN person.name
+    Step 4: Adding More Nodes and Relationships to a Subgraph
+    To add more nodes and relationships to an existing subgraph, refer to the subgraph by its label or properties.
+
+    cypher
+
+    MATCH (graph:Graph {name: 'myNewGraph'})
+    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Charlie'})
+    CREATE (person:Person:myNewGraph {name: 'Alice'})-[:KNOWS]->(person:Person:myNewGraph {name: 'Charlie'})
+    Example: Full Workflow
+    Creating a New Graph
+    cypher
+
+    MERGE (index:GraphIndex {name: 'MasterIndex'})
+    CREATE (graph:Graph {name: 'myNewGraph'})
+    MERGE (index)-[:CONTAINS]->(graph)
+    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Alice'})
+    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Bob'})
+    Querying a Subgraph
+    cypher
+
+    MATCH (index:GraphIndex {name: 'MasterIndex'})-[:CONTAINS]->(graph:Graph {name: 'myNewGraph'})-[:HAS_NODE]->(person:Person:myNewGraph)
+    RETURN person.name
+    Adding to a Subgraph
+    cypher
+
+    MATCH (graph:Graph {name: 'myNewGraph'})
+    CREATE (graph)-[:HAS_NODE]->(:Person:myNewGraph {name: 'Charlie'})
+    MATCH (alice:Person:myNewGraph {name: 'Alice'})
+    MATCH (charlie:Person:myNewGraph {name: 'Charlie'})
+    CREATE (alice)-[:KNOWS]->(charlie)
diff --git a/developers/readers/GQL_20240412_rule_list.txt b/developers/readers/GQL_20240412_rule_list.txt
new file mode 100644 (file)
index 0000000..729a7e6
--- /dev/null
@@ -0,0 +1,215 @@
+Here's the list of rules found in the GQL_20240412.g4 file:
+
+transactionMode
+transactionAccessMode
+rollbackCommand
+commitCommand
+nestedProcedureSpecification
+procedureSpecification
+nestedDataModifyingProcedureSpecification
+nestedQuerySpecification
+procedureBody
+bindingVariableDefinitionBlock
+bindingVariableDefinition
+statementBlock
+statement
+nextStatement
+graphVariableDefinition
+optTypedGraphInitializer
+graphInitializer
+bindingTableVariableDefinition
+optTypedBindingTableInitializer
+bindingTableInitializer
+valueVariableDefinition
+optTypedValueInitializer
+valueInitializer
+graphExpression
+currentGraph
+bindingTableExpression
+nestedBindingTableQuerySpecification
+objectExpressionPrimary
+linearCatalogModifyingStatement
+simpleCatalogModifyingStatement
+primitiveCatalogModifyingStatement
+createSchemaStatement
+dropSchemaStatement
+createGraphStatement
+openGraphType
+ofGraphType
+graphTypeLikeGraph
+graphSource
+dropGraphStatement
+createGraphTypeStatement
+graphTypeSource
+copyOfGraphType
+dropGraphTypeStatement
+callCatalogModifyingProcedureStatement
+linearDataModifyingStatement
+focusedLinearDataModifyingStatement
+focusedLinearDataModifyingStatementBody
+focusedNestedDataModifyingProcedureSpecification
+ambientLinearDataModifyingStatement
+ambientLinearDataModifyingStatementBody
+simpleLinearDataAccessingStatement
+simpleDataModifyingStatement
+primitiveDataModifyingStatement
+insertStatement
+setStatement
+setItemList
+setItem
+setPropertyItem
+setAllPropertiesItem
+setLabelItem
+removeStatement
+removeItemList
+removeItem
+removePropertyItem
+removeLabelItem
+deleteStatement
+deleteItemList
+deleteItem
+callDataModifyingProcedureStatement
+compositeQueryStatement
+compositeQueryExpression
+queryConjunction
+setOperator
+compositeQueryPrimary
+linearQueryStatement
+focusedLinearQueryStatement
+focusedLinearQueryStatementBody
+focusedNestedQuerySpecification
+ambientLinearQueryStatement
+ambientLinearQueryStatementBody
+nestedLinearQuerySpecification
+simpleQuerySpecification
+simpleQueryPrimary
+callDataAccessingProcedureStatement
+ambientDataModifyingProcedureStatement
+ambientQuerySpecification
+ambientQueryPrimary
+simpleQuerySpecificationBody
+simpleQueryPrimaryExpression
+simpleQueryBodyExpression
+compoundQuerySpecification
+ambientLinearQuerySpecification
+simpleDataAccessingStatement
+ambientDataModifyingStatement
+ambientLinearDataModifyingSpecification
+simpleDataAccessingSpecification
+ambientDataModifyingStatementBody
+simpleDataModifyingSpecification
+ambientLinearDataModifyingStatementBody
+simpleLinearDataModifyingSpecification
+focusedLinearDataModifyingSpecification
+focusedDataModifyingSpecification
+focusedLinearDataModifyingStatementBodyExpression
+focusedLinearQuerySpecification
+simpleLinearQuerySpecification
+focusedLinearQuerySpecificationBody
+simpleLinearQuerySpecificationBody
+focusedLinearQuerySpecificationBodyExpression
+simpleLinearQuerySpecificationBodyExpression
+compoundQueryBody
+compoundQueryExpression
+compoundQueryExpressionPart
+queryPrimary
+queryExpression
+queryTerm
+query
+querySpecification
+queryExpressionBody
+simpleQueryExpression
+simpleQuerySpecificationBodyExpression
+simpleQuerySpecificationBodyExpressionPart
+compoundQuerySpecificationBodyExpression
+compoundQuerySpecificationBodyExpressionPart
+simpleQuerySpecificationBodyPart
+simpleQuerySpecificationBodyExpressionPart
+simpleQuerySpecificationBodyExpression
+queryPrimaryExpression
+queryExpressionPart
+queryExpressionBodyPart
+queryExpressionPrimary
+queryExpressionTerm
+queryExpressionPrimaryExpression
+queryExpressionPrimaryExpressionPart
+queryExpressionPrimaryExpressionBody
+queryExpressionPrimaryExpressionTerm
+queryExpressionPrimaryExpressionBodyPart
+queryExpressionPrimaryExpressionPrimary
+queryExpressionPrimaryExpressionTermPart
+queryExpressionPrimaryExpressionPrimaryPart
+simpleQueryExpressionPrimary
+simpleQueryExpressionPrimaryPart
+simpleQueryExpressionPrimaryBody
+simpleQueryExpressionPrimaryTerm
+simpleQueryExpressionPrimaryBodyPart
+simpleQueryExpressionPrimaryPrimary
+simpleQueryExpressionPrimaryPrimaryPart
+simpleQueryExpressionPrimaryTermPart
+simpleQueryExpressionPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyTermPart
+simpleQueryExpressionPrimaryBodyExpression
+simpleQueryExpressionPrimaryBodyExpressionPart
+simpleQueryExpressionPrimaryBodyExpressionBody
+simpleQueryExpressionPrimaryBodyExpressionTerm
+simpleQueryExpressionPrimaryBodyExpressionBodyPart
+simpleQueryExpressionPrimaryBodyExpressionTermPart
+simpleQueryExpressionPrimaryBodyExpressionPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimary
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBody
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPart
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPrimaryBodyPartTerm
+simpleQueryExpressionPrimaryBodyExpressionPrimaryBodyPrimaryBodyPrimaryBodyPrimary ​​
+
+
+
+
+
+
+
diff --git a/developers/readers/antlr-mode.el b/developers/readers/antlr-mode.el
new file mode 100644 (file)
index 0000000..9557fc8
--- /dev/null
@@ -0,0 +1,2661 @@
+;;; antlr-mode.el --- major mode for ANTLR grammar files
+
+;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
+
+;; Author: Christoph Wedler <Christoph.Wedler@sap.com>
+;; Keywords: languages, ANTLR, code generator
+;; Version: 2.2c
+;; X-URL: http://antlr-mode.sourceforge.net/
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The Emacs package ANTLR-Mode provides: syntax highlighting for ANTLR grammar
+;; files, automatic indentation, menus containing rule/token definitions and
+;; supported options and various other things like running ANTLR from within
+;; Emacs.
+
+;; For details, check <http://antlr-mode.sourceforge.net/> or, if you prefer
+;; the manual style, follow all commands mentioned in the documentation of
+;; `antlr-mode'.  ANTLR is a LL(k)-based recognition tool which generates
+;; lexers, parsers and tree transformers in Java, C++ or Sather and can be
+;; found at <http://www.antlr.org/>.
+
+;; Bug fixes, bug reports, improvements, and suggestions for the newest version
+;; are strongly appreciated.
+
+;; To-do/Wish-list:
+;;
+;;  * Next Version [C-c C-w].  Produce HTML document with syntax highlighted
+;;    and hyper-links (using htmlize).
+;;  * Next Version [C-c C-u].  Insert/update special comments: each rule lists
+;;    all rules which use the current rule.  With font-lock update.
+;;  * Next Version.  Make hiding much more customizable.
+;;  * Planned [C-c C-j].  Jump to generated coding.
+;;  * Planned.  Further support for imenu, i.e., include entries for method
+;;    definitions at beginning of grammar class.
+;;  * Planned [C-c C-p].  Pack/unpack rule/subrule & options (one/multi-line).
+;;
+;;  * Probably.  Show rules/dependencies for ANT like for Makefile (does ANT
+;;    support vocabularies and grammar inheritance?), I have to look at
+;;    jde-ant.el: http://jakarta.apache.org/ant/manual/OptionalTasks/antlr.html
+;;  * Probably.  Make `indent-region' faster, especially in actions.  ELP
+;;    profiling in a class init action shows half the time is spent in
+;;    `antlr-next-rule', the other half in `c-guess-basic-syntax'.
+;;  * Unlikely.  Sather as generated language with syntax highlighting etc/.
+;;    Questions/problems: is sather-mode.el the standard mode for sather, is it
+;;    still supported, what is its relationship to eiffel3.el?  Requirement:
+;;    this mode must not depend on a Sather mode.
+;;  * Unlikely.  Faster syntax highlighting: sectionize the buffer into Antlr
+;;    and action code and run special highlighting functions on these regions.
+;;    Problems: code size, this mode would depend on font-lock internals.
+
+;;; Installation:
+
+;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode.
+
+;; If antlr-mode is not part of your distribution, put this file into your
+;; load-path and the following into your init file:
+;;   (autoload 'antlr-mode "antlr-mode" nil t)
+;;   (setq auto-mode-alist (cons '("\\.g\\'" . antlr-mode) auto-mode-alist))
+;;   (add-hook 'speedbar-load-hook  ; would be too late in antlr-mode.el
+;;            (lambda () (speedbar-add-supported-extension ".g")))
+
+;; I strongly recommend to use font-lock with a support mode like fast-lock,
+;; lazy-lock or better jit-lock (Emacs-21.1+) / lazy-shot (XEmacs).
+
+;; To customize, use menu item "Antlr" -> "Customize Antlr".
+
+;;; Code:
+
+(eval-when-compile
+  (require 'cl))
+
+(require 'easymenu)
+(require 'cc-mode)
+
+;; Just to get the rid of the byte compiler warning.  The code for
+;; this function and its friends are too complex for their own good.
+(declare-function cond-emacs-xemacs-macfn "antlr-mode" (args &optional msg))
+
+;; General Emacs/XEmacs-compatibility compile-time macros
+(eval-when-compile
+  (defmacro cond-emacs-xemacs (&rest args)
+    (cond-emacs-xemacs-macfn
+     args "`cond-emacs-xemacs' must return exactly one element"))
+  (defun cond-emacs-xemacs-macfn (args &optional msg)
+    (if (atom args) args
+      (and (eq (car args) :@) (null msg) ; (:@ ...spliced...)
+          (setq args (cdr args)
+                msg "(:@ ....) must return exactly one element"))
+      (let ((ignore (if (featurep 'xemacs) :EMACS :XEMACS))
+           (mode :BOTH) code)
+       (while (consp args)
+         (if (memq (car args) '(:EMACS :XEMACS :BOTH)) (setq mode (pop args)))
+         (if (atom args)
+             (or args (error "Used selector %s without elements" mode))
+           (or (eq ignore mode)
+               (push (cond-emacs-xemacs-macfn (car args)) code))
+           (pop args)))
+       (cond (msg (if (or args (cdr code)) (error msg) (car code)))
+             ((or (null args) (eq ignore mode)) (nreverse code))
+             (t (nconc (nreverse code) args))))))
+  ;; Emacs/XEmacs-compatibility `defun': remove interactive "_" for Emacs, use
+  ;; existing functions when they are `fboundp', provide shortcuts if they are
+  ;; known to be defined in a specific Emacs branch (for short .elc)
+  (defmacro defunx (name arglist &rest definition)
+    (let ((xemacsp (featurep 'xemacs)) reuses)
+      (while (memq (car definition)
+                  '(:try :emacs-and-try :xemacs-and-try))
+       (if (eq (pop definition) (if xemacsp :xemacs-and-try :emacs-and-try))
+           (setq reuses (car definition)
+                 definition nil)
+         (push (pop definition) reuses)))
+      (if (and reuses (symbolp reuses))
+         `(defalias ',name ',reuses)
+       (let* ((docstring (if (stringp (car definition)) (pop definition)))
+              (spec (and (not xemacsp)
+                         (eq (car-safe (car definition)) 'interactive)
+                         (null (cddar definition))
+                         (cadar definition))))
+         (if (and (stringp spec)
+                  (not (string-equal spec ""))
+                  (eq (aref spec 0) ?_))
+             (setq definition
+                   (cons (if (string-equal spec "_")
+                             '(interactive)
+                           `(interactive ,(substring spec 1)))
+                         (cdr definition))))
+         (if (null reuses)
+             `(defun ,name ,arglist ,docstring
+                ,@(cond-emacs-xemacs-macfn definition))
+           ;; no dynamic docstring in this case
+           `(eval-and-compile          ; no warnings in Emacs
+              (defalias ',name
+                (cond ,@(mapcar (lambda (func) `((fboundp ',func) ',func))
+                                (nreverse reuses))
+                      (t ,(if definition
+                              `(lambda ,arglist ,docstring
+                                 ,@(cond-emacs-xemacs-macfn definition))
+                            'ignore))))))))))
+  (defmacro ignore-errors-x (&rest body)
+    (let ((specials '((scan-sexps . 4) (scan-lists . 5)))
+         spec nils)
+      (if (and (featurep 'xemacs)
+              (null (cdr body)) (consp (car body))
+              (setq spec (assq (caar body) specials))
+              (>= (setq nils (- (cdr spec) (length (car body)))) 0))
+         `(,@(car body) ,@(make-list nils nil) t)
+       `(ignore-errors ,@body)))))
+
+;; More compile-time-macros
+(eval-when-compile
+  (defmacro save-buffer-state-x (&rest body) ; similar to EMACS/lazy-lock.el
+    (let ((modified (with-no-warnings (gensym "save-buffer-state-x-modified-"))))
+      `(let ((,modified (buffer-modified-p)))
+        (unwind-protect
+            (let ((buffer-undo-list t) (inhibit-read-only t)
+                  ,@(unless (featurep 'xemacs)
+                      '((inhibit-point-motion-hooks t) deactivate-mark))
+                  before-change-functions after-change-functions
+                  buffer-file-name buffer-file-truename)
+              ,@body)
+          (and (not ,modified) (buffer-modified-p)
+               (set-buffer-modified-p nil)))))))
+(put 'save-buffer-state-x 'lisp-indent-function 0)
+
+(defvar outline-level)
+(defvar imenu-use-markers)
+(defvar imenu-create-index-function)
+
+;; We cannot use `c-forward-syntactic-ws' directly since it is a macro since
+;; cc-mode-5.30 => antlr-mode compiled with older cc-mode would fail (macro
+;; call) when used with newer cc-mode.  Also, antlr-mode compiled with newer
+;; cc-mode would fail (undefined `c-forward-sws') when used with older cc-mode.
+;; Additional to the `defalias' below, we must set `antlr-c-forward-sws' to
+;; `c-forward-syntactic-ws' when `c-forward-sws' is not defined after requiring
+;; cc-mode.
+(defalias 'antlr-c-forward-sws 'c-forward-sws)
+
+
+;;;;##########################################################################
+;;;;  Variables
+;;;;##########################################################################
+
+
+(defgroup antlr nil
+  "Major mode for ANTLR grammar files."
+  :group 'languages
+  :link '(emacs-commentary-link "antlr-mode.el")
+  :link '(url-link "http://antlr-mode.sourceforge.net/")
+  :prefix "antlr-")
+
+(defconst antlr-version "2.2c"
+  "ANTLR major mode version number.
+Check <http://antlr-mode.sourceforge.net/> for the newest.")
+
+
+;;;===========================================================================
+;;;  Controlling ANTLR's code generator (language option)
+;;;===========================================================================
+
+(defvar antlr-language nil
+  "Major mode corresponding to ANTLR's \"language\" option.
+Set via `antlr-language-alist'.  The only useful place to change this
+buffer-local variable yourself is in `antlr-mode-hook' or in the \"local
+variable list\" near the end of the file, see
+`enable-local-variables'.")
+
+(defcustom antlr-language-alist
+  '((java-mode "Java" nil "\"Java\"" "Java")
+    (c++-mode "C++" "\"Cpp\"" "Cpp"))
+  "List of ANTLR's supported languages.
+Each element in this list looks like
+  \(MAJOR-MODE MODELINE-STRING OPTION-VALUE...)
+
+MAJOR-MODE, the major mode of the code in the grammar's actions, is the
+value of `antlr-language' if the first group in the string matched by
+REGEXP in `antlr-language-limit-n-regexp' is one of the OPTION-VALUEs.
+An OPTION-VALUE of nil denotes the fallback element.  MODELINE-STRING is
+also displayed in the mode line next to \"Antlr\"."
+  :group 'antlr
+  :type '(repeat (group :value (java-mode "")
+                       (function :tag "Major mode")
+                       (string :tag "Mode line string")
+                       (repeat :tag "ANTLR language option" :inline t
+                               (choice (const :tag "Default" nil)
+                                       string )))))
+
+(defcustom antlr-language-limit-n-regexp
+  '(8192 . "language[ \t]*=[ \t]*\\(\"?[A-Z][A-Za-z_]*\"?\\)")
+  "Used to set a reasonable value for `antlr-language'.
+Looks like \(LIMIT \. REGEXP).  Search for REGEXP from the beginning of
+the buffer to LIMIT and use the first group in the matched string to set
+the language according to `antlr-language-alist'."
+  :group 'antlr
+  :type '(cons (choice :tag "Limit" (const :tag "No" nil) (integer :value 0))
+              regexp))
+
+
+;;;===========================================================================
+;;;  Hide/Unhide, Indent/Tabs
+;;;===========================================================================
+
+(defcustom antlr-action-visibility 3
+  "Visibility of actions when command `antlr-hide-actions' is used.
+If nil, the actions with their surrounding braces are hidden.  If a
+number, do not hide the braces, only hide the contents if its length is
+greater than this number."
+  :group 'antlr
+  :type '(choice (const :tag "Completely hidden" nil)
+                (integer :tag "Hidden if longer than" :value 3)))
+
+(defcustom antlr-indent-comment 'tab
+  "Non-nil, if the indentation should touch lines in block comments.
+If nil, no continuation line of a block comment is changed.  If t, they
+are changed according to `c-indentation-line'.  When not nil and not t,
+they are only changed by \\[antlr-indent-command]."
+  :group 'antlr
+  :type '(radio (const :tag "No" nil)
+               (const :tag "Always" t)
+               (sexp :tag "With TAB" :format "%t" :value tab)))
+
+(defcustom antlr-tab-offset-alist
+  '((antlr-mode nil 4 nil)
+    (java-mode "antlr" 4 nil))
+  "Alist to determine whether to use ANTLR's convention for TABs.
+Each element looks like \(MAJOR-MODE REGEXP TAB-WIDTH INDENT-TABS-MODE).
+The first element whose MAJOR-MODE is nil or equal to `major-mode' and
+whose REGEXP is nil or matches variable `buffer-file-name' is used to
+set `tab-width' and `indent-tabs-mode'.  This is useful to support both
+ANTLR's and Java's indentation styles.  Used by `antlr-set-tabs'."
+  :group 'antlr
+  :type '(repeat (group :value (antlr-mode nil 8 nil)
+                       (choice (const :tag "All" nil)
+                               (function :tag "Major mode"))
+                       (choice (const :tag "All" nil) regexp)
+                       (integer :tag "Tab width")
+                       (boolean :tag "Indent-tabs-mode"))))
+
+(defcustom antlr-indent-style "java"
+  "If non-nil, cc-mode indentation style used for `antlr-mode'.
+See `c-set-style' and for details, where the most interesting part in
+`c-style-alist' is the value of `c-basic-offset'."
+  :group 'antlr
+  :type '(choice (const nil) regexp))
+
+(defcustom antlr-indent-item-regexp
+  "[]}):;|&]" ; & is local ANTLR extension (SGML's and-connector)
+  "Regexp matching lines which should be indented by one TAB less.
+See `antlr-indent-line' and command \\[antlr-indent-command]."
+  :group 'antlr
+  :type 'regexp)
+
+(defcustom antlr-indent-at-bol-alist
+  ;; eval-when-compile not usable with defcustom...
+  '((java-mode . "\\(package\\|import\\)\\>")
+    (c++-mode . "#\\(assert\\|cpu\\|define\\|endif\\|el\\(if\\|se\\)\\|i\\(dent\\|f\\(def\\|ndef\\)?\\|mport\\|nclude\\(_next\\)?\\)\\|line\\|machine\\|pragma\\|system\\|un\\(assert\\|def\\)\\|warning\\)\\>"))
+  "Alist of regexps matching lines are indented at column 0.
+Each element in this list looks like (MODE . REGEXP) where MODE is a
+function and REGEXP is a regular expression.
+
+If `antlr-language' equals to a MODE, the line starting at the first
+non-whitespace is matched by the corresponding REGEXP, and the line is
+part of a header action, indent the line at column 0 instead according
+to the normal rules of `antlr-indent-line'."
+  :group 'antlr
+  :type '(repeat (cons (function :tag "Major mode") regexp)))
+
+;; adopt indentation to cc-engine
+(defvar antlr-disabling-cc-syntactic-symbols
+  '(statement-block-intro
+    defun-block-intro topmost-intro statement-case-intro member-init-intro
+    arglist-intro brace-list-intro knr-argdecl-intro inher-intro
+    objc-method-intro
+    block-close defun-close class-close brace-list-close arglist-close
+    inline-close extern-lang-close namespace-close))
+
+
+;;;===========================================================================
+;;;  Options: customization
+;;;===========================================================================
+
+(defcustom antlr-options-use-submenus t
+  "Non-nil, if the major mode menu should include option submenus.
+If nil, the menu just includes a command to insert options.  Otherwise,
+it includes four submenus to insert file/grammar/rule/subrule options."
+  :group 'antlr
+  :type 'boolean)
+
+(defcustom antlr-tool-version 20701
+  "The version number of the Antlr tool.
+The value is an integer of the form XYYZZ which stands for vX.YY.ZZ.
+This variable is used to warn about non-supported options and to supply
+version correct option values when using \\[antlr-insert-option].
+
+Don't use a number smaller than 20600 since the stored history of
+Antlr's options starts with v2.06.00, see `antlr-options-alists'.  You
+can make this variable buffer-local."
+  :group 'antlr
+  :type 'integer)
+
+(defcustom antlr-options-auto-colon t
+  "Non-nil, if `:' is inserted with a rule or subrule options section.
+A `:' is only inserted if this value is non-nil, if a rule or subrule
+option is inserted with \\[antlr-insert-option], if there was no rule or
+subrule options section before, and if a `:' is not already present
+after the section, ignoring whitespace, comments and the init action."
+  :group 'antlr
+  :type 'boolean)
+
+(defcustom antlr-options-style nil
+  "List of symbols which determine the style of option values.
+If a style symbol is present, the corresponding option value is put into
+quotes, i.e., represented as a string, otherwise it is represented as an
+identifier.
+
+The only style symbol used in the default value of `antlr-options-alist'
+is `language-as-string'.  See also `antlr-read-value'."
+  :group 'antlr
+  :type '(repeat (symbol :tag "Style symbol")))
+
+(defcustom antlr-options-push-mark t
+  "Non-nil, if inserting an option should set & push mark.
+If nil, never set mark when inserting an option with command
+\\[antlr-insert-option].  If t, always set mark via `push-mark'.  If a
+number, only set mark if point was outside the options area before and
+the number of lines between point and the insert position is greater
+than this value.  Otherwise, only set mark if point was outside the
+options area before."
+  :group 'antlr
+  :type '(radio (const :tag "No" nil)
+               (const :tag "Always" t)
+               (integer :tag "Lines between" :value 10)
+               (sexp :tag "If outside options" :format "%t" :value outside)))
+
+(defcustom antlr-options-assign-string " = "
+  "String containing `=' to use between option name and value.
+This string is only used if the option to insert did not exist before
+or if there was no `=' after it.  In other words, the spacing around an
+existing `=' won't be changed when changing an option value."
+  :group 'antlr
+  :type 'string)
+
+
+;;;===========================================================================
+;;;  Options: definitions
+;;;===========================================================================
+
+(defvar antlr-options-headings '("file" "grammar" "rule" "subrule")
+  "Headings for the four different option kinds.
+The standard value is (\"file\" \"grammar\" \"rule\" \"subrule\").  See
+`antlr-options-alists'")
+
+(defvar antlr-options-alists
+  '(;; file options ----------------------------------------------------------
+    (("language" antlr-language-option-extra
+      (20600 antlr-read-value
+            "Generated language: " language-as-string
+            (("Java") ("Cpp") ("HTML") ("Diagnostic")))
+      (20700 antlr-read-value
+            "Generated language: " language-as-string
+            (("Java") ("Cpp") ("HTML") ("Diagnostic") ("Sather"))))
+     ("mangleLiteralPrefix" nil
+      (20600 antlr-read-value
+            "Prefix for literals (default LITERAL_): " t))
+     ("namespace" antlr-c++-mode-extra
+      (20700 antlr-read-value
+            "Wrap generated C++ code in namespace: " t))
+     ("namespaceStd" antlr-c++-mode-extra
+      (20701 antlr-read-value
+            "Replace ANTLR_USE_NAMESPACE(std) by: " t))
+     ("namespaceAntlr" antlr-c++-mode-extra
+      (20701 antlr-read-value
+            "Replace ANTLR_USE_NAMESPACE(antlr) by: " t))
+     ("genHashLines" antlr-c++-mode-extra
+      (20701 antlr-read-boolean
+            "Include #line in generated C++ code? "))
+     )
+    ;; grammar options --------------------------------------------------------
+    (("k" nil
+      (20600 antlr-read-value
+            "Lookahead depth: "))
+     ("importVocab" nil
+      (20600 antlr-read-value
+            "Import vocabulary: "))
+     ("exportVocab" nil
+      (20600 antlr-read-value
+            "Export vocabulary: "))
+     ("testLiterals" nil               ; lexer only
+      (20600 antlr-read-boolean
+            "Test each token against literals table? "))
+     ("defaultErrorHandler" nil                ; not for lexer
+      (20600 antlr-read-boolean
+            "Generate default exception handler for each rule? "))
+     ("codeGenMakeSwitchThreshold" nil
+      (20600 antlr-read-value
+            "Min number of alternatives for 'switch': "))
+     ("codeGenBitsetTestThreshold" nil
+      (20600 antlr-read-value
+            "Min size of lookahead set for bitset test: "))
+     ("analyzerDebug" nil
+      (20600 antlr-read-boolean
+            "Display debugging info during grammar analysis? "))
+     ("codeGenDebug" nil
+      (20600 antlr-read-boolean
+            "Display debugging info during code generation? "))
+     ("buildAST" nil                   ; not for lexer
+      (20600 antlr-read-boolean
+            "Use automatic AST construction/transformation? "))
+     ("ASTLabelType" nil               ; not for lexer
+      (20600 antlr-read-value
+            "Class of user-defined AST node: " t))
+     ("charVocabulary" nil             ; lexer only
+      (20600 nil
+            "Insert character vocabulary"))
+     ("interactive" nil
+      (20600 antlr-read-boolean
+            "Generate interactive lexer/parser? "))
+     ("caseSensitive" nil              ; lexer only
+      (20600 antlr-read-boolean
+            "Case significant when matching characters? "))
+     ("caseSensitiveLiterals" nil      ; lexer only
+      (20600 antlr-read-boolean
+            "Case significant when testing literals table? "))
+     ("classHeaderSuffix" nil
+      (20600 nil
+            "Additional string for grammar class definition"))
+     ("filter" nil                     ; lexer only
+      (20600 antlr-read-boolean
+            "Skip rule (the name, true or false): "
+            antlr-grammar-tokens))
+     ("namespace" antlr-c++-mode-extra
+      (20700 antlr-read-value
+            "Wrap generated C++ code for grammar in namespace: " t))
+     ("namespaceStd" antlr-c++-mode-extra
+      (20701 antlr-read-value
+            "Replace ANTLR_USE_NAMESPACE(std) by: " t))
+     ("namespaceAntlr" antlr-c++-mode-extra
+      (20701 antlr-read-value
+            "Replace ANTLR_USE_NAMESPACE(antlr) by: " t))
+     ("genHashLines" antlr-c++-mode-extra
+      (20701 antlr-read-boolean
+            "Include #line in generated C++ code? "))
+;;;     ("autoTokenDef" nil            ; parser only
+;;;      (80000 antlr-read-boolean             ; default: true
+;;;         "Automatically define referenced token? "))
+;;;     ("keywordsMeltTo" nil          ; parser only
+;;;      (80000 antlr-read-value
+;;;         "Change non-matching keywords to token type: "))
+     )
+    ;; rule options ----------------------------------------------------------
+    (("testLiterals" nil               ; lexer only
+      (20600 antlr-read-boolean
+            "Test this token against literals table? "))
+     ("defaultErrorHandler" nil                ; not for lexer
+      (20600 antlr-read-boolean
+            "Generate default exception handler for this rule? "))
+     ("ignore" nil                     ; lexer only
+      (20600 antlr-read-value
+            "In this rule, ignore tokens of type: " nil
+            antlr-grammar-tokens))
+     ("paraphrase" nil                 ; lexer only
+      (20600 antlr-read-value
+            "In messages, replace name of this token by: " t))
+     )
+    ;; subrule options -------------------------------------------------------
+    (("warnWhenFollowAmbig" nil
+      (20600 antlr-read-boolean
+            "Display warnings for ambiguities with FOLLOW? "))
+     ("generateAmbigWarnings" nil
+      (20600 antlr-read-boolean
+            "Display warnings for ambiguities? "))
+     ("greedy" nil
+      (20700 antlr-read-boolean
+            "Make this optional/loop subrule greedy? "))
+     ))
+  "Definitions for Antlr's options of all four different kinds.
+
+The value looks like \(FILE GRAMMAR RULE SUBRULE) where each FILE,
+GRAMMAR, RULE, and SUBRULE is a list of option definitions of the
+corresponding kind, i.e., looks like \(OPTION-DEF...).
+
+Each OPTION-DEF looks like \(OPTION-NAME EXTRA-FN VALUE-SPEC...) which
+defines a file/grammar/rule/subrule option with name OPTION-NAME.  The
+OPTION-NAMEs are used for the creation of the \"Insert XXX Option\"
+submenus, see `antlr-options-use-submenus', and to allow to insert the
+option name with completion when using \\[antlr-insert-option].
+
+If EXTRA-FN is a function, it is called at different phases of the
+insertion with arguments \(PHASE OPTION-NAME).  PHASE can have the
+values `before-input' or `after-insertion', additional phases might be
+defined in future versions of this mode.  The phase `before-input'
+occurs before the user is asked to insert a value.  The phase
+`after-insertion' occurs after the option value has been inserted.
+EXTRA-FN might be called with additional arguments in future versions of
+this mode.
+
+Each specification VALUE-SPEC looks like \(VERSION READ-FN ARG...).  The
+last VALUE-SPEC in an OPTION-DEF whose VERSION is smaller or equal to
+`antlr-tool-version' specifies how the user is asked for the value of
+the option.
+
+If READ-FN is nil, the only ARG is a string which is printed at the echo
+area to guide the user what to insert at point.  Otherwise, READ-FN is
+called with arguments \(INIT-VALUE ARG...) to get the new value of the
+option.  INIT-VALUE is the old value of the option or nil.
+
+The standard value contains the following functions as READ-FN:
+`antlr-read-value' with ARGs = \(PROMPT AS-STRING TABLE) which reads a
+general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which
+reads a boolean value or a member of TABLE.  PROMPT is the prompt when
+asking for a new value.  If non-nil, TABLE is a table for completion or
+a function evaluating to such a table.  The return value is quoted if
+AS-STRING is non-nil and is either t or a symbol which is a member of
+`antlr-options-style'.")
+
+
+;;;===========================================================================
+;;;  Run tool, create Makefile dependencies
+;;;===========================================================================
+
+(defcustom antlr-tool-command "java antlr.Tool"
+  "Command used in \\[antlr-run-tool] to run the Antlr tool.
+This variable should include all options passed to Antlr except the
+option \"-glib\" which is automatically suggested if necessary."
+  :group 'antlr
+  :type 'string)
+
+(defcustom antlr-ask-about-save t
+  "If not nil, \\[antlr-run-tool] asks which buffers to save.
+Otherwise, it saves all modified buffers before running without asking."
+  :group 'antlr
+  :type 'boolean)
+
+(defcustom antlr-makefile-specification
+  '("\n" ("GENS" "GENS%d" " \\\n\t") "$(ANTLR)")
+  "Variable to specify the appearance of the generated makefile rules.
+This variable influences the output of \\[antlr-show-makefile-rules].
+It looks like \(RULE-SEP GEN-VAR-SPEC COMMAND).
+
+RULE-SEP is the string to separate different makefile rules.  COMMAND is
+a string with the command which runs the Antlr tool, it should include
+all options except the option \"-glib\" which is automatically added
+if necessary.
+
+If GEN-VAR-SPEC is nil, each target directly consists of a list of
+files.  If GEN-VAR-SPEC looks like \(GEN-VAR GEN-VAR-FORMAT GEN-SEP), a
+Makefile variable is created for each rule target.
+
+Then, GEN-VAR is a string with the name of the variable which contains
+the file names of all makefile rules.  GEN-VAR-FORMAT is a format string
+producing the variable of each target with substitution COUNT/%d where
+COUNT starts with 1.  GEN-SEP is used to separate long variable values."
+  :group 'antlr
+  :type '(list (string :tag "Rule separator")
+              (choice
+               (const :tag "Direct targets" nil)
+               (list :tag "Variables for targets"
+                     (string :tag "Variable for all targets")
+                     (string :tag "Format for each target variable")
+                     (string :tag "Variable separator")))
+              (string :tag "ANTLR command")))
+
+(defvar antlr-file-formats-alist
+  '((java-mode ("%sTokenTypes.java") ("%s.java"))
+    (c++-mode ("%sTokenTypes.hpp") ("%s.cpp" "%s.hpp")))
+  "Language dependent formats which specify generated files.
+Each element in this list looks looks like
+  \(MAJOR-MODE (VOCAB-FILE-FORMAT...) (CLASS-FILE-FORMAT...)).
+
+The element whose MAJOR-MODE is equal to `antlr-language' is used to
+specify the generated files which are language dependent.  See variable
+`antlr-special-file-formats' for language independent files.
+
+VOCAB-FILE-FORMAT is a format string, it specifies with substitution
+VOCAB/%s the generated file for each export vocabulary VOCAB.
+CLASS-FILE-FORMAT is a format string, it specifies with substitution
+CLASS/%s the generated file for each grammar class CLASS.")
+
+(defvar antlr-special-file-formats '("%sTokenTypes.txt" "expanded%s.g")
+  "Language independent formats which specify generated files.
+The value looks like \(VOCAB-FILE-FORMAT EXPANDED-GRAMMAR-FORMAT).
+
+VOCAB-FILE-FORMAT is a format string, it specifies with substitution
+VOCAB/%s the generated or input file for each export or import
+vocabulary VOCAB, respectively.  EXPANDED-GRAMMAR-FORMAT is a format
+string, it specifies with substitution GRAMMAR/%s the constructed
+grammar file if the file GRAMMAR.g contains a grammar class which
+extends a class other than \"Lexer\", \"Parser\" or \"TreeParser\".
+
+See variable `antlr-file-formats-alist' for language dependent
+formats.")
+
+(defvar antlr-unknown-file-formats '("?%s?.g" "?%s?")
+  "Formats which specify the names of unknown files.
+The value looks like \(SUPER-GRAMMAR-FILE-FORMAT SUPER-EVOCAB-FORMAT).
+
+SUPER-GRAMMAR-FORMAT is a format string, it specifies with substitution
+SUPER/%s the name of a grammar file for Antlr's option \"-glib\" if no
+grammar file in the current directory defines the class SUPER or if it
+is defined more than once.  SUPER-EVOCAB-FORMAT is a format string, it
+specifies with substitution SUPER/%s the name for the export vocabulary
+of above mentioned class SUPER.")
+
+(defvar antlr-help-unknown-file-text
+  "## The following rules contain filenames of the form
+##  \"?SUPERCLASS?.g\" (and \"?SUPERCLASS?TokenTypes.txt\")
+## where SUPERCLASS is not found to be defined in any grammar file of
+## the current directory or is defined more than once.  Please replace
+## these filenames by the grammar files (and their exportVocab).\n\n"
+  "String indicating the existence of unknown files in the Makefile.
+See \\[antlr-show-makefile-rules] and `antlr-unknown-file-formats'.")
+
+(defvar antlr-help-rules-intro
+  "The following Makefile rules define the dependencies for all (non-
+expanded) grammars in directory \"%s\".\n
+They are stored in the kill-ring, i.e., you can insert them with C-y
+into your Makefile.  You can also invoke M-x antlr-show-makefile-rules
+from within a Makefile to insert them directly.\n\n\n"
+  "Introduction to use with \\[antlr-show-makefile-rules].
+It is a format string and used with substitution DIRECTORY/%s where
+DIRECTORY is the name of the current directory.")
+
+
+;;;===========================================================================
+;;;  Menu
+;;;===========================================================================
+
+(defcustom antlr-imenu-name t ; (featurep 'xemacs) ; TODO: Emacs-21 bug?
+  "Non-nil, if a \"Index\" menu should be added to the menubar.
+If it is a string, it is used instead \"Index\".  Requires package
+imenu."
+  :group 'antlr
+  :type '(choice (const :tag "No menu" nil)
+                (const :tag "Index menu" t)
+                (string :tag "Other menu name")))
+
+(defvar antlr-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\t" 'antlr-indent-command)
+    (define-key map "\e\C-a" 'antlr-beginning-of-rule)
+    (define-key map "\e\C-e" 'antlr-end-of-rule)
+    (define-key map "\C-c\C-a" 'antlr-beginning-of-body)
+    (define-key map "\C-c\C-e" 'antlr-end-of-body)
+    (define-key map "\C-c\C-f" 'c-forward-into-nomenclature)
+    (define-key map "\C-c\C-b" 'c-backward-into-nomenclature)
+    (define-key map "\C-c\C-c" 'comment-region)
+    (define-key map "\C-c\C-v" 'antlr-hide-actions)
+    (define-key map "\C-c\C-r" 'antlr-run-tool)
+    (define-key map "\C-c\C-o" 'antlr-insert-option)
+    ;; I'm too lazy to define my own:
+    (define-key map "\ea" 'c-beginning-of-statement)
+    (define-key map "\ee" 'c-end-of-statement)
+    ;; electric keys:
+    (define-key map ":" 'antlr-electric-character)
+    (define-key map ";" 'antlr-electric-character)
+    (define-key map "|" 'antlr-electric-character)
+    (define-key map "&" 'antlr-electric-character)
+    (define-key map "(" 'antlr-electric-character)
+    (define-key map ")" 'antlr-electric-character)
+    (define-key map "{" 'antlr-electric-character)
+    (define-key map "}" 'antlr-electric-character)
+    map)
+  "Keymap used in `antlr-mode' buffers.")
+
+(easy-menu-define antlr-mode-menu antlr-mode-map
+  "Major mode menu."
+  `("Antlr"
+    ,@(if (cond-emacs-xemacs
+          :EMACS (and antlr-options-use-submenus
+                      (>= emacs-major-version 21))
+          :XEMACS antlr-options-use-submenus)
+         `(("Insert File Option"
+            :filter ,(lambda (x) (antlr-options-menu-filter 1 x)))
+           ("Insert Grammar Option"
+            :filter ,(lambda (x) (antlr-options-menu-filter 2 x)))
+           ("Insert Rule Option"
+            :filter ,(lambda (x) (antlr-options-menu-filter 3 x)))
+           ("Insert Subrule Option"
+            :filter ,(lambda (x) (antlr-options-menu-filter 4 x)))
+           "---")
+       '(["Insert Option" antlr-insert-option
+          :active (not buffer-read-only)]))
+    ("Forward/Backward"
+     ["Backward Rule" antlr-beginning-of-rule t]
+     ["Forward Rule" antlr-end-of-rule t]
+     ["Start of Rule Body" antlr-beginning-of-body
+      :active (antlr-inside-rule-p)]
+     ["End of Rule Body" antlr-end-of-body
+      :active (antlr-inside-rule-p)]
+     "---"
+     ["Backward Statement" c-beginning-of-statement t]
+     ["Forward Statement" c-end-of-statement t]
+     ["Backward Into Nomencl." c-backward-into-nomenclature t]
+     ["Forward Into Nomencl." c-forward-into-nomenclature t])
+    ["Indent Region" indent-region
+     :active (and (not buffer-read-only) (c-region-is-active-p))]
+    ["Comment Out Region" comment-region
+     :active (and (not buffer-read-only) (c-region-is-active-p))]
+    ["Uncomment Region"
+     (comment-region (region-beginning) (region-end) '(4))
+     :active (and (not buffer-read-only) (c-region-is-active-p))]
+    "---"
+    ["Hide Actions (incl. Args)" antlr-hide-actions t]
+    ["Hide Actions (excl. Args)" (antlr-hide-actions 2) t]
+    ["Unhide All Actions" (antlr-hide-actions 0) t]
+    "---"
+    ["Run Tool on Grammar" antlr-run-tool t]
+    ["Show Makefile Rules" antlr-show-makefile-rules t]
+    "---"
+    ["Customize Antlr" (customize-group 'antlr) t]))
+
+
+;;;===========================================================================
+;;;  font-lock
+;;;===========================================================================
+
+(defcustom antlr-font-lock-maximum-decoration 'inherit
+  "The maximum decoration level for fontifying actions.
+Value `none' means, do not fontify actions, just normal grammar code
+according to `antlr-font-lock-additional-keywords'.  Value `inherit'
+means, use value of `font-lock-maximum-decoration'.  Any other value is
+interpreted as in `font-lock-maximum-decoration' with no level-0
+fontification, see `antlr-font-lock-keywords-alist'.
+
+While calculating the decoration level for actions, `major-mode' is
+bound to `antlr-language'.  For example, with value
+  \((java-mode \. 2) (c++-mode \. 0))
+Java actions are fontified with level 2 and C++ actions are not
+fontified at all."
+  :group 'antlr
+  :type '(choice (const :tag "None" none)
+                (const :tag "Inherit" inherit)
+                (const :tag "Default" nil)
+                (const :tag "Maximum" t)
+                (integer :tag "Level" 1)
+                (repeat :menu-tag "Mode specific" :tag "Mode specific"
+                        :value ((t . t))
+                        (cons :tag "Instance"
+                              (radio :tag "Mode"
+                                     (const :tag "All" t)
+                                     (symbol :tag "Name"))
+                              (radio :tag "Decoration"
+                                     (const :tag "Default" nil)
+                                     (const :tag "Maximum" t)
+                                     (integer :tag "Level" 1))))))
+
+(defconst antlr-no-action-keywords nil
+  ;; Using nil directly won't work (would use highest level, see
+  ;; `font-lock-choose-keywords'), but a non-symbol, i.e., (list), at `car'
+  ;; would break Emacs-21.0:
+  "Empty font-lock keywords for actions.
+Do not change the value of this constant.")
+
+(defvar antlr-font-lock-keywords-alist
+  '((java-mode
+     antlr-no-action-keywords
+     java-font-lock-keywords-1 java-font-lock-keywords-2
+     java-font-lock-keywords-3)
+    (c++-mode
+     antlr-no-action-keywords
+     c++-font-lock-keywords-1 c++-font-lock-keywords-2
+     c++-font-lock-keywords-3))
+  "List of font-lock keywords for actions in the grammar.
+Each element in this list looks like
+  \(MAJOR-MODE KEYWORD...)
+
+If `antlr-language' is equal to MAJOR-MODE, the KEYWORDs are the
+font-lock keywords according to `font-lock-defaults' used for the code
+in the grammar's actions and semantic predicates, see
+`antlr-font-lock-maximum-decoration'.")
+
+(defvar antlr-default-face 'antlr-default)
+(defface antlr-default '((t nil))
+  "Face to prevent strings from language dependent highlighting.
+Do not change."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-default-face 'face-alias 'antlr-default)
+(put 'antlr-font-lock-default-face 'obsolete-face "22.1")
+
+(defvar antlr-keyword-face 'antlr-keyword)
+(defface antlr-keyword
+  (cond-emacs-xemacs
+   '((((class color) (background light))
+      (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
+     (t :inherit font-lock-keyword-face)))
+  "ANTLR keywords."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-keyword-face 'face-alias 'antlr-keyword)
+(put 'antlr-font-lock-keyword-face 'obsolete-face "22.1")
+
+(defvar antlr-syntax-face 'antlr-keyword)
+(defface antlr-syntax
+  (cond-emacs-xemacs
+   '((((class color) (background light))
+      (:foreground "black" :EMACS :weight bold :XEMACS :bold t))
+     (t :inherit font-lock-constant-face)))
+  "ANTLR syntax symbols like :, |, (, ), ...."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-syntax-face 'face-alias 'antlr-syntax)
+(put 'antlr-font-lock-syntax-face 'obsolete-face "22.1")
+
+(defvar antlr-ruledef-face 'antlr-ruledef)
+(defface antlr-ruledef
+  (cond-emacs-xemacs
+   '((((class color) (background light))
+      (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
+     (t :inherit font-lock-function-name-face)))
+  "ANTLR rule references (definition)."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-ruledef-face 'face-alias 'antlr-ruledef)
+(put 'antlr-font-lock-ruledef-face 'obsolete-face "22.1")
+
+(defvar antlr-tokendef-face 'antlr-tokendef)
+(defface antlr-tokendef
+  (cond-emacs-xemacs
+   '((((class color) (background light))
+      (:foreground "blue" :EMACS :weight bold :XEMACS :bold t))
+     (t :inherit font-lock-function-name-face)))
+  "ANTLR token references (definition)."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-tokendef-face 'face-alias 'antlr-tokendef)
+(put 'antlr-font-lock-tokendef-face 'obsolete-face "22.1")
+
+(defvar antlr-ruleref-face 'antlr-ruleref)
+(defface antlr-ruleref
+  '((((class color) (background light)) (:foreground "blue4"))
+    (t :inherit font-lock-type-face))
+  "ANTLR rule references (usage)."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-ruleref-face 'face-alias 'antlr-ruleref)
+(put 'antlr-font-lock-ruleref-face 'obsolete-face "22.1")
+
+(defvar antlr-tokenref-face 'antlr-tokenref)
+(defface antlr-tokenref
+  '((((class color) (background light)) (:foreground "orange4"))
+    (t :inherit font-lock-type-face))
+  "ANTLR token references (usage)."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-tokenref-face 'face-alias 'antlr-tokenref)
+(put 'antlr-font-lock-tokenref-face 'obsolete-face "22.1")
+
+(defvar antlr-literal-face 'antlr-literal)
+(defface antlr-literal
+  (cond-emacs-xemacs
+   '((((class color) (background light))
+      (:foreground "brown4" :EMACS :weight bold :XEMACS :bold t))
+     (t :inherit font-lock-string-face)))
+  "ANTLR special literal tokens.
+It is used to highlight strings matched by the first regexp group of
+`antlr-font-lock-literal-regexp'."
+  :group 'antlr)
+;; backward-compatibility alias
+(put 'antlr-font-lock-literal-face 'face-alias 'antlr-literal)
+(put 'antlr-font-lock-literal-face 'obsolete-face "22.1")
+
+(defcustom antlr-font-lock-literal-regexp "\"\\(\\sw\\(\\sw\\|-\\)*\\)\""
+  "Regexp matching literals with special syntax highlighting, or nil.
+If nil, there is no special syntax highlighting for some literals.
+Otherwise, it should be a regular expression which must contain a regexp
+group.  The string matched by the first group is highlighted with
+`antlr-font-lock-literal-face'."
+  :group 'antlr
+  :type '(choice (const :tag "None" nil) regexp))
+
+(defvar antlr-class-header-regexp
+  "\\(class\\)[ \t]+\\([A-Za-z\300-\326\330-\337]\\sw*\\)[ \t]+\\(extends\\)[ \t]+\\([A-Za-z\300-\326\330-\337]\\sw*\\)[ \t]*;"
+  "Regexp matching class headers.")
+
+(defvar antlr-font-lock-additional-keywords
+  (cond-emacs-xemacs
+   `((antlr-invalidate-context-cache)
+     ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))"
+      (1 antlr-tokendef-face))
+     ("\\$\\sw+" (0 antlr-keyword-face))
+     ;; the tokens are already fontified as string/docstrings:
+     (,(lambda (limit)
+        (if antlr-font-lock-literal-regexp
+            (antlr-re-search-forward antlr-font-lock-literal-regexp limit)))
+      (1 antlr-literal-face t)
+      :XEMACS (0 nil))                 ; XEmacs bug workaround
+     (,(lambda (limit)
+        (antlr-re-search-forward antlr-class-header-regexp limit))
+      (1 antlr-keyword-face)
+      (2 antlr-ruledef-face)
+      (3 antlr-keyword-face)
+      (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser"))
+            antlr-keyword-face
+          font-lock-type-face)))
+     (,(lambda (limit)
+        (antlr-re-search-forward
+         "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>"
+         limit))
+     (1 antlr-keyword-face))
+     (,(lambda (limit)
+        (antlr-re-search-forward
+         "^\\(private\\|public\\|protected\\)\\>[ \t]*\\(\\(\\sw+[ \t]*\\(:\\)?\\)\\)?"
+         limit))
+     (1 font-lock-type-face)           ; not XEmacs's java level-3 fruit salad
+     (3 (if (antlr-upcase-p (char-after (match-beginning 3)))
+           antlr-tokendef-face
+         antlr-ruledef-face) nil t)
+     (4 antlr-syntax-face nil t))
+     (,(lambda (limit)
+        (antlr-re-search-forward "^\\(\\sw+\\)[ \t]*\\(:\\)?" limit))
+     (1 (if (antlr-upcase-p (char-after (match-beginning 0)))
+           antlr-tokendef-face
+         antlr-ruledef-face) nil t)
+     (2 antlr-syntax-face nil t))
+     (,(lambda (limit)
+        ;; v:ruleref and v:"literal" is allowed...
+        (antlr-re-search-forward "\\(\\sw+\\)[ \t]*\\([=:]\\)?" limit))
+     (1 (if (match-beginning 2)
+           (if (eq (char-after (match-beginning 2)) ?=)
+               antlr-default-face
+             font-lock-variable-name-face)
+         (if (antlr-upcase-p (char-after (match-beginning 1)))
+             antlr-tokenref-face
+           antlr-ruleref-face)))
+     (2 antlr-default-face nil t))
+     (,(lambda (limit)
+        (antlr-re-search-forward "[|&:;(~]\\|)\\([*+?]\\|=>\\)?" limit))
+     (0 antlr-syntax-face))))
+  "Font-lock keywords for ANTLR's normal grammar code.
+See `antlr-font-lock-keywords-alist' for the keywords of actions.")
+
+(defvar antlr-font-lock-defaults
+  '(antlr-font-lock-keywords
+    nil nil ((?_ . "w") (?\( . ".") (?\) . ".")) beginning-of-defun)
+  "Font-lock defaults used for ANTLR syntax highlighting.
+The SYNTAX-ALIST element is also used to initialize
+`antlr-action-syntax-table'.")
+
+
+;;;===========================================================================
+;;;  Internal variables
+;;;===========================================================================
+
+(defvar antlr-mode-hook nil
+  "Hook called by `antlr-mode'.")
+
+(defvar antlr-mode-syntax-table
+  (let ((st (make-syntax-table)))
+    (c-populate-syntax-table st)
+    st)
+  "Syntax table used in `antlr-mode' buffers.
+If non-nil, it will be initialized in `antlr-mode'.")
+
+;; used for "in Java/C++ code" = syntactic-depth>0
+(defvar antlr-action-syntax-table
+  (let ((st (copy-syntax-table antlr-mode-syntax-table))
+        (slist (nth 3 antlr-font-lock-defaults)))
+    (while slist
+      (modify-syntax-entry (caar slist) (cdar slist) st)
+      (setq slist (cdr slist)))
+    st)
+  "Syntax table used for ANTLR action parsing.
+Initialized by `antlr-mode-syntax-table', changed by SYNTAX-ALIST in
+`antlr-font-lock-defaults'.  This table should be selected if you use
+`buffer-syntactic-context' and `buffer-syntactic-context-depth' in order
+not to confuse their context_cache.")
+
+(defvar antlr-mode-abbrev-table nil
+  "Abbreviation table used in `antlr-mode' buffers.")
+(define-abbrev-table 'antlr-mode-abbrev-table ())
+
+(defvar antlr-slow-cache-enabling-symbol 'loudly
+;; Emacs's font-lock changes buffer's tick counter, therefore this value should
+;; be a parameter of a font-lock function, but not any other variable of
+;; functions which call `antlr-slow-syntactic-context'.
+  "If value is a bound symbol, cache will be used even with text changes.
+This is no user option.  Used for `antlr-slow-syntactic-context'.")
+
+(defvar antlr-slow-cache-diff-threshold 5000
+  "Maximum distance between `point' and cache position for cache use.
+Used for `antlr-slow-syntactic-context'.")
+
+
+;;;;##########################################################################
+;;;;  The Code
+;;;;##########################################################################
+
+
+
+;;;===========================================================================
+;;;  Syntax functions -- Emacs vs XEmacs dependent, part 1
+;;;===========================================================================
+
+;; From help.el (XEmacs-21.1), without `copy-syntax-table'
+(defmacro antlr-with-syntax-table (syntab &rest body)
+  "Evaluate BODY with the syntax table SYNTAB."
+  `(let ((stab (syntax-table)))
+     (unwind-protect
+        (progn (set-syntax-table ,syntab) ,@body)
+       (set-syntax-table stab))))
+(put 'antlr-with-syntax-table 'lisp-indent-function 1)
+(put 'antlr-with-syntax-table 'edebug-form-spec '(form body))
+
+(defunx antlr-default-directory ()
+  :xemacs-and-try default-directory
+  "Return `default-directory'."
+  default-directory)
+
+;; Check Emacs-21.1 simple.el, `shell-command'.
+(defunx antlr-read-shell-command (prompt &optional initial-input history)
+  :xemacs-and-try read-shell-command
+  "Read a string from the minibuffer, using `shell-command-history'."
+  (read-from-minibuffer prompt initial-input nil nil
+                       (or history 'shell-command-history)))
+
+(defunx antlr-with-displaying-help-buffer (thunk &optional _name)
+  :xemacs-and-try with-displaying-help-buffer
+  "Make a help buffer and call `thunk' there."
+  (with-output-to-temp-buffer "*Help*"
+    (save-excursion (funcall thunk))))
+
+
+;;;===========================================================================
+;;;  Context cache
+;;;===========================================================================
+
+(defvar antlr-slow-context-cache nil "Internal.")
+
+;;;(defvar antlr-statistics-full-neg 0)
+;;;(defvar antlr-statistics-full-diff 0)
+;;;(defvar antlr-statistics-full-other 0)
+;;;(defvar antlr-statistics-cache 0)
+;;;(defvar antlr-statistics-inval 0)
+
+(defunx antlr-invalidate-context-cache (&rest _dummies)
+;; checkdoc-params: (dummies)
+  "Invalidate context cache for syntactical context information."
+  :XEMACS                              ; XEmacs bug workaround
+  (with-current-buffer (get-buffer-create " ANTLR XEmacs bug workaround")
+    (buffer-syntactic-context-depth)
+    nil)
+  :EMACS
+;;;  (incf antlr-statistics-inval)
+  (setq antlr-slow-context-cache nil))
+
+(defunx antlr-syntactic-context ()
+  "Return some syntactic context information.
+Return `string' if point is within a string, `block-comment' or
+`comment' is point is within a comment or the depth within all
+parenthesis-syntax delimiters at point otherwise.
+WARNING: this may alter `match-data'."
+  :XEMACS
+  (or (buffer-syntactic-context) (buffer-syntactic-context-depth))
+  :EMACS
+  (let ((orig (point)) diff state
+       ;; Arg, Emacs's (buffer-modified-tick) changes with font-lock.  Use
+       ;; hack that `loudly' is bound during font-locking => cache use will
+       ;; increase from 7% to 99.99% during font-locking.
+       (tick (or (boundp antlr-slow-cache-enabling-symbol)
+                 (buffer-modified-tick))))
+    (if (and (cdr antlr-slow-context-cache)
+            (>= (setq diff (- orig (cadr antlr-slow-context-cache))) 0)
+            (< diff antlr-slow-cache-diff-threshold)
+            (eq (current-buffer) (caar antlr-slow-context-cache))
+            (eq tick (cdar antlr-slow-context-cache)))
+       ;; (setq antlr-statistics-cache (1+ antlr-statistics-cache) ...)
+       (setq state (parse-partial-sexp (cadr antlr-slow-context-cache) orig
+                                       nil nil
+                                       (cddr antlr-slow-context-cache)))
+      (if (>= orig antlr-slow-cache-diff-threshold)
+         (beginning-of-defun)
+       (goto-char (point-min)))
+;;;      (cond ((and diff (< diff 0)) (incf antlr-statistics-full-neg))
+;;;        ((and diff (>= diff 3000)) (incf antlr-statistics-full-diff))
+;;;        (t (incf antlr-statistics-full-other)))
+      (setq state (parse-partial-sexp (point) orig)))
+    (goto-char orig)
+    (if antlr-slow-context-cache
+       (setcdr antlr-slow-context-cache (cons orig state))
+      (setq antlr-slow-context-cache
+           (cons (cons (current-buffer) tick)
+                 (cons orig state))))
+    (cond ((nth 3 state) 'string)
+         ((nth 4 state) 'comment)      ; block-comment? -- we don't care
+         (t (car state)))))
+
+;;;  (incf (aref antlr-statistics 2))
+;;;  (unless (and (eq (current-buffer)
+;;;               (caar antlr-slow-context-cache))
+;;;           (eq (buffer-modified-tick)
+;;;               (cdar antlr-slow-context-cache)))
+;;;    (incf (aref antlr-statistics 1))
+;;;    (setq antlr-slow-context-cache nil))
+;;;  (let* ((orig (point))
+;;;     (base (cadr antlr-slow-context-cache))
+;;;     (curr (cddr antlr-slow-context-cache))
+;;;     (state (cond ((eq orig (car curr)) (cdr curr))
+;;;                  ((eq orig (car base)) (cdr base))))
+;;;     diff diff2)
+;;;    (unless state
+;;;      (incf (aref antlr-statistics 3))
+;;;      (when curr
+;;;    (if (< (setq diff  (abs (- orig (car curr))))
+;;;           (setq diff2 (abs (- orig (car base)))))
+;;;        (setq state curr)
+;;;      (setq state base
+;;;            diff  diff2))
+;;;    (if (or (>= (1+ diff) (point)) (>= diff 3000))
+;;;        (setq state nil)))          ; start from bod/bob
+;;;      (if state
+;;;      (setq state
+;;;            (parse-partial-sexp (car state) orig nil nil (cdr state)))
+;;;    (if (>= orig 3000) (beginning-of-defun) (goto-char (point-min)))
+;;;    (incf (aref antlr-statistics 4))
+;;;    (setq cw (list orig (point) base curr))
+;;;    (setq state (parse-partial-sexp (point) orig)))
+;;;      (goto-char orig)
+;;;      (if antlr-slow-context-cache
+;;;      (setcdr (cdr antlr-slow-context-cache) (cons orig state))
+;;;    (setq antlr-slow-context-cache
+;;;          (cons (cons (current-buffer) (buffer-modified-tick))
+;;;                (cons (cons orig state) (cons orig state))))))
+;;;    (cond ((nth 3 state) 'string)
+;;;      ((nth 4 state) 'comment)      ; block-comment? -- we don't care
+;;;      (t (car state)))))
+
+;;;    (beginning-of-defun)
+;;;    (let ((state (parse-partial-sexp (point) orig)))
+;;;      (goto-char orig)
+;;;      (cond ((nth 3 state) 'string)
+;;;        ((nth 4 state) 'comment)    ; block-comment? -- we don't care
+;;;        (t (car state))))))
+
+
+;;;===========================================================================
+;;;  Miscellaneous functions
+;;;===========================================================================
+
+(defun antlr-upcase-p (char)
+  "Non-nil, if CHAR is an uppercase character (if CHAR was a char)."
+  ;; in XEmacs, upcase only works for ASCII
+  (or (and (<= ?A char) (<= char ?Z))
+      (and (<= ?\300 char) (<= char ?\337)))) ; ?\327 is no letter
+
+(defun antlr-re-search-forward (regexp bound)
+  "Search forward from point for regular expression REGEXP.
+Set point to the end of the occurrence found, and return point.  Return
+nil if no occurrence was found.  Do not search within comments, strings
+and actions/semantic predicates.  BOUND bounds the search; it is a
+buffer position.  See also the functions `match-beginning', `match-end'
+and `replace-match'."
+  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
+  (let ((continue t))
+    (while (and (re-search-forward regexp bound 'limit)
+               (save-match-data
+                 (if (eq (antlr-syntactic-context) 0)
+                     (setq continue nil)
+                   t))))
+    (if continue nil (point))))
+
+(defun antlr-search-forward (string)
+  "Search forward from point for STRING.
+Set point to the end of the occurrence found, and return point.  Return
+nil if no occurrence was found.  Do not search within comments, strings
+and actions/semantic predicates."
+  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
+  (let ((continue t))
+    (while (and (search-forward string nil 'limit)
+               (if (eq (antlr-syntactic-context) 0) (setq continue nil) t)))
+    (if continue nil (point))))
+
+(defun antlr-search-backward (string)
+  "Search backward from point for STRING.
+Set point to the beginning of the occurrence found, and return point.
+Return nil if no occurrence was found.  Do not search within comments,
+strings and actions/semantic predicates."
+  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
+  (let ((continue t))
+    (while (and (search-backward string nil 'limit)
+               (if (eq (antlr-syntactic-context) 0) (setq continue nil) t)))
+    (if continue nil (point))))
+
+(defsubst antlr-skip-sexps (count)
+  "Skip the next COUNT balanced expressions and the comments after it.
+Return position before the comments after the last expression."
+  (goto-char (or (ignore-errors-x (scan-sexps (point) count)) (point-max)))
+  (prog1 (point)
+    (antlr-c-forward-sws)))
+
+
+;;;===========================================================================
+;;;  font-lock
+;;;===========================================================================
+
+(defun antlr-font-lock-keywords ()
+  "Return font-lock keywords for current buffer.
+See `antlr-font-lock-additional-keywords', `antlr-language' and
+`antlr-font-lock-maximum-decoration'."
+  (if (eq antlr-font-lock-maximum-decoration 'none)
+      antlr-font-lock-additional-keywords
+    (append antlr-font-lock-additional-keywords
+           (eval (let ((major-mode antlr-language)) ; dynamic
+                       (font-lock-choose-keywords
+                        (cdr (assq antlr-language
+                                   antlr-font-lock-keywords-alist))
+                        (if (eq antlr-font-lock-maximum-decoration 'inherit)
+                            font-lock-maximum-decoration
+                          antlr-font-lock-maximum-decoration)))))))
+
+
+;;;===========================================================================
+;;;  imenu support
+;;;===========================================================================
+
+(defun antlr-grammar-tokens ()
+  "Return alist for tokens defined in current buffer."
+  (save-excursion (antlr-imenu-create-index-function t)))
+
+(defun antlr-imenu-create-index-function (&optional tokenrefs-only)
+  "Return imenu index-alist for ANTLR grammar files.
+IF TOKENREFS-ONLY is non-nil, just return alist with tokenref names."
+  (let ((items nil)
+       (classes nil)
+       (continue t))
+    ;; Using `imenu-progress-message' would require imenu for compilation, but
+    ;; nobody is missing these messages.  The generic imenu function searches
+    ;; backward, which is slower and more likely not to work during editing.
+    (antlr-with-syntax-table antlr-action-syntax-table
+      (antlr-invalidate-context-cache)
+      (goto-char (point-min))
+      (antlr-skip-file-prelude t)
+      (while continue
+       (if (looking-at "{") (antlr-skip-sexps 1))
+       (if (looking-at antlr-class-header-regexp)
+           (or tokenrefs-only
+               (push (cons (match-string 2)
+                           (if imenu-use-markers
+                               (copy-marker (match-beginning 2))
+                             (match-beginning 2)))
+                     classes))
+         (if (looking-at "p\\(ublic\\|rotected\\|rivate\\)")
+             (antlr-skip-sexps 1))
+         (when (looking-at "\\sw+")
+           (if tokenrefs-only
+               (if (antlr-upcase-p (char-after (point)))
+                   (push (list (match-string 0)) items))
+             (push (cons (match-string 0)
+                         (if imenu-use-markers
+                             (copy-marker (match-beginning 0))
+                           (match-beginning 0)))
+                   items))))
+       (if (setq continue (antlr-search-forward ";"))
+           (antlr-skip-exception-part t))))
+    (if classes
+       (cons (cons "Classes" (nreverse classes)) (nreverse items))
+      (nreverse items))))
+
+
+;;;===========================================================================
+;;;  Parse grammar files (internal functions)
+;;;===========================================================================
+
+(defun antlr-skip-exception-part (skip-comment)
+  "Skip exception part of current rule, i.e., everything after `;'.
+This also includes the options and tokens part of a grammar class
+header.  If SKIP-COMMENT is non-nil, also skip the comment after that
+part."
+  (let ((pos (point))
+       (class nil))
+    (antlr-c-forward-sws)
+    (while (looking-at "options\\>\\|tokens\\>")
+      (setq class t)
+      (setq pos (antlr-skip-sexps 2)))
+    (if class
+       ;; Problem: an action only belongs to a class def, not a normal rule.
+       ;; But checking the current rule type is too expensive => only expect
+       ;; an action if we have found an option or tokens part.
+       (if (looking-at "{") (setq pos (antlr-skip-sexps 1)))
+      (while (looking-at "exception\\>")
+       (setq pos (antlr-skip-sexps 1))
+       (when (looking-at "\\[")
+         (setq pos (antlr-skip-sexps 1)))
+       (while (looking-at "catch\\>")
+         (setq pos (antlr-skip-sexps 3)))))
+    (or skip-comment (goto-char pos))))
+
+(defun antlr-skip-file-prelude (skip-comment)
+  "Skip the file prelude: the header and file options.
+If SKIP-COMMENT is non-nil, also skip the comment after that part.
+Return the start position of the file prelude.
+
+Hack: if SKIP-COMMENT is `header-only' only skip header and return
+position before the comment after the header."
+  (let* ((pos (point))
+        (pos0 pos))
+    (antlr-c-forward-sws)
+    (if skip-comment (setq pos0 (point)))
+    (while (looking-at "header\\>[ \t]*\\(\"\\)?")
+      (setq pos (antlr-skip-sexps (if (match-beginning 1) 3 2))))
+    (if (eq skip-comment 'header-only) ; a hack...
+       pos
+      (when (looking-at "options\\>")
+       (setq pos (antlr-skip-sexps 2)))
+      (or skip-comment (goto-char pos))
+      pos0)))
+
+(defun antlr-next-rule (arg skip-comment)
+  "Move forward to next end of rule.  Do it ARG many times.
+A grammar class header and the file prelude are also considered as a
+rule.  Negative argument ARG means move back to ARGth preceding end of
+rule.  The behavior is not defined when ARG is zero.  If SKIP-COMMENT
+is non-nil, move to beginning of the rule."
+  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
+  ;; PRE: ARG<>0
+  (let ((pos (point))
+       (beg (point)))
+    ;; first look whether point is in exception part
+    (if (antlr-search-backward ";")
+       (progn
+         (setq beg (point))
+         (forward-char)
+         (antlr-skip-exception-part skip-comment))
+      (antlr-skip-file-prelude skip-comment))
+    (if (< arg 0)
+       (unless (and (< (point) pos) (zerop (incf arg)))
+         ;; if we have moved backward, we already moved one defun backward
+         (goto-char beg)               ; rewind (to ";" / point)
+         (while (and arg (<= (incf arg) 0))
+           (if (antlr-search-backward ";")
+               (setq beg (point))
+             (when (>= arg -1)
+               ;; try file prelude:
+               (setq pos (antlr-skip-file-prelude skip-comment))
+               (if (zerop arg)
+                   (if (>= (point) beg)
+                       (goto-char (if (>= pos beg) (point-min) pos)))
+                 (goto-char (if (or (>= (point) beg) (= (point) pos))
+                                (point-min) pos))))
+             (setq arg nil)))
+         (when arg                     ; always found a ";"
+           (forward-char)
+           (antlr-skip-exception-part skip-comment)))
+      (if (<= (point) pos)             ; moved backward?
+         (goto-char pos)               ; rewind
+       (decf arg))                     ; already moved one defun forward
+      (unless (zerop arg)
+       (while (>= (decf arg) 0)
+         (antlr-search-forward ";"))
+       (antlr-skip-exception-part skip-comment)))))
+
+(defun antlr-outside-rule-p ()
+  "Non-nil if point is outside a grammar rule.
+Move to the beginning of the current rule if point is inside a rule."
+  ;; WARNING: Should only be used with `antlr-action-syntax-table'!
+  (let ((pos (point)))
+    (antlr-next-rule -1 nil)
+    (let ((between (or (bobp) (< (point) pos))))
+      (antlr-c-forward-sws)
+      (and between (> (point) pos) (goto-char pos)))))
+
+
+;;;===========================================================================
+;;;  Parse grammar files (commands)
+;;;===========================================================================
+;; No (interactive "_") in Emacs... use `zmacs-region-stays'.
+
+(defun antlr-inside-rule-p ()
+  "Non-nil if point is inside a grammar rule.
+A grammar class header and the file prelude are also considered as a
+rule."
+  (save-excursion
+    (antlr-with-syntax-table antlr-action-syntax-table
+      (not (antlr-outside-rule-p)))))
+
+(defunx antlr-end-of-rule (&optional arg)
+  "Move forward to next end of rule.  Do it ARG [default: 1] many times.
+A grammar class header and the file prelude are also considered as a
+rule.  Negative argument ARG means move back to ARGth preceding end of
+rule.  If ARG is zero, run `antlr-end-of-body'."
+  (interactive "_p")
+  (if (zerop arg)
+      (antlr-end-of-body)
+    (antlr-with-syntax-table antlr-action-syntax-table
+      (antlr-next-rule arg nil))))
+
+(defunx antlr-beginning-of-rule (&optional arg)
+  "Move backward to preceding beginning of rule.  Do it ARG many times.
+A grammar class header and the file prelude are also considered as a
+rule.  Negative argument ARG means move forward to ARGth next beginning
+of rule.  If ARG is zero, run `antlr-beginning-of-body'."
+  (interactive "_p")
+  (if (zerop arg)
+      (antlr-beginning-of-body)
+    (antlr-with-syntax-table antlr-action-syntax-table
+      (antlr-next-rule (- arg) t))))
+
+(defunx antlr-end-of-body (&optional msg)
+  "Move to position after the `;' of the current rule.
+A grammar class header is also considered as a rule.  With optional
+prefix arg MSG, move to `:'."
+  (interactive "_")
+  (antlr-with-syntax-table antlr-action-syntax-table
+    (let ((orig (point)))
+      (if (antlr-outside-rule-p)
+         (error "Outside an ANTLR rule"))
+      (let ((bor (point)))
+       (when (< (antlr-skip-file-prelude t) (point))
+         ;; Yes, we are in the file prelude
+         (goto-char orig)
+         (error (or msg "The file prelude is without `;'")))
+       (antlr-search-forward ";")
+       (when msg
+         (when (< (point)
+                  (progn (goto-char bor)
+                         (or (antlr-search-forward ":") (point-max))))
+           (goto-char orig)
+           (error msg))
+         (antlr-c-forward-sws))))))
+
+(defunx antlr-beginning-of-body ()
+  "Move to the first element after the `:' of the current rule."
+  (interactive "_")
+  (antlr-end-of-body "Class headers and the file prelude are without `:'"))
+
+
+;;;===========================================================================
+;;;  Literal normalization, Hide Actions
+;;;===========================================================================
+
+(defun antlr-downcase-literals (&optional transform)
+  "Convert all literals in buffer to lower case.
+If non-nil, TRANSFORM is used on literals instead of `downcase-region'."
+  (interactive)
+  (or transform (setq transform 'downcase-region))
+  (let ((literals 0))
+    (save-excursion
+      (goto-char (point-min))
+      (antlr-with-syntax-table antlr-action-syntax-table
+       (antlr-invalidate-context-cache)
+       (while (antlr-re-search-forward "\"\\(\\sw\\(\\sw\\|-\\)*\\)\"" nil)
+         (funcall transform (match-beginning 0) (match-end 0))
+         (incf literals))))
+    (message "Transformed %d literals" literals)))
+
+(defun antlr-upcase-literals ()
+  "Convert all literals in buffer to upper case."
+  (interactive)
+  (antlr-downcase-literals 'upcase-region))
+
+(defun antlr-hide-actions (arg &optional silent)
+  "Hide or unhide all actions in buffer.
+Hide all actions including arguments in brackets if ARG is 1 or if
+called interactively without prefix argument.  Hide all actions
+excluding arguments in brackets if ARG is 2 or higher.  Unhide all
+actions if ARG is 0 or negative.  See `antlr-action-visibility'.
+
+Display a message unless optional argument SILENT is non-nil."
+  (interactive "p")
+  (save-buffer-state-x
+    (if (> arg 0)
+       (let ((regexp (if (= arg 1) "[]}]" "}"))
+             (diff (and antlr-action-visibility
+                        (+ (max antlr-action-visibility 0) 2))))
+         (antlr-hide-actions 0 t)
+         (save-excursion
+           (goto-char (point-min))
+           (antlr-with-syntax-table antlr-action-syntax-table
+             (antlr-invalidate-context-cache)
+             (while (antlr-re-search-forward regexp nil)
+               (let ((beg (ignore-errors-x (scan-sexps (point) -1))))
+                 (when beg
+                   (if diff            ; braces are visible
+                       (if (> (point) (+ beg diff))
+                           (add-text-properties (1+ beg) (1- (point))
+                                                '(invisible t intangible t)))
+                     ;; if actions is on line(s) of its own, hide WS
+                     (and (looking-at "[ \t]*$")
+                          (save-excursion
+                            (goto-char beg)
+                            (skip-chars-backward " \t")
+                            (and (bolp) (setq beg (point))))
+                          (beginning-of-line 2)) ; beginning of next line
+                     (add-text-properties beg (point)
+                                          '(invisible t intangible t))))))))
+         (or silent
+             (message "Hide all actions (%s arguments)...done"
+                      (if (= arg 1) "including" "excluding"))))
+      (remove-text-properties (point-min) (point-max)
+                             '(invisible nil intangible nil))
+      (or silent
+         (message "Unhide all actions (including arguments)...done")))))
+
+
+;;;===========================================================================
+;;;  Insert option: command
+;;;===========================================================================
+
+(defun antlr-insert-option (level option &optional location)
+  "Insert file/grammar/rule/subrule option near point.
+LEVEL determines option kind to insert: 1=file, 2=grammar, 3=rule,
+4=subrule.  OPTION is a string with the name of the option to insert.
+LOCATION can be specified for not calling `antlr-option-kind' twice.
+
+Inserting an option with this command works as follows:
+
+ 1. When called interactively, LEVEL is determined by the prefix
+    argument or automatically deduced without prefix argument.
+ 2. Signal an error if no option of that level could be inserted, e.g.,
+    if the buffer is read-only, the option area is outside the visible
+    part of the buffer or a subrule/rule option should be inserted with
+    point outside a subrule/rule.
+ 3. When called interactively, OPTION is read from the minibuffer with
+    completion over the known options of the given LEVEL.
+ 4. Ask user for confirmation if the given OPTION does not seem to be a
+    valid option to insert into the current file.
+ 5. Find a correct position to insert the option.
+ 6. Depending on the option, insert it the following way \(inserting an
+    option also means inserting the option section if necessary\):
+     - Insert the option and let user insert the value at point.
+     - Read a value (with completion) from the minibuffer, using a
+       previous value as initial contents, and insert option with value.
+ 7. Final action depending on the option.  For example, set the language
+    according to a newly inserted language option.
+
+The name of all options with a specification for their values are stored
+in `antlr-options-alists'.  The used specification also depends on the
+value of `antlr-tool-version', i.e., step 4 will warn you if you use an
+option that has been introduced in newer version of ANTLR, and step 5
+will offer completion using version-correct values.
+
+If the option already exists inside the visible part of the buffer, this
+command can be used to change the value of that option.  Otherwise, find
+a correct position where the option can be inserted near point.
+
+The search for a correct position is as follows:
+
+  * If search is within an area where options can be inserted, use the
+    position of point.  Inside the options section and if point is in
+    the middle of a option definition, skip the rest of it.
+  * If an options section already exists, insert the options at the end.
+    If only the beginning of the area is visible, insert at the
+    beginning.
+  * Otherwise, find the position where an options section can be
+    inserted and insert a new section before any comments.  If the
+    position before the comments is not visible, insert the new section
+    after the comments.
+
+This function also inserts \"options {...}\" and the \":\" if necessary,
+see `antlr-options-auto-colon'.  See also `antlr-options-assign-string'.
+
+This command might also set the mark like \\[set-mark-command] does, see
+`antlr-options-push-mark'."
+  (interactive (antlr-insert-option-interactive current-prefix-arg))
+  (barf-if-buffer-read-only)
+  (or location (setq location (cdr (antlr-option-kind level))))
+  (cond ((null level)
+        (error "Cannot deduce what kind of option to insert"))
+       ((atom location)
+        (error "Cannot insert any %s options around here"
+               (elt antlr-options-headings (1- level)))))
+  (let ((area (car location))
+       (place (cdr location)))
+    (cond ((null place)                ; invisible
+          (error (if area
+                     "Invisible %s options, use %s to make them visible"
+                   "Invisible area for %s options, use %s to make it visible")
+                 (elt antlr-options-headings (1- level))
+                 (substitute-command-keys "\\[widen]")))
+         ((null area)                  ; without option part
+          (antlr-insert-option-do level option nil
+                                  (null (cdr place))
+                                  (car place)))
+         ((save-excursion              ; with option part, option visible
+            (goto-char (max (point-min) (car area)))
+            (re-search-forward (concat "\\(^\\|;\\)[ \t]*\\(\\<"
+                                       (regexp-quote option)
+                                       "\\>\\)[ \t\n]*\\(\\(=[ \t]?\\)[ \t]*\\(\\(\\sw\\|\\s_\\)+\\|\"\\([^\n\"\\]\\|[\\][^\n]\\)*\"\\)?\\)?")
+                               ;; 2=name, 3=4+5, 4="=", 5=value
+                               (min (point-max) (cdr area))
+                               t))
+          (antlr-insert-option-do level option
+                                  (cons (or (match-beginning 5)
+                                            (match-beginning 3))
+                                        (match-end 5))
+                                  (and (null (cdr place)) area)
+                                  (or (match-beginning 5)
+                                      (match-end 4)
+                                      (match-end 2))))
+         (t                            ; with option part, option not yet
+          (antlr-insert-option-do level option t
+                                  (and (null (cdr place)) area)
+                                  (car place))))))
+
+(defun antlr-insert-option-interactive (arg)
+  "Interactive specification for `antlr-insert-option'.
+Return \(LEVEL OPTION LOCATION)."
+  (barf-if-buffer-read-only)
+  (if arg (setq arg (prefix-numeric-value arg)))
+  (unless (memq arg '(nil 1 2 3 4))
+    (error "Valid prefix args: no=auto, 1=file, 2=grammar, 3=rule, 4=subrule"))
+  (let* ((kind (antlr-option-kind arg))
+        (level (car kind)))
+    (if (atom (cdr kind))
+       (list level nil (cdr kind))
+      (let* ((table (elt antlr-options-alists (1- level)))
+            (completion-ignore-case t) ;dynamic
+            (input (completing-read (format "Insert %s option: "
+                                            (elt antlr-options-headings
+                                                 (1- level)))
+                                    table)))
+       (list level input (cdr kind))))))
+
+(defun antlr-options-menu-filter (level _menu-items)
+  "Return items for options submenu of level LEVEL."
+  ;; checkdoc-params: (menu-items)
+  (let ((active (if buffer-read-only
+                   nil
+                 (consp (cdr-safe (cdr (antlr-option-kind level)))))))
+    (mapcar (lambda (option)
+             (vector option
+                     (list 'antlr-insert-option level option)
+                     :active active))
+           (sort (mapcar 'car (elt antlr-options-alists (1- level)))
+                 'string-lessp))))
+
+
+;;;===========================================================================
+;;;  Insert option: determine section-kind
+;;;===========================================================================
+
+(defun antlr-option-kind (requested)
+  "Return level and location for option to insert near point.
+Call function `antlr-option-level' with argument REQUESTED.  If the
+result is nil, return \(REQUESTED \. error).  If the result has the
+non-nil value LEVEL, return \(LEVEL \. LOCATION) where LOCATION looks
+like \(AREA \. PLACE), see `antlr-option-location'."
+  (save-excursion
+    (save-restriction
+      (let ((min0 (point-min))         ; before `widen'!
+           (max0 (point-max))
+           (orig (point))
+           (level (antlr-option-level requested)) ; calls `widen'!
+           pos)
+       (cond ((null level)
+              (setq level requested))
+             ((eq level 1)             ; file options
+              (goto-char (point-min))
+              (setq pos (antlr-skip-file-prelude 'header-only)))
+             ((not (eq level 3))       ; grammar or subrule options
+              (setq pos (point))
+              (antlr-c-forward-sws))
+             ((looking-at "^\\(private[ \t\n]\\|public[ \t\n]\\|protected[ \t\n]\\)?[ \t\n]*\\(\\(\\sw\\|\\s_\\)+\\)[ \t\n]*\\(!\\)?[ \t\n]*\\(\\[\\)?")
+              ;; rule options, with complete rule header
+              (goto-char (or (match-end 4) (match-end 3)))
+              (setq pos (antlr-skip-sexps (if (match-end 5) 1 0)))
+              (when (looking-at "returns[ \t\n]*\\[")
+                (goto-char (1- (match-end 0)))
+                (setq pos (antlr-skip-sexps 1)))))
+       (cons level
+             (cond ((null pos) 'error)
+                   ((looking-at "options[ \t\n]*{")
+                    (goto-char (match-end 0))
+                    (setq pos (ignore-errors-x (scan-lists (point) 1 1)))
+                    (antlr-option-location orig min0 max0
+                                           (point)
+                                           (if pos (1- pos) (point-max))
+                                           t))
+                   (t
+                    (antlr-option-location orig min0 max0
+                                           pos (point)
+                                           nil))))))))
+
+(defun antlr-option-level (requested)
+  "Return level for option to insert near point.
+Remove any restrictions from current buffer and return level for the
+option to insert near point, i.e., 1, 2, 3, 4, or nil if no such option
+can be inserted.  If REQUESTED is non-nil, it is the only possible value
+to return except nil.  If REQUESTED is nil, return level for the nearest
+option kind, i.e., the highest number possible.
+
+If the result is 2, point is at the beginning of the class after the
+class definition.  If the result is 3 or 4, point is at the beginning of
+the rule/subrule after the init action.  Otherwise, the point position
+is undefined."
+  (widen)
+  (if (eq requested 1)
+      1
+    (antlr-with-syntax-table antlr-action-syntax-table
+      (antlr-invalidate-context-cache)
+      (let* ((orig (point))
+            (outsidep (antlr-outside-rule-p))
+            bor depth)
+       (if (eq (char-after) ?\{) (antlr-skip-sexps 1))
+       (setq bor (point))              ; beginning of rule (after init action)
+       (cond ((eq requested 2)         ; grammar options required?
+              (let (boc)               ; beginning of class
+                (goto-char (point-min))
+                (while (and (<= (point) bor)
+                            (antlr-re-search-forward antlr-class-header-regexp
+                                                     nil))
+                  (if (<= (match-beginning 0) bor)
+                      (setq boc (match-end 0))))
+                (when boc
+                  (goto-char boc)
+                  2)))
+             ((save-excursion          ; in region of file options?
+                (goto-char (point-min))
+                (antlr-skip-file-prelude t) ; ws/comment after: OK
+                (< orig (point)))
+              (and (null requested) 1))
+             (outsidep                 ; outside rule not OK
+              nil)
+             ((looking-at antlr-class-header-regexp) ; rule = class def?
+              (goto-char (match-end 0))
+              (and (null requested) 2))
+             ((eq requested 3)         ; rule options required?
+              (goto-char bor)
+              3)
+             ((setq depth (antlr-syntactic-grammar-depth orig bor))
+              (if (> depth 0)          ; move out of actions
+                  (goto-char (scan-lists (point) -1 depth)))
+              (set-syntax-table antlr-mode-syntax-table)
+              (antlr-invalidate-context-cache)
+              (if (eq (antlr-syntactic-context) 0) ; not in subrule?
+                  (unless (eq requested 4)
+                    (goto-char bor)
+                    3)
+                (goto-char (1+ (scan-lists (point) -1 1)))
+                4)))))))
+
+(defun antlr-option-location (orig min-vis max-vis min-area max-area withp)
+  "Return location for the options area.
+ORIG is the original position of `point', MIN-VIS is `point-min' and
+MAX-VIS is `point-max'.  If WITHP is non-nil, there exists an option
+specification and it starts after the brace at MIN-AREA and stops at
+MAX-AREA.  If WITHP is nil, there is no area and the region where it
+could be inserted starts at MIN-AREA and stops at MAX-AREA.
+
+The result has the form (AREA . PLACE).  AREA is (MIN-AREA . MAX-AREA)
+if WITHP is non-nil, and nil otherwise.  PLACE is nil if the area is
+invisible, (ORIG) if ORIG is inside the area, (MIN-AREA . beginning) for
+a visible start position and (MAX-AREA . end) for a visible end position
+where the beginning is preferred if WITHP is nil and the end if WITHP is
+non-nil."
+  (cons (and withp (cons min-area max-area))
+       (cond ((and (<= min-area orig) (<= orig max-area)
+                   (save-excursion
+                     (goto-char orig)
+                     (not (memq (antlr-syntactic-context)
+                                '(comment block-comment)))))
+              ;; point in options area and not in comment
+              (list orig))
+             ((and (null withp) (<= min-vis min-area) (<= min-area max-vis))
+              ;; use start of options area (only if not `withp')
+              (cons min-area 'beginning))
+             ((and (<= min-vis max-area) (<= max-area max-vis))
+              ;; use end of options area
+              (cons max-area 'end))
+             ((and withp (<= min-vis min-area) (<= min-area max-vis))
+              ;; use start of options area (only if `withp')
+              (cons min-area 'beginning)))))
+
+(defun antlr-syntactic-grammar-depth (pos beg)
+  "Return syntactic context depth at POS.
+Move to POS and from there on to the beginning of the string or comment
+if POS is inside such a construct.  Then, return the syntactic context
+depth at point if the point position is smaller than BEG.
+WARNING: this may alter `match-data'."
+  (goto-char pos)
+  (let ((context (or (antlr-syntactic-context) 0)))
+    (while (and context (not (integerp context)))
+      (cond ((eq context 'string)
+            (setq context
+                  (and (search-backward "\"" nil t)
+                       (>= (point) beg)
+                       (or (antlr-syntactic-context) 0))))
+           ((memq context '(comment block-comment))
+            (setq context
+                  (and (re-search-backward "/[/*]" nil t)
+                       (>= (point) beg)
+                       (or (antlr-syntactic-context) 0))))))
+    context))
+
+
+;;;===========================================================================
+;;;  Insert options: do the insertion
+;;;===========================================================================
+
+(defun antlr-insert-option-do (level option old area pos)
+  "Insert option into buffer at position POS.
+Insert option of level LEVEL and name OPTION.  If OLD is non-nil, an
+options area is already exists.  If OLD looks like \(BEG \. END), the
+option already exists.  Then, BEG is the start position of the option
+value, the position of the `=' or nil, and END is the end position of
+the option value or nil.
+
+If the original point position was outside an options area, AREA is nil.
+Otherwise, and if an option specification already exists, AREA is a cons
+cell where the two values determine the area inside the braces."
+  (let* ((spec (cdr (assoc option (elt antlr-options-alists (1- level)))))
+        (value (antlr-option-spec level option (cdr spec) (consp old))))
+    (if (fboundp (car spec)) (funcall (car spec) 'before-input option))
+    ;; set mark (unless point was inside options area before)
+    (if (cond (area (eq antlr-options-push-mark t))
+             ((numberp antlr-options-push-mark)
+              (> (count-lines (min (point) pos) (max (point) pos))
+                 antlr-options-push-mark))
+             (antlr-options-push-mark))
+       (push-mark))
+    ;; read option value -----------------------------------------------------
+    (goto-char pos)
+    (if (null value)
+       ;; no option specification found
+       (if (y-or-n-p (format "Insert unknown %s option %s? "
+                             (elt antlr-options-headings (1- level))
+                             option))
+           (message "Insert value for %s option %s"
+                    (elt antlr-options-headings (1- level))
+                    option)
+         (error "Didn't insert unknown %s option %s"
+                (elt antlr-options-headings (1- level))
+                option))
+      ;; option specification found
+      (setq value (cdr value))
+      (if (car value)
+         (let ((initial (and (consp old) (cdr old)
+                             (buffer-substring (car old) (cdr old)))))
+           (setq value (apply (car value)
+                              (and initial
+                                   (if (eq (aref initial 0) ?\")
+                                       (read initial)
+                                     initial))
+                              (cdr value))))
+       (message "%s" (or (cadr value) ""))
+       (setq value nil)))
+    ;; insert value ----------------------------------------------------------
+    (if (consp old)
+       (antlr-insert-option-existing old value)
+      (if (consp area)
+         ;; Move outside string/comment if point is inside option spec
+         (antlr-syntactic-grammar-depth (point) (car area)))
+      (antlr-insert-option-space area old)
+      (or old (antlr-insert-option-area level))
+      (insert option " = ;")
+      (backward-char)
+      (if value (insert value)))
+    ;; final -----------------------------------------------------------------
+    (if (fboundp (car spec)) (funcall (car spec) 'after-insertion option))))
+
+(defun antlr-option-spec (level option specs existsp)
+  "Return version correct option value specification.
+Return specification for option OPTION of kind level LEVEL.  SPECS
+should correspond to the VALUE-SPEC... in `antlr-option-alists'.
+EXISTSP determines whether the option already exists."
+  (let (value)
+    (while (and specs (>= antlr-tool-version (caar specs)))
+      (setq value (pop specs)))
+    (cond (value)                      ; found correct spec
+         ((null specs) nil)            ; didn't find any specs
+         (existsp (car specs)) ; wrong version, but already present
+         ((y-or-n-p (format "Insert v%s %s option %s in v%s? "
+                            (antlr-version-string (caar specs))
+                            (elt antlr-options-headings (1- level))
+                            option
+                            (antlr-version-string antlr-tool-version)))
+          (car specs))
+         (t
+          (error "Didn't insert v%s %s option %s in v%s"
+                 (antlr-version-string (caar specs))
+                 (elt antlr-options-headings (1- level))
+                 option
+                 (antlr-version-string antlr-tool-version))))))
+
+(defun antlr-version-string (version)
+  "Format the Antlr version number VERSION, see `antlr-tool-version'."
+  (let ((version100 (/ version 100)))
+    (format "%d.%d.%d"
+           (/ version100 100) (mod version100 100) (mod version 100))))
+
+
+;;;===========================================================================
+;;;  Insert options: the details (used by `antlr-insert-option-do')
+;;;===========================================================================
+
+(defun antlr-insert-option-existing (old value)
+  "Insert option value VALUE at point for existing option.
+For OLD, see `antlr-insert-option-do'."
+  ;; no = => insert =
+  (unless (car old) (insert antlr-options-assign-string))
+  ;; with user input => insert if necessary
+  (when value
+    (if (cdr old)              ; with value
+       (if (string-equal value (buffer-substring (car old) (cdr old)))
+           (goto-char (cdr old))
+         (delete-region (car old) (cdr old))
+         (insert value))
+      (insert value)))
+  (unless (looking-at "\\([^\n=;{}/'\"]\\|'\\([^\n'\\]\\|\\\\.\\)*'\\|\"\\([^\n\"\\]\\|\\\\.\\)*\"\\)*;")
+    ;; stuff (no =, {, } or /) at point is not followed by ";"
+    (insert ";")
+    (backward-char)))
+
+(defun antlr-insert-option-space (area old)
+  "Find appropriate place to insert option, insert newlines/spaces.
+For AREA and OLD, see `antlr-insert-option-do'."
+  (let ((orig (point))
+       (open t))
+    (skip-chars-backward " \t")
+    (unless (bolp)
+      (let ((before (char-after (1- (point)))))
+       (goto-char orig)
+       (and old                        ; with existing options area
+            (consp area)               ; if point inside existing area
+            (not (eq before ?\;))      ; if not at beginning of option
+                                       ; => skip to end of option
+            (if (and (search-forward ";" (cdr area) t)
+                     (let ((context (antlr-syntactic-context)))
+                       (or (null context) (numberp context))))
+                (setq orig (point))
+              (goto-char orig)))
+       (skip-chars-forward " \t")
+
+       (if (looking-at "$\\|//")
+           ;; just comment after point => skip (+ lines w/ same col comment)
+           (let ((same (if (> (match-end 0) (match-beginning 0))
+                           (current-column))))
+             (beginning-of-line 2)
+             (or (bolp) (insert "\n"))
+             (when (and same (null area)) ; or (consp area)?
+               (while (and (looking-at "[ \t]*\\(//\\)")
+                           (goto-char (match-beginning 1))
+                           (= (current-column) same))
+                 (beginning-of-line 2)
+                 (or (bolp) (insert "\n")))))
+         (goto-char orig)
+         (if (null old)
+             (progn (insert "\n") (antlr-indent-line))
+           (unless (eq (char-after (1- (point))) ?\ )
+             (insert " "))
+           (unless (eq (char-after (point)) ?\ )
+             (insert " ")
+             (backward-char))
+           (setq open nil)))))
+    (when open
+      (beginning-of-line 1)
+      (insert "\n")
+      (backward-char)
+      (antlr-indent-line))))
+
+(defun antlr-insert-option-area (level)
+  "Insert new options area for options of level LEVEL.
+Used by `antlr-insert-option-do'."
+  (insert "options {\n\n}")
+  (when (and antlr-options-auto-colon
+            (memq level '(3 4))
+            (save-excursion
+              (antlr-c-forward-sws)
+              (if (eq (char-after (point)) ?\{) (antlr-skip-sexps 1))
+              (not (eq (char-after (point)) ?\:))))
+    (insert "\n:")
+    (antlr-indent-line)
+    (end-of-line 0))
+  (backward-char 1)
+  (antlr-indent-line)
+  (beginning-of-line 0)
+  (antlr-indent-line))
+
+
+;;;===========================================================================
+;;;  Insert options: in `antlr-options-alists'
+;;;===========================================================================
+
+(defun antlr-read-value (initial-contents prompt
+                                         &optional as-string table table-x)
+  "Read a string from the minibuffer, possibly with completion.
+If INITIAL-CONTENTS is non-nil, insert it in the minibuffer initially.
+PROMPT is a string to prompt with, normally it ends in a colon and a
+space.  If AS-STRING is t or is a member \(comparison done with `eq') of
+`antlr-options-style', return printed representation of the user input,
+otherwise return the user input directly.
+
+If TABLE or TABLE-X is non-nil, read with completion.  The completion
+table is the resulting alist of TABLE-X concatenated with TABLE where
+TABLE can also be a function evaluation to an alist.
+
+Used inside `antlr-options-alists'."
+  (let* ((completion-ignore-case t)    ; dynamic
+        (table0 (and (or table table-x)
+                     (append table-x
+                             (if (functionp table) (funcall table) table))))
+        (input (if table0
+                   (completing-read prompt table0 nil nil initial-contents)
+                 (read-from-minibuffer prompt initial-contents))))
+    (if (and as-string
+            (or (eq as-string t)
+                (cdr (assq as-string antlr-options-style))))
+       (format "%S" input)
+      input)))
+
+(defun antlr-read-boolean (initial-contents prompt &optional table)
+  "Read a boolean value from the minibuffer, with completion.
+If INITIAL-CONTENTS is non-nil, insert it in the minibuffer initially.
+PROMPT is a string to prompt with, normally it ends in a question mark
+and a space.  \"(true or false) \" is appended if TABLE is nil.
+
+Read with completion over \"true\", \"false\" and the keys in TABLE, see
+also `antlr-read-value'.
+
+Used inside `antlr-options-alists'."
+  (antlr-read-value initial-contents
+                   (if table prompt (concat prompt "(true or false) "))
+                   nil
+                   table '(("false") ("true"))))
+
+(defun antlr-language-option-extra (phase &rest _dummies)
+;; checkdoc-params: (dummies)
+  "Change language according to the new value of the \"language\" option.
+Call `antlr-mode' if the new language would be different from the value
+of `antlr-language', keeping the value of variable `font-lock-mode'.
+
+Called in PHASE `after-insertion', see `antlr-options-alists'."
+  (when (eq phase 'after-insertion)
+    (let ((new-language (antlr-language-option t)))
+      (or (null new-language)
+         (eq new-language antlr-language)
+         (let ((font-lock (and (boundp 'font-lock-mode) font-lock-mode)))
+           (if font-lock (font-lock-mode 0))
+           (antlr-mode)
+           (and font-lock (null font-lock-mode) (font-lock-mode 1)))))))
+
+(defun antlr-c++-mode-extra (phase option &rest _dummies)
+;; checkdoc-params: (option dummies)
+  "Warn if C++ option is used with the wrong language.
+Ask user \(\"y or n\"), if a C++ only option is going to be inserted but
+`antlr-language' has not the value `c++-mode'.
+
+Called in PHASE `before-input', see `antlr-options-alists'."
+  (and (eq phase 'before-input)
+       (not (eq antlr-language 'c++-mode))
+       (not (y-or-n-p (format "Insert C++ %s option? " option)))
+       (error "Didn't insert C++ %s option with language %s"
+             option (cadr (assq antlr-language antlr-language-alist)))))
+
+
+;;;===========================================================================
+;;;  Compute dependencies
+;;;===========================================================================
+
+(defun antlr-file-dependencies ()
+  "Return dependencies for grammar in current buffer.
+The result looks like \(FILE \(CLASSES \. SUPERS) VOCABS \. LANGUAGE)
+  where CLASSES = ((CLASS . CLASS-EVOCAB) ...),
+        SUPERS  = ((SUPER . USE-EVOCAB-P) ...), and
+        VOCABS  = ((EVOCAB ...) . (IVOCAB ...))
+
+FILE is the current buffer's file-name without directory part and
+LANGUAGE is the value of `antlr-language' in the current buffer.  Each
+EVOCAB is an export vocabulary and each IVOCAB is an import vocabulary.
+
+Each CLASS is a grammar class with its export vocabulary CLASS-EVOCAB.
+Each SUPER is a super-grammar class where USE-EVOCAB-P indicates whether
+its export vocabulary is used as an import vocabulary."
+  (unless buffer-file-name
+    (error "Grammar buffer does not visit a file"))
+  (let (classes export-vocabs import-vocabs superclasses default-vocab)
+    (antlr-with-syntax-table antlr-action-syntax-table
+      (goto-char (point-min))
+      (while (antlr-re-search-forward antlr-class-header-regexp nil)
+       ;; parse class definition --------------------------------------------
+       (let* ((class (match-string 2))
+              (sclass (match-string 4))
+              ;; export vocab defaults to class name (first grammar in file)
+              ;; or to the export vocab of the first grammar in file:
+              (evocab (or default-vocab class))
+              (ivocab nil))
+         (goto-char (match-end 0))
+         (antlr-c-forward-sws)
+         (while (looking-at "options\\>\\|\\(tokens\\)\\>")
+           (if (match-beginning 1)
+               (antlr-skip-sexps 2)
+             (goto-char (match-end 0))
+             (antlr-c-forward-sws)
+             ;; parse grammar option sections -------------------------------
+             (when (eq (char-after (point)) ?\{)
+               (let* ((beg (1+ (point)))
+                      (end (1- (antlr-skip-sexps 1)))
+                      (cont (point)))
+               (goto-char beg)
+               (if (re-search-forward "\\<exportVocab[ \t]*=[ \t]*\\([A-Za-z\300-\326\330-\337]\\sw*\\)" end t)
+                   (setq evocab (match-string 1)))
+               (goto-char beg)
+               (if (re-search-forward "\\<importVocab[ \t]*=[ \t]*\\([A-Za-z\300-\326\330-\337]\\sw*\\)" end t)
+                   (setq ivocab (match-string 1)))
+               (goto-char cont)))))
+         (unless (member sclass '("Parser" "Lexer" "TreeParser"))
+           (let ((super (assoc sclass superclasses)))
+             (if super
+                 (or ivocab (setcdr super t))
+               (push (cons sclass (null ivocab)) superclasses))))
+         ;; remember class with export vocabulary:
+         (push (cons class evocab) classes)
+         ;; default export vocab is export vocab of first grammar in file:
+         (or default-vocab (setq default-vocab evocab))
+         (or (member evocab export-vocabs) (push evocab export-vocabs))
+         (or (null ivocab)
+             (member ivocab import-vocabs) (push ivocab import-vocabs)))))
+    (if classes
+       (list* (file-name-nondirectory buffer-file-name)
+              (cons (nreverse classes) (nreverse superclasses))
+              (cons (nreverse export-vocabs) (nreverse import-vocabs))
+              antlr-language))))
+
+(defun antlr-directory-dependencies (dirname)
+  "Return dependencies for all grammar files in directory DIRNAME.
+The result looks like \((CLASS-SPEC ...) \. \(FILE-DEP ...))
+  where CLASS-SPEC = (CLASS (FILE \. EVOCAB) ...).
+
+FILE-DEP are the dependencies for each grammar file in DIRNAME, see
+`antlr-file-dependencies'.  For each grammar class CLASS, FILE is a
+grammar file in which CLASS is defined and EVOCAB is the name of the
+export vocabulary specified in that file."
+  (let ((grammar (directory-files dirname t "\\.g\\'")))
+    (when grammar
+      (let ((antlr-imenu-name nil)             ; dynamic-let: no imenu
+           (expanded-regexp
+             (concat (format (regexp-quote
+                              (cadr antlr-special-file-formats))
+                             ".+")
+                     "\\'"))
+           classes dependencies)
+        (with-temp-buffer
+          (dolist (file grammar)
+            (when (and (file-regular-p file)
+                       (null (string-match expanded-regexp file)))
+              (insert-file-contents file t nil nil t)
+              (normal-mode t)           ; necessary for major-mode, syntax
+                                       ; table and `antlr-language'
+              (when (derived-mode-p 'antlr-mode)
+                (let* ((file-deps (antlr-file-dependencies))
+                       (file (car file-deps)))
+                  (when file-deps
+                    (dolist (class-def (caadr file-deps))
+                      (let ((file-evocab (cons file (cdr class-def)))
+                            (class-spec (assoc (car class-def) classes)))
+                        (if class-spec
+                            (nconc (cdr class-spec) (list file-evocab))
+                          (push (list (car class-def) file-evocab)
+                                classes))))
+                    (push file-deps dependencies)))))))
+       (cons (nreverse classes) (nreverse dependencies))))))
+
+
+;;;===========================================================================
+;;;  Compilation: run ANTLR tool
+;;;===========================================================================
+
+(defun antlr-superclasses-glibs (supers classes)
+  "Compute the grammar lib option for the super grammars SUPERS.
+Look in CLASSES for the right grammar lib files for SUPERS.  SUPERS is
+part SUPER in the result of `antlr-file-dependencies'.  CLASSES is the
+part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'.
+
+The result looks like \(OPTION WITH-UNKNOWN GLIB ...).  OPTION is the
+complete \"-glib\" option.  WITH-UNKNOWN is t if there is none or more
+than one grammar file for at least one super grammar.
+
+Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB).  GRAMMAR-FILE is a file
+in which a super-grammar is defined.  EVOCAB is the value of the export
+vocabulary of the super-grammar or nil if it is not needed."
+  ;; If the superclass is defined in the same file, that file will be included
+  ;; with -glib again.  This will lead to a redefinition.  But defining a
+  ;; analyzer of the same class twice in a file will lead to an error anyway...
+  (let (glibs unknown)
+    (while supers
+      (let* ((super (pop supers))
+            (sup-files (cdr (assoc (car super) classes)))
+            (file (and sup-files (null (cdr sup-files)) (car sup-files))))
+       (or file (setq unknown t))      ; not exactly one file
+       (push (cons (or (car file)
+                       (format (car antlr-unknown-file-formats)
+                               (car super)))
+                   (and (cdr super)
+                        (or (cdr file)
+                            (format (cadr antlr-unknown-file-formats)
+                                    (car super)))))
+             glibs)))
+    (cons (if glibs (concat " -glib " (mapconcat 'car glibs ";")) "")
+         (cons unknown glibs))))
+
+(defun antlr-run-tool (command file &optional saved)
+  "Run Antlr took COMMAND on grammar FILE.
+When called interactively, COMMAND is read from the minibuffer and
+defaults to `antlr-tool-command' with a computed \"-glib\" option if
+necessary.
+
+Save all buffers first unless optional value SAVED is non-nil.  When
+called interactively, the buffers are always saved, see also variable
+`antlr-ask-about-save'."
+  (interactive (antlr-run-tool-interactive))
+  (or saved (save-some-buffers (not antlr-ask-about-save)))
+  (let ((default-directory (file-name-directory file)))
+    (compilation-start (concat command " " (file-name-nondirectory file))
+                      nil (lambda (_mode-name) "*Antlr-Run*"))))
+
+(defun antlr-run-tool-interactive ()
+  ;; code in `interactive' is not compiled
+  "Interactive specification for `antlr-run-tool'.
+Use prefix argument ARG to return \(COMMAND FILE SAVED)."
+  (let* ((supers (cdadr (save-excursion
+                         (save-restriction
+                           (widen)
+                           (antlr-file-dependencies)))))
+        (glibs ""))
+    (when supers
+      (save-some-buffers (not antlr-ask-about-save) nil)
+      (setq glibs (car (antlr-superclasses-glibs
+                       supers
+                       (car (antlr-directory-dependencies
+                             (antlr-default-directory)))))))
+    (list (antlr-read-shell-command "Run Antlr on current file with: "
+                                   (concat antlr-tool-command glibs " "))
+         buffer-file-name
+         supers)))
+
+
+;;;===========================================================================
+;;;  Makefile creation
+;;;===========================================================================
+
+(defun antlr-makefile-insert-variable (number pre post)
+  "Insert Makefile variable numbered NUMBER according to specification.
+Also insert strings PRE and POST before and after the variable."
+  (let ((spec (cadr antlr-makefile-specification)))
+    (when spec
+      (insert pre
+             (if number (format (cadr spec) number) (car spec))
+             post))))
+
+(defun antlr-insert-makefile-rules (&optional in-makefile)
+  "Insert Makefile rules in the current buffer at point.
+IN-MAKEFILE is non-nil, if the current buffer is the Makefile.  See
+command `antlr-show-makefile-rules' for detail."
+  (let* ((dirname (antlr-default-directory))
+        (deps0 (antlr-directory-dependencies dirname))
+        (classes (car deps0))          ; CLASS -> (FILE . EVOCAB) ...
+        (deps (cdr deps0))             ; FILE -> (c . s) (ev . iv) . LANGUAGE
+        (with-error nil)
+        (gen-sep (or (caddr (cadr antlr-makefile-specification)) " "))
+        (n (and (cdr deps) (cadr antlr-makefile-specification) 0)))
+    (or in-makefile (set-buffer standard-output))
+    (dolist (dep deps)
+      (let ((supers (cdadr dep))
+           (lang (cdr (assoc (cdddr dep) antlr-file-formats-alist))))
+       (if n (incf n))
+       (antlr-makefile-insert-variable n "" " =")
+       (if supers
+           (insert " "
+                   (format (cadr antlr-special-file-formats)
+                           (file-name-sans-extension (car dep)))))
+       (dolist (class-def (caadr dep))
+         (let ((sep gen-sep))
+           (dolist (class-file (cadr lang))
+             (insert sep (format class-file (car class-def)))
+             (setq sep " "))))
+       (dolist (evocab (caaddr dep))
+         (let ((sep gen-sep))
+           (dolist (vocab-file (cons (car antlr-special-file-formats)
+                                     (car lang)))
+             (insert sep (format vocab-file evocab))
+             (setq sep " "))))
+       (antlr-makefile-insert-variable n "\n$(" ")")
+       (insert ": " (car dep))
+       (dolist (ivocab (cdaddr dep))
+         (insert " " (format (car antlr-special-file-formats) ivocab)))
+       (let ((glibs (antlr-superclasses-glibs supers classes)))
+         (if (cadr glibs) (setq with-error t))
+         (dolist (super (cddr glibs))
+           (insert " " (car super))
+           (if (cdr super)
+               (insert " " (format (car antlr-special-file-formats)
+                                   (cdr super)))))
+         (insert "\n\t"
+                 (caddr antlr-makefile-specification)
+                 (car glibs)
+                 " $<\n"
+                 (car antlr-makefile-specification)))))
+    (if n
+       (let ((i 0))
+         (antlr-makefile-insert-variable nil "" " =")
+         (while (<= (incf i) n)
+           (antlr-makefile-insert-variable i " $(" ")"))
+         (insert "\n" (car antlr-makefile-specification))))
+    (if (string-equal (car antlr-makefile-specification) "\n")
+       (backward-delete-char 1))
+    (when with-error
+      (goto-char (point-min))
+      (insert antlr-help-unknown-file-text))
+    (unless in-makefile
+      (copy-region-as-kill (point-min) (point-max))
+      (goto-char (point-min))
+      (insert (format antlr-help-rules-intro dirname)))))
+
+;;;###autoload
+(defun antlr-show-makefile-rules ()
+  "Show Makefile rules for all grammar files in the current directory.
+If the `major-mode' of the current buffer has the value `makefile-mode',
+the rules are directory inserted at point.  Otherwise, a *Help* buffer
+is shown with the rules which are also put into the `kill-ring' for
+\\[yank].
+
+This command considers import/export vocabularies and grammar
+inheritance and provides a value for the \"-glib\" option if necessary.
+Customize variable `antlr-makefile-specification' for the appearance of
+the rules.
+
+If the file for a super-grammar cannot be determined, special file names
+are used according to variable `antlr-unknown-file-formats' and a
+commentary with value `antlr-help-unknown-file-text' is added.  The
+*Help* buffer always starts with the text in `antlr-help-rules-intro'."
+  (interactive)
+  (if (null (derived-mode-p 'makefile-mode))
+      (antlr-with-displaying-help-buffer 'antlr-insert-makefile-rules)
+    (push-mark)
+    (antlr-insert-makefile-rules t)))
+
+
+;;;===========================================================================
+;;;  Indentation
+;;;===========================================================================
+
+(defun antlr-indent-line ()
+  "Indent the current line as ANTLR grammar code.
+The indentation of grammar lines are calculated by `c-basic-offset',
+multiplied by:
+ - the level of the paren/brace/bracket depth,
+ - plus 0/2/1, depending on the position inside the rule: header, body,
+   exception part,
+ - minus 1 if `antlr-indent-item-regexp' matches the beginning of the
+   line starting from the first non-whitespace.
+
+Lines inside block comments are indented by `c-indent-line' according to
+`antlr-indent-comment'.
+
+Lines in actions except top-level actions in a header part or an option
+area are indented by `c-indent-line'.
+
+Lines in header actions are indented at column 0 if `antlr-language'
+equals to a key in `antlr-indent-at-bol-alist' and the line starting at
+the first non-whitespace is matched by the corresponding value.
+
+For the initialization of `c-basic-offset', see `antlr-indent-style' and,
+to a lesser extent, `antlr-tab-offset-alist'."
+  (save-restriction
+    (let ((orig (point))
+         (min0 (point-min))
+         bol boi indent syntax cc-syntax)
+      (widen)
+      (beginning-of-line)
+      (setq bol (point))
+      (if (< bol min0)
+         (error "Beginning of current line not visible"))
+      (skip-chars-forward " \t")
+      (setq boi (point))
+      ;; check syntax at beginning of indentation ----------------------------
+      (antlr-with-syntax-table antlr-action-syntax-table
+       (antlr-invalidate-context-cache)
+       (setq syntax (antlr-syntactic-context))
+       (cond ((symbolp syntax)
+              (setq indent nil))       ; block-comments, strings, (comments)
+             ((progn
+                (antlr-next-rule -1 t)
+                (if (antlr-search-forward ":") (< boi (1- (point))) t))
+              (setq indent 0))         ; in rule header
+             ((if (antlr-search-forward ";") (< boi (point)) t)
+              (setq indent 2))         ; in rule body
+             (t
+              (forward-char)
+              (antlr-skip-exception-part nil)
+              (setq indent (if (> (point) boi) 1 0))))) ; in exception part?
+      ;; check whether to use indentation engine of cc-mode ------------------
+      (antlr-invalidate-context-cache)
+      (goto-char boi)
+      (when (and indent (> syntax 0))
+       (cond ((> syntax 1)             ; block in action => use cc-mode
+              (setq indent nil))
+             ((and (= indent 0)
+                   (assq antlr-language antlr-indent-at-bol-alist)
+                   (looking-at (cdr (assq antlr-language
+                                          antlr-indent-at-bol-alist))))
+              (setq syntax 'bol))
+             ((setq cc-syntax (c-guess-basic-syntax))
+              (let ((cc cc-syntax) symbol)
+                (while (setq symbol (pop cc))
+                  (when (cdr symbol)
+                    (or (memq (car symbol)
+                              antlr-disabling-cc-syntactic-symbols)
+                        (setq indent nil))
+                    (setq cc nil)))))))
+;;;            ((= indent 1)           ; exception part => use cc-mode
+;;;             (setq indent nil))
+;;;            ((save-restriction      ; not in option part => cc-mode
+;;;               (goto-char (scan-lists (point) -1 1))
+;;;               (skip-chars-backward " \t\n")
+;;;               (narrow-to-region (point-min) (point))
+;;;               (not (re-search-backward "\\<options\\'" nil t)))
+;;;             (setq indent nil)))))
+       ;; compute the corresponding indentation and indent --------------------
+      (if (null indent)
+         ;; Use the indentation engine of cc-mode
+         (progn
+           (goto-char orig)
+           (if (or (numberp syntax)
+                   (if (eq syntax 'string) nil (eq antlr-indent-comment t)))
+               (c-indent-line cc-syntax)))
+       ;; do it ourselves
+       (goto-char boi)
+       (unless (symbolp syntax)                ; direct indentation
+         ;;(antlr-invalidate-context-cache)
+         (incf indent (antlr-syntactic-context))
+         (and (> indent 0) (looking-at antlr-indent-item-regexp) (decf indent))
+         (setq indent (* indent c-basic-offset)))
+       ;; the usual major-mode indent stuff ---------------------------------
+       (setq orig (- (point-max) orig))
+       (unless (= (current-column) indent)
+         (delete-region bol boi)
+         (beginning-of-line)
+         (indent-to indent))
+       ;; If initial point was within line's indentation,
+       ;; position after the indentation.  Else stay at same point in text.
+       (if (> (- (point-max) orig) (point))
+           (goto-char (- (point-max) orig)))))))
+
+(defun antlr-indent-command (&optional arg)
+  "Indent the current line or insert tabs/spaces.
+With optional prefix argument ARG or if the previous command was this
+command, insert ARG tabs or spaces according to `indent-tabs-mode'.
+Otherwise, indent the current line with `antlr-indent-line'."
+  (interactive "*P")
+  (if (or arg (eq last-command 'antlr-indent-command))
+      (insert-tab arg)
+    (let ((antlr-indent-comment (and antlr-indent-comment t))) ; dynamic
+      (antlr-indent-line))))
+
+(defun antlr-electric-character (&optional arg)
+  "Insert the character you type and indent the current line.
+Insert the character like `self-insert-command' and indent the current
+line as `antlr-indent-command' does.  Do not indent the line if
+
+ * this command is called with a prefix argument ARG,
+ * there are characters except whitespaces between point and the
+   beginning of the line, or
+ * point is not inside a normal grammar code, { and } are also OK in
+   actions.
+
+This command is useful for a character which has some special meaning in
+ANTLR's syntax and influences the auto indentation, see
+`antlr-indent-item-regexp'."
+  (interactive "*P")
+  (if (or arg
+         (save-excursion (skip-chars-backward " \t") (not (bolp)))
+         (antlr-with-syntax-table antlr-action-syntax-table
+           (antlr-invalidate-context-cache)
+           (let ((context (antlr-syntactic-context)))
+             (not (and (numberp context)
+                       (or (zerop context)
+                           (memq last-command-event '(?\{ ?\}))))))))
+      (self-insert-command (prefix-numeric-value arg))
+    (self-insert-command (prefix-numeric-value arg))
+    (antlr-indent-line)))
+
+
+;;;===========================================================================
+;;;  Mode entry
+;;;===========================================================================
+
+(defun antlr-c-init-language-vars ()
+  "Like `c-init-language-vars-for' when using cc-mode before v5.29."
+  (let ((settings                      ; (cdr '(setq...)) will be optimized
+        (if (eq antlr-language 'c++-mode)
+            (cdr '(setq                ;' from `c++-mode' v5.20, v5.28
+                   c-keywords (c-identifier-re c-C++-keywords)
+                   c-conditional-key c-C++-conditional-key
+                   c-comment-start-regexp c-C++-comment-start-regexp
+                   c-class-key c-C++-class-key
+                   c-extra-toplevel-key c-C++-extra-toplevel-key
+                   c-access-key c-C++-access-key
+                   c-recognize-knr-p nil
+                   c-bitfield-key c-C-bitfield-key ; v5.28
+                   ))
+          (cdr '(setq                  ; from `java-mode' v5.20, v5.28
+                 c-keywords (c-identifier-re c-Java-keywords)
+                 c-conditional-key c-Java-conditional-key
+                 c-comment-start-regexp c-Java-comment-start-regexp
+                 c-class-key c-Java-class-key
+                 c-method-key nil
+                 c-baseclass-key nil
+                 c-recognize-knr-p nil
+                 c-access-key c-Java-access-key ; v5.20
+                 c-inexpr-class-key c-Java-inexpr-class-key ; v5.28
+                 )))))
+    (while settings
+      (when (boundp (car settings))
+       (ignore-errors
+         (set (car settings) (eval (cadr settings)))))
+      (setq settings (cddr settings)))))
+
+(defun antlr-language-option (search)
+  "Find language in `antlr-language-alist' for language option.
+If SEARCH is non-nil, find element for language option.  Otherwise, find
+the default language."
+  (let ((value
+         (and search
+              (save-excursion
+                (goto-char (point-min))
+                (re-search-forward (cdr antlr-language-limit-n-regexp)
+                                   (+ (point)
+                                      (car antlr-language-limit-n-regexp))
+                                   t))
+              (match-string 1)))
+       (seq antlr-language-alist)
+       r)
+    ;; Like (find VALUE antlr-language-alist :key 'cddr :test 'member)
+    (while seq
+      (setq r (pop seq))
+      (if (member value (cddr r))
+         (setq seq nil)                ; stop
+       (setq r nil)))                  ; no result yet
+    (car r)))
+
+;;;###autoload
+(define-derived-mode antlr-mode prog-mode
+  ;; FIXME: Since it uses cc-mode, it bumps into c-update-modeline's
+  ;; limitation to mode-name being a string.
+  ;; '("Antlr." (:eval (cadr (assq antlr-language antlr-language-alist))))
+  "Antlr"
+  "Major mode for editing ANTLR grammar files."
+  :abbrev-table antlr-mode-abbrev-table
+  (c-initialize-cc-mode)               ; cc-mode is required
+  (unless (fboundp 'c-forward-sws)     ; see above
+    (fset 'antlr-c-forward-sws 'c-forward-syntactic-ws))
+  ;; ANTLR specific ----------------------------------------------------------
+  (unless antlr-language
+    (set (make-local-variable 'antlr-language)
+         (or (antlr-language-option t) (antlr-language-option nil))))
+  (if (stringp (cadr (assq antlr-language antlr-language-alist)))
+      (setq mode-name
+           (concat "Antlr."
+                   (cadr (assq antlr-language antlr-language-alist)))))
+  ;; indentation, for the C engine -------------------------------------------
+  (setq c-buffer-is-cc-mode antlr-language)
+  (cond ((fboundp 'c-init-language-vars-for) ; cc-mode 5.30.5+
+        (c-init-language-vars-for antlr-language))
+       ((fboundp 'c-init-c-language-vars) ; cc-mode 5.30 to 5.30.4
+        (c-init-c-language-vars)       ; not perfect, but OK
+        (setq c-recognize-knr-p nil))
+       ((fboundp 'c-init-language-vars) ; cc-mode 5.29
+        (let ((init-fn 'c-init-language-vars))
+          (funcall init-fn)))          ; is a function in v5.29
+       (t                              ; cc-mode upto 5.28
+        (antlr-c-init-language-vars))) ; do it myself
+  (c-basic-common-init antlr-language (or antlr-indent-style "gnu"))
+  (set (make-local-variable 'outline-regexp) "[^#\n\^M]")
+  (set (make-local-variable 'outline-level) 'c-outline-level) ;TODO: define own
+  (set (make-local-variable 'indent-line-function) 'antlr-indent-line)
+  (set (make-local-variable 'indent-region-function) nil)      ; too lazy
+  (setq comment-start "// "
+       comment-end ""
+       comment-start-skip "/\\*+ *\\|// *")
+  ;; various -----------------------------------------------------------------
+  (set (make-local-variable 'font-lock-defaults) antlr-font-lock-defaults)
+  (easy-menu-add antlr-mode-menu)
+  (set (make-local-variable 'imenu-create-index-function)
+       'antlr-imenu-create-index-function)
+  (set (make-local-variable 'imenu-generic-expression) t) ; fool stupid test
+  (and antlr-imenu-name                        ; there should be a global variable...
+       (fboundp 'imenu-add-to-menubar)
+       (imenu-add-to-menubar
+       (if (stringp antlr-imenu-name) antlr-imenu-name "Index")))
+  (antlr-set-tabs))
+
+;; A smarter version of `group-buffers-menu-by-mode-then-alphabetically' (in
+;; XEmacs) could use the following property.  The header of the submenu would
+;; be "Antlr" instead of "Antlr.C++" or (not and!) "Antlr.Java".
+(put 'antlr-mode 'mode-name "Antlr")
+
+;;;###autoload
+(defun antlr-set-tabs ()
+  "Use ANTLR's convention for TABs according to `antlr-tab-offset-alist'.
+Used in `antlr-mode'.  Also a useful function in `java-mode-hook'."
+  (if buffer-file-name
+      (let ((alist antlr-tab-offset-alist) elem)
+       (while alist
+         (setq elem (pop alist))
+         (and (or (null (car elem)) (eq (car elem) major-mode))
+              (or (null (cadr elem))
+                  (string-match (cadr elem) buffer-file-name))
+              (setq tab-width (caddr elem)
+                    indent-tabs-mode (cadddr elem)
+                    alist nil))))))
+
+(provide 'antlr-mode)
+
+;;; Local IspellPersDict: .ispell_antlr
+
+;;; antlr-mode.el ends here
diff --git a/developers/readers/cycle_dection.html b/developers/readers/cycle_dection.html
new file mode 100644 (file)
index 0000000..3c9fb85
--- /dev/null
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Dependency Build Algorithm</title>
+  <style>
+    body {
+      background-color: hsl(0, 0%, 0%); /* Black background */
+      color: hsl(40, 100%, 85%); /* Wheatgrass color (offwhite with a tan hue) */
+      font-family: "Courier New", Courier, monospace;
+    }
+    code {
+      background-color: hsl(0, 0%, 15%); /* Dark gray background for code blocks */
+      border: 1px solid hsl(0, 0%, 25%); /* Slightly lighter gray for the border */
+      border-radius: 4px;
+      padding: 4px;
+      color: hsl(40, 100%, 85%); /* Wheatgrass-colored text */
+      display: inline-block; /* Inline-block to extend only as long as the code */
+      white-space: pre-wrap;
+      font-size: 14px;
+    }
+    ol {
+      margin-left: 20px;
+    }
+    li {
+      margin-bottom: 10px;
+    }
+    h1, h2 {
+      color: hsl(40, 100%, 75%); /* Lighter wheatgrass color for headers */
+    }
+    a {
+      color: hsl(150, 100%, 65%); /* Light green for links */
+    }
+  </style>
+</head>
+<body>
+  <h2>Cycle Detection in Dependency Graph</h2>
+  <h3>Overview</h3>
+  <p>
+    The <code>is_acyclic_q</code> function is designed to detect cycles in a dependency graph using a depth-first search (DFS) algorithm. It starts from a list of root node labels and traverses the graph to ensure that there are no cycles. If a cycle is detected, the function marks the nodes involved and continues to explore other parts of the graph.
+  </p>
+  <h3>Key Concepts</h3>
+  <ul>
+    <li><strong>Dependency Graph</strong>: A graph where nodes represent build targets and edges represent dependencies between these targets.</li>
+    <li><strong>Depth-First Search (DFS)</strong>: An algorithm for traversing or searching tree or graph data structures. It starts at the root and explores as far as possible along each branch before backtracking.</li>
+    <li><strong>Cycle Detection</strong>: The process of identifying cycles (loops) in a graph, where a cycle is a path that starts and ends at the same node.</li>
+  </ul>
+  <h3>Functions</h3>
+  <h4>1. is_acyclic_q</h4>
+  <p>
+    <strong>Purpose</strong>: To determine if the dependency graph is acyclic (i.e., contains no cycles).
+  </p>
+  <p>
+    <strong>Parameters</strong>: 
+    <ul>
+      <li><code>root_node_labels</code>: A list of labels for the root nodes to start the cycle search.</li>
+      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Returns</strong>: 
+    <ul>
+      <li><code>'acyclic'</code> if no cycles are found.</li>
+      <li><code>'cycle_found'</code> if cycles are detected.</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Process</strong>:
+    <ul>
+      <li>Initializes a stack for DFS traversal.</li>
+      <li>Iteratively calls the <code>is_acyclic_q_descend</code> function to traverse the graph and detect cycles.</li>
+      <li>Updates the traversal state and continues exploring other paths until the stack is empty.</li>
+    </ul>
+  </p>
+  <h4>2. is_acyclic_q_descend</h4>
+  <p>
+    <strong>Purpose</strong>: To perform the actual DFS traversal and cycle detection for a given path.
+  </p>
+  <p>
+    <strong>Parameters</strong>: 
+    <ul>
+      <li><code>path_stack</code>: A stack representing the current path in the graph.</li>
+      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Returns</strong>: 
+    <ul>
+      <li><code>'leaf_node'</code> if the current node has no children.</li>
+      <li><code>'cycle_found'</code> if a cycle is detected.</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Process</strong>:
+    <ul>
+      <li>Collects the current path and node.</li>
+      <li>Checks for cycles by comparing the current node with nodes in the path.</li>
+      <li>Marks nodes involved in cycles and updates the stack to continue traversal.</li>
+    </ul>
+  </p>
+  <h3>Usage</h3>
+  <p>
+    The <code>is_acyclic_q</code> function is used to ensure that the dependency graph defined in the build file is free of cycles. This is crucial for preventing infinite loops and ensuring that the build process can proceed smoothly.
+  </p>
+</body>
+</html>
diff --git a/developers/readers/dependency_graph.html b/developers/readers/dependency_graph.html
new file mode 100644 (file)
index 0000000..378c52d
--- /dev/null
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Dependency Build Algorithm</title>
+  <style>
+    body {
+      background-color: hsl(0, 0%, 0%); /* Black background */
+      color: hsl(40, 100%, 85%); /* Wheatgrass color (offwhite with a tan hue) */
+      font-family: "Courier New", Courier, monospace;
+    }
+    code {
+      background-color: hsl(0, 0%, 15%); /* Dark gray background for code blocks */
+      border: 1px solid hsl(0, 0%, 25%); /* Slightly lighter gray for the border */
+      border-radius: 4px;
+      padding: 4px;
+      color: hsl(40, 100%, 85%); /* Wheatgrass-colored text */
+      display: block;
+      white-space: pre-wrap;
+      font-size: 14px;
+    }
+    ol {
+      margin-left: 20px;
+    }
+    li {
+      margin-bottom: 10px;
+    }
+    h1, h2 {
+      color: hsl(40, 100%, 75%); /* Lighter wheatgrass color for headers */
+    }
+    a {
+      color: hsl(150, 100%, 65%); /* Light green for links */
+    }
+  </style>
+</head>
+<body>
+  <h2>Cycle Detection in Dependency Graph</h2>
+  <h3>Overview</h3>
+  <p>
+    The <code>is_acyclic_q</code> function is designed to detect cycles in a dependency graph using a depth-first search (DFS) algorithm. It starts from a list of root node labels and traverses the graph to ensure that there are no cycles. If a cycle is detected, the function marks the nodes involved and continues to explore other parts of the graph.
+  </p>
+  <h3>Key Concepts</h3>
+  <ul>
+    <li><strong>Dependency Graph</strong>: A graph where nodes represent build targets and edges represent dependencies between these targets.</li>
+    <li><strong>Depth-First Search (DFS)</strong>: An algorithm for traversing or searching tree or graph data structures. It starts at the root and explores as far as possible along each branch before backtracking.</li>
+    <li><strong>Cycle Detection</strong>: The process of identifying cycles (loops) in a graph, where a cycle is a path that starts and ends at the same node.</li>
+  </ul>
+  <h3>Functions</h3>
+  <h4>1. is_acyclic_q</h4>
+  <p>
+    <strong>Purpose</strong>: To determine if the dependency graph is acyclic (i.e., contains no cycles).
+  </p>
+  <p>
+    <strong>Parameters</strong>: 
+    <ul>
+      <li><code>root_node_labels</code>: A list of labels for the root nodes to start the cycle search.</li>
+      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Returns</strong>: 
+    <ul>
+      <li><code>'acyclic'</code> if no cycles are found.</li>
+      <li><code>'cycle_found'</code> if cycles are detected.</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Process</strong>:
+    <ul>
+      <li>Initializes a stack for DFS traversal.</li>
+      <li>Iteratively calls the <code>is_acyclic_q_descend</code> function to traverse the graph and detect cycles.</li>
+      <li>Updates the traversal state and continues exploring other paths until the stack is empty.</li>
+    </ul>
+  </p>
+  <h4>2. is_acyclic_q_descend</h4>
+  <p>
+    <strong>Purpose</strong>: To perform the actual DFS traversal and cycle detection for a given path.
+  </p>
+  <p>
+    <strong>Parameters</strong>: 
+    <ul>
+      <li><code>path_stack</code>: A stack representing the current path in the graph.</li>
+      <li><code>verbose</code>: A boolean flag for enabling detailed output (default is <code>true</code>).</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Returns</strong>: 
+    <ul>
+      <li><code>'leaf_node'</code> if the current node has no children.</li>
+      <li><code>'cycle_found'</code> if a cycle is detected.</li>
+    </ul>
+  </p>
+  <p>
+    <strong>Process</strong>:
+    <ul>
+      <li>Collects the current path and node.</li>
+      <li>Checks for cycles by comparing the current node with nodes in the path.</li>
+      <li>Marks nodes involved in cycles and updates the stack to continue traversal.</li>
+    </ul>
+  </p>
+  <h3>Usage</h3>
+  <p>
+    The <code>is_acyclic_q</code> function is used to ensure that the dependency graph defined in the build file is free of cycles. This is crucial for preventing infinite loops and ensuring that the build process can proceed smoothly.
+  </p>
+
+</body>
+</html>  
+
+<h2>2. Run Build Scripts</h2>
+<ol>
+  <li>Traverse the queue starting from the tail (the most recently added nodes).</li>
+  <li>For each node, attempt to build it by checking the file dates of the target node and its dependencies:
+    <ol>
+      <li>If the target file is older than any dependency, execute the node’s build function.</li>
+      <li>After building, recheck the file dates. If the file date has been updated, mark the node as successfully built.</li>
+      <li>If the build fails or the file date is not updated, mark the node with an error in its property list.</li>
+    </ol>
+  </li>
+  <li>Nodes with dependencies marked with errors will not be built, and errors will propagate up the dependency tree.</li>
+</ol>
+
+<h2>3. Final Reporting and Status</h2>
+<ol>
+  <li>If the root node is successfully built, report the success and any other successfully built nodes.</li>
+  <li>If an error has propagated to the root, report the failure.</li>
+  <li>Keep a list of all successfully built nodes and provide a final summary of the build status.</li>
+</ol>
+
+<h2>4. Node Definitions</h2>
+<p>Each node in the dependency graph is defined by a property dictionary. A node is either a symbol or a path:</p>
+<ol>
+  <li>Symbol Nodes: These represent abstract concepts or commands and always trigger a build unless marked with an error.</li>
+  <li>Path Nodes: These represent file paths. A path node is considered built if its target file is newer than its dependencies.</li>
+</ol>
+<p>Both node types are identified by a label, and their dependencies are stored as a list of node labels. The presence of an error property indicates that the node has failed to build or encountered a problem during processing.</p>
+
+</body>
+</html>
diff --git a/developers/readers/deps.gradle b/developers/readers/deps.gradle
new file mode 100644 (file)
index 0000000..8427e1f
--- /dev/null
@@ -0,0 +1,240 @@
+// useful regular expressions
+def base = "[a-zA-Z0-9_-]+"
+def ext = "[a-zA-Z0-9_-]+$"
+def name = "${filebase}\.${fileext}"
+def path = "[.]+/${name}"
+
+
+// Predefined returnable functions for comparison
+def no_match_f = { target ->
+    println "No match found for target: ${target}"
+}
+
+def dependency_list_f = { jarFilePath, javaFilePath ->
+    println "Building JAR file for target: ${jarFilePath}"
+    println "Target: ${jarFilePath} depends on: ${javaFilePath}"
+    return [jarFilePath, javaFilePath]
+}
+
+// Main function to handle target matching
+def target_executor(token) {
+    // Match against the expected executor path pattern
+    def match = token =~ /(?:^executor\/)(${base})\.class$/
+
+    // If there’s no match, return the no_match function
+    if (!match) {
+        return no_match_f.curry(token)
+    }
+
+    // Extract the base name of the matched target (e.g., "RuleNameListRegx")
+    def targetBase = match[0][1]
+
+    // Define the expected Java and JAR file paths
+    def javaFilePath = "${javaCompInDir}${targetBase}.java"
+    def jarFilePath = "${executorDir}${targetBase}.jar"
+
+    // Check if the corresponding Java file exists in the javac directory
+    def javaFile = new File(javaFilePath)
+    if (!javaFile.exists()) {
+        // Return the function to print the missing Java file message
+        return no_java_file_f.curry(javaFilePath)
+    }
+
+    // Return the function that handles the JAR build step
+    return build_jar_f.curry(jarFilePath, javaFilePath)
+}
+
+// Example usage:
+def f = target_executor("executor/RuleNameListRegx.class")
+if (f == no_match_f) {
+    println "No match found"
+} else if (f == no_java_file_f) {
+    println "No corresponding Java file"
+} else {
+    f()  // Call the returned function to perform the build
+}
+
+
+
+
+// useful regular expressions
+def base = "[a-zA-Z0-9_-]+"
+def ext = "[a-zA-Z0-9_-]+$"
+def name = "${filebase}\.${fileext}
+def path = "[.]+/${name}"
+
+def target_executor( token ){
+
+  // "(?:" ... ) matches are thrown away
+  def match = token =~ /(?:^executor/)(${base})(?:${ext})/
+
+  // if there is a corresponding primary javac/primary/%1.java file,
+  // then creating the executable wrapper depends upon the .jar
+  // file, which will later chain back to the java file.
+
+  ...
+
+// returns a function that produces the jar file, or returns
+// a function that, if invoked prints the message that there is
+// no corresponding java file.
+
+
+  return ...
+
+}
+
+
+// Define the build target, dependencies, and functions as triples
+def build_triples = [
+  [
+    targets: [""]
+    deps: ["jvm/%1.class"]
+  ]
+
+  ,[ 
+    targets: ["(?:${path}/)
+   ...
+
+  ],
+]
+
+
+
+
+def programMap = [
+  [target: ["exectutor/
+
+    // RuleNameListRegx does not require ANTLR or external tools
+    "RuleNameListRegx": [
+        "wrapped_jar_from_java": "RuleNameListRegx",
+        "java_depends": [],
+        "grammar": [],
+        "program_deps": []
+    ],
+
+    // RuleNameList does not require ANTLR or external tools
+    "RuleNameList": [
+        "wrapped_jar_from_java": "RuleNameList",
+        "java_depends": [],
+        "grammar": [],
+        "program_deps": []
+    ],
+
+    // Synthesize_SyntaxAnnotate_PrintVisitorMethod has dependencies on Java classes
+    "Synthesize_SyntaxAnnotate_PrintVisitorMethod": [
+        "wrapped_jar_from_java": "Synthesize_SyntaxAnnotate_PrintVisitorMethod",
+        "java_depends": ["StringUtils"],
+        "grammar": [],
+        "program_deps": []
+    ],
+
+    // Synthesize_SyntaxAnnotate_PrintVisitor depends on Synthesize_SyntaxAnnotate_PrintVisitorMethod
+    "Synthesize_SyntaxAnnotate_PrintVisitor": [
+        "wrapped_jar_from_java": "Synthesize_SyntaxAnnotate_PrintVisitor",
+        "java_depends": ["StringUtils", "Synthesize_SyntaxAnnotate_PrintVisitorMethod"],
+        "grammar": [],
+        "program_deps": []
+    ],
+
+    // ANTLRv4_RuleNameList requires the ANTLRv4 grammar and is used in parsing ANTLR grammars
+    "ANTLRv4_RuleNameList": [
+        "wrapped_jar_from_java": "ANTLRv4_RuleNameList",
+        "java_depends": [],
+        "grammar": ["ANTLRv4"],
+        "program_deps": []
+    ],
+
+    // Arithmetic_Echo requires the Arithmetic grammar and ANTLR-generated files
+    "Arithmetic_Echo": [
+        "wrapped_jar_from_java": "Arithmetic_Echo",
+        "java_depends": ["Arithmetic_Echo_PrintVisitor"],
+        "grammar": ["Arithmetic"],
+        "program_deps": []
+    ],
+
+    // Arithmetic_Echo__Test also depends on the Arithmetic grammar
+    "Arithmetic_Echo__Test": [
+        "wrapped_jar_from_java": "Arithmetic_Echo__Test",
+        "java_depends": ["Arithmetic_Echo_PrintVisitor"],
+        "grammar": ["Arithmetic"],
+        "program_deps": []
+    ],
+
+    // Arithmetic_SyntaxAnnotate has dependencies on Arithmetic and generated files
+    "Arithmetic_SyntaxAnnotate": [
+        "wrapped_jar_from_java": "Arithmetic_SyntaxAnnotate",
+        "java_depends": ["Arithmetic_SyntaxAnnotate_PrintVisitor"],
+        "grammar": ["Arithmetic"],
+        "program_deps": []
+    ],
+
+    // Arithmetic_SyntaxAnnotate__Test has similar dependencies as Arithmetic_SyntaxAnnotate
+    "Arithmetic_SyntaxAnnotate__Test": [
+        "wrapped_jar_from_java": "Arithmetic_SyntaxAnnotate__Test",
+        "java_depends": ["Arithmetic_SyntaxAnnotate_PrintVisitor"],
+        "grammar": ["Arithmetic"],
+        "program_deps": []
+    ],
+
+    // Arithmetic2_SyntaxAnnotate has its own grammar and dependencies
+    "Arithmetic2_SyntaxAnnotate": [
+        "wrapped_jar_from_java": "Arithmetic2_SyntaxAnnotate",
+        "java_depends": ["Arithmetic2_SyntaxAnnotate_PrintVisitor"],
+        "grammar": ["Arithmetic2"],
+        "program_deps": []
+    ],
+
+    // Arithmetic2_SyntaxAnnotate__Test has the same dependencies as Arithmetic2_SyntaxAnnotate
+    "Arithmetic2_SyntaxAnnotate__Test": [
+        "wrapped_jar_from_java": "Arithmetic2_SyntaxAnnotate__Test",
+        "java_depends": ["Arithmetic2_SyntaxAnnotate_PrintVisitor"],
+        "grammar": ["Arithmetic2"],
+        "program_deps": []
+    ],
+
+    // ANTLRv4_SyntaxAnnotate requires the ANTLRv4 grammar
+    "ANTLRv4_SyntaxAnnotate": [
+        "wrapped_jar_from_java": "ANTLRv4_SyntaxAnnotate",
+        "java_depends": ["ANTLRv4_SyntaxAnnotate_PrintVisitor"],
+        "grammar": ["ANTLRv4"],
+        "program_deps": []
+    ],
+
+    // Arithmetic_Swap has multiple dependencies on generated files and grammars
+    "Arithmetic_Swap": [
+        "wrapped_jar_from_java": "Arithmetic_Swap",
+        "java_depends": ["Arithmetic_SwapVisitor", "Arithmetic_Echo_PrintVisitor"],
+        "grammar": ["Arithmetic"],
+        "program_deps": []
+    ],
+
+    // GQL-related program with its own grammar and dependencies
+    "GQL_20240412_SyntaxAnnotate": [
+        "wrapped_jar_from_java": "GQL_20240412_SyntaxAnnotate",
+        "java_depends": ["GQL_20240412_SyntaxAnnotate_PrintVisitor"],
+        "grammar": ["GQL_20240412"],
+        "program_deps": []
+    ],
+
+    "GQL_20240412_SyntaxAnnotate__Test": [
+        "wrapped_jar_from_java": "GQL_20240412_SyntaxAnnotate__Test",
+        "java_depends": ["GQL_20240412_SyntaxAnnotate_PrintVisitor"],
+        "grammar": ["GQL_20240412"],
+        "program_deps": []
+    ],
+
+    // Additional tools
+    "TerminalToCategory": [
+        "wrapped_jar_from_java": "TerminalToCategory",
+        "java_depends": [],
+        "grammar": [],
+        "program_deps": []
+    ],
+
+    "GrammarSplitter": [
+        "wrapped_jar_from_java": "GrammarSplitter",
+        "java_depends": [],
+        "grammar": [],
+        "program_deps": []
+    ]
+]
diff --git a/developers/readers/emacs.txt b/developers/readers/emacs.txt
new file mode 100644 (file)
index 0000000..545ab89
--- /dev/null
@@ -0,0 +1,13 @@
+
+
+antlr-mode.el -> .emacs.d
+(autoload 'antlr-mode "antlr-mode" "Major mode for editing ANTLR grammars." t)
+(add-to-list 'auto-mode-alist '("\\.g4\\'" . antlr-mode))
+
+
+C-c C-g b to run gradle build
+C-c C-g t to run gradle test
+C-c C-g s to run a single test
+C-c C-g d to run a Gradle command with the daemon
+
+e
diff --git a/developers/readers/for_developers.md b/developers/readers/for_developers.md
new file mode 100644 (file)
index 0000000..c702f7f
--- /dev/null
@@ -0,0 +1,17 @@
+
+
+The work area for developers is the `developer` directory. All other subdirectories
+and files found at the top level are for project management.
+
+The best way to setup the environment and to enter the `developer` directory is
+to use the `repo` command found in RT's `resource` project. The `repo` command
+will start a new shell with the proper environment variables setup for the 
+project, and nothing else.
+
+A project can also be entered by sourcing `env_dev` by running the command
+`. exector/env_dev` in a shell.  `use_tool` is analogous to `activate` in Python.
+
+
+
+
+
diff --git a/developers/readers/grammar_source.txt b/developers/readers/grammar_source.txt
new file mode 100644 (file)
index 0000000..18a3870
--- /dev/null
@@ -0,0 +1,16 @@
+
+GQL grammar came from:
+   https://github.com/opengql/grammar.git
+
+ANTLR grammar came from:
+   Note the antlr gammar on this site, many grammars listed.
+   https://github.com/antlr/grammars-v4
+   It came as four files:
+     ANTLRv4Lexer.g4
+     ANTLRv4Parser.g4
+     LexBasic.g4
+     LexerAdaptor.java
+
+Cypher movies example:
+  https://github.com/neo4j-graph-examples/movies/blob/main/scripts/movies.cypher
+
diff --git a/developers/readers/groovy.el b/developers/readers/groovy.el
new file mode 100644 (file)
index 0000000..f08befb
--- /dev/null
@@ -0,0 +1,17 @@
+
+;; Ensure package archives are set up
+(require 'package)
+(setq package-archives '(("melpa" . "https://melpa.org/packages/")
+                         ("gnu" . "https://elpa.gnu.org/packages/")))
+(package-initialize)
+
+;; Install neotree if not already installed
+(unless (package-installed-p 'groovy-mode)
+  (package-refresh-contents)
+  (package-install 'groovy-mode))
+
+;; Configure NeoTree
+(with-eval-after-load 'groovy-mode
+  (setq groovy-indent-offset 2)
+  )
+
diff --git a/developers/readers/node_labels_unique_q.txt b/developers/readers/node_labels_unique_q.txt
new file mode 100644 (file)
index 0000000..b978a74
--- /dev/null
@@ -0,0 +1,15 @@
+
+predicate == is_well_formed_q
+
+We can not check that the node labels are unique because the given value
+is a single node, and the code is stateless. Besides there is no contract with
+the programmer on how to use the predicated, so the programmer could call the
+predicate multiple times on the same node.  Now can we test this condition in
+our do_markup_graph routine because of the way lookup works, it will always
+return the same node for the same label.  This would be a truly difficult check
+to perform because the map does not given an error but just takes the second of
+the duplicate key definitions (is this really true?)  besides, it would require
+a formal proof of the recognizer functions that they do not return different
+definitions for different keys to match regexprs against.  I've been mulling
+this over.  As we currently the programmer provides the map and function
+definitions, we don't even know which nodes will be in the graph...
diff --git a/developers/readers/rule_list.txt b/developers/readers/rule_list.txt
new file mode 100644 (file)
index 0000000..79457ec
--- /dev/null
@@ -0,0 +1,368 @@
+Extracted Rules:
+PATH
+MONTH
+RIGHT_ARROW
+RIGHT_BRACKET_TILDE
+CREATE
+GROUPS
+TRIM
+CLOSE
+UINT32
+AGGREGATES
+FLOAT128
+LOG10
+FLOOR
+CATALOG
+YEAR
+CONNECTING
+CURRENT_PROPERTY_GRAPH
+NOTHING
+PARTITION
+INT16
+REVERSE_SOLIDUS
+BINDINGS
+LEFT_ANGLE_BRACKET
+LEFT
+NODE
+LEFT_BRACKET
+SIZE
+BIGINT
+SUM
+WHERE
+AS
+AT
+MIN
+QUERY
+TILDE_LEFT_BRACKET
+LEFT_ARROW_TILDE
+LTRIM
+VARCHAR
+SOURCE
+THEN
+XOR
+BINDING
+ALL_DIFFERENT
+SAME
+ORDINALITY
+CALL
+ALTER
+SET
+INT32
+BYTE_LENGTH
+PATHS
+RIGHT_PAREN
+CONSTRAINT
+PRECISION
+ASC
+GROUP
+UPPER
+ABS
+DELETE
+SMALL
+SIMPLE_COMMENT_MINUS
+VARIABLE
+BY
+OFFSET
+OCTET_LENGTH
+SKIP_RESERVED_WORD
+ELEMENT_ID
+INTERVAL
+DURATION_BETWEEN
+PROCEDURE
+YIELD
+STDDEV_POP
+POWER
+DOUBLE_DOLLAR_SIGN
+COLLECT_LIST
+INT8
+DETACH
+OPEN
+PERCENT
+STRING
+VARBINARY
+SIMPLE
+INTEGER8
+TO
+BRACKET_RIGHT_ARROW
+FLOAT16
+UNION
+DURATION
+SLASH_MINUS
+HOME_PROPERTY_GRAPH
+LOCAL_TIMESTAMP
+TYPED
+LEFT_ARROW
+FLOAT32
+DOUBLE_PERIOD
+DESC
+INTEGER32
+INTEGER128
+OPTIONAL
+PRODUCT
+DESCENDING
+PROPERTY_EXISTS
+LABEL
+LEFT_BRACE
+CURRENT_TIME
+REPLACE
+LABELS
+INTEGER
+NUMBER
+PROJECT
+INTEGER256
+PROPERTY
+PERCENTILE_DISC
+FOR
+UNIQUE
+TRAILING
+BTRIM
+UINT64
+BOOLEAN
+INTEGER16
+AVG
+NOT
+UBIGINT
+CEILING
+LOWER
+LAST
+SINH
+PATH_LENGTH
+INSTANT
+SIN
+END
+RELATIONSHIP
+HAVING
+LIST
+TANH
+TEMPORAL
+QUOTE
+MULTISET_ALTERNATION_OPERATOR
+BINARY
+ASIN
+UINT8
+DROP
+INFINITY
+RETURN
+ELEMENTS
+LEFT_ARROW_BRACKET
+SIGNED
+LEFT_MINUS_RIGHT
+SCHEMA
+NEXT
+RADIANS
+NORMALIZE
+GQLSTATUS
+RENAME
+BIG
+SLASH_TILDE_RIGHT
+FLOAT256
+FILTER
+MOD
+EXISTS
+INT64
+FLOAT64
+CONCATENATION_OPERATOR
+TIME
+COLON
+INTERSECT
+NORMALIZED
+WITH
+CLONE
+SLASH_MINUS_RIGHT
+RIGHT_BRACKET
+CURRENT_ROLE
+GRANT
+RELATIONSHIPS
+PLUS_SIGN
+DATETIME
+BOOL
+DIRECTORY
+DESTINATION
+START
+CHAR_LENGTH
+CHARACTER_LENGTH
+ZONED
+UNDERSCORE
+PERCENTILE_CONT
+DOUBLE_QUOTE
+SQRT
+INT128
+FINISH
+NULLIF
+SESSION_USER
+TABLE
+STDDEV_SAMP
+WHEN
+AGGREGATE
+VERTEX
+EXCLAMATION_MARK
+LOCAL
+DIRECTED
+ELSE
+CEIL
+CURRENT_GRAPH
+IF
+TYPE
+RIGHT_DOUBLE_ARROW
+PARAMETER
+CAST
+LOCAL_TIME
+GRAPH
+AMPERSAND
+SLASH_TILDE
+TRAIL
+IN
+LOG
+DISTINCT
+HOME_SCHEMA
+INT256
+IS
+EXACT
+LEADING
+FUNCTION
+INTEGER64
+CASE
+NODETACH
+NFKC
+NFKD
+DOLLAR_SIGN
+WITHOUT
+COUNT
+NOT_EQUALS_OPERATOR
+MINUS_LEFT_BRACKET
+MAX
+UNSIGNED
+CHAR
+TRANSACTION
+SYSTEM_USER
+LEFT_PAREN
+WRITE
+ORDER
+COMMERCIAL_AT
+REMOVE
+RIGHT
+VALUES
+DOUBLE
+COMMA
+GRAVE_ACCENT
+ZONED_DATETIME
+MINUS_SLASH
+NUMERIC
+REVOKE
+COS
+CURRENT_SCHEMA
+USE
+COT
+ASTERISK
+CHARACTERISTICS
+COPY
+SESSION
+TILDE_SLASH
+FIRST
+UNDIRECTED
+SELECT
+RECORDS
+ELEMENT
+ASCENDING
+LABELED
+HOME_GRAPH
+LOCAL_DATETIME
+REPEATABLE
+DAY
+UINT
+SIMPLE_COMMENT_SOLIDUS
+BYTES
+TAN
+ALL
+CURRENT_USER
+LN
+ARRAY
+SUBSTRING
+ZONE
+RECORD
+DECIMAL
+ONLY
+NFC
+FROM
+RESET
+VALUE
+LEFT_ARROW_TILDE_BRACKET
+NFD
+RIGHT_BRACKET_MINUS
+ZONED_TIME
+COALESCE
+QUESTION_MARK
+TIMESTAMP
+ACOS
+MINUTE
+EDGE
+GREATER_THAN_OR_EQUALS_OPERATOR
+BOTH
+NULL
+UNIT
+LEFT_TILDE_SLASH
+VERTICAL_BAR
+DIFFERENT
+KEEP
+LEFT_MINUS_SLASH
+BRACKETED_COMMENT
+PARAMETERS
+EXISTING
+EXCEPT
+SOLIDUS
+READ
+DATE
+SHORTEST
+LIKE
+DATA
+DRYRUN
+AND
+PERIOD
+OTHERWISE
+REAL
+INSERT
+CURRENT_DATE
+ATAN
+NO
+FLOAT
+LESS_THAN_OR_EQUALS_OPERATOR
+RIGHT_ANGLE_BRACKET
+CURRENT_TIMESTAMP
+HOUR
+LIMIT
+UINT16
+ANY
+UINT256
+ABSTRACT
+INT
+ROLLBACK
+OF
+REFERENCE
+CARDINALITY
+EDGES
+TILDE_RIGHT_ARROW
+COSH
+NULLS
+RTRIM
+ON
+BRACKET_TILDE_RIGHT_ARROW
+WALK
+RIGHT_BRACE
+DEC
+OR
+COMMIT
+MINUS_SIGN
+UINT128
+USMALLINT
+DOUBLE_COLON
+EQUALS_OPERATOR
+DEGREES
+TEMP
+ACYCLIC
+SMALLINT
+LET
+SECOND
+TILDE
+EXP
+MATCH
+CLEAR
diff --git a/developers/readers/rules_by_catebory.txt b/developers/readers/rules_by_catebory.txt
new file mode 100644 (file)
index 0000000..729f885
--- /dev/null
@@ -0,0 +1,40 @@
+
+#--------------------------------------------------------------------------------
+# Data Types
+#   INTEGER16 is referenced in some rules.  INT16 is referenced in others.
+#
+
+
+BIGINT
+BOOL
+BOOLEAN
+BYTE_STRING_LITERAL
+CHARACTERISTICS
+CHARACTER_LENGTH
+FLOAT256
+INT
+INT8
+INT16
+INT32
+INT64
+INT128
+INT256
+INT256
+INTEGER16
+INTEGER32
+SMALLINT
+UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+
+booleanType
+booleanValueExpression
+byteStringType
+byteStringValueExpression
+decimalExactNumericType
+numericValueExpressionDividend
+signedBinaryExactNumericType
+trimCharacterOrByteString
+trimCharacterOrByteStringSource
+trimMultiCharacterCharacterString
+unsignedInteger
+verboseBinaryExactNumericType
+
diff --git a/developers/readers/rules_by_category.html b/developers/readers/rules_by_category.html
new file mode 100644 (file)
index 0000000..5e28fc0
--- /dev/null
@@ -0,0 +1,101 @@
+<code>
+<h2>Data Types</h2>
+<ul>
+  <li>signedBinaryExactNumericType</li>
+  <li>BYTE_STRING_LITERAL</li>
+  <li>decimalExactNumericType</li>
+  <li>booleanType</li>
+  <li>INT256</li>
+  <li>FLOAT256</li>
+  <li>DATETIME</li>
+  <li>BOOLEAN</li>
+  <li>VARCHAR</li>
+  <li>UNSIGNED_INTEGER</li>
+  <li>numericValueExpressionDividend</li>
+</ul>
+<h2>Identifiers and References</h2>
+<ul>
+  <li>labelName</li>
+  <li>bindingVariable</li>
+  <li>nodeTypeLabelSet</li>
+  <li>absoluteCatalogSchemaReference</li>
+  <li>destinationNodeTypeAlias</li>
+  <li>graphTypeReference</li>
+</ul>
+<h2>Modifiers and Qualifiers</h2>
+<ul>
+  <li>DISTINCT</li>
+  <li>setQuantifier</li>
+  <li>simplifiedDefaultingRight</li>
+  <li>WITH</li>
+  <li>sessionSetSchemaClause</li>
+  <li>sessionSetParameterClause</li>
+  <li>fixedQuantifier</li>
+</ul>
+<h2>Functions</h2>
+<ul>
+  <li>LOG10</li>
+  <li>FLOOR</li>
+  <li>characterOrByteStringFunction</li>
+  <li>ceilingFunction</li>
+  <li>trigonometricFunction</li>
+  <li>durationFunction</li>
+  <li>datetimeFunction</li>
+  <li>generalSetFunction</li>
+  <li>functionCall</li>
+</ul>
+<h2>Expressions and Operators</h2>
+<ul>
+  <li>booleanValueExpression</li>
+  <li>commonLogarithm</li>
+  <li>comparisonPredicatePart2</li>
+  <li>naturalLogarithm</li>
+  <li>powerFunction</li>
+  <li>SIN</li>
+  <li>MINUS_LEFT_BRACKET</li>
+  <li>UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX</li>
+  <li>simplifiedOverrideRight</li>
+</ul>
+<h2>Commands and Statements</h2>
+<ul>
+  <li>SELECT</li>
+  <li>INSERT</li>
+  <li>CREATE</li>
+  <li>DROP</li>
+  <li>ROLLBACK</li>
+  <li>simpleMatchStatement</li>
+  <li>sessionSetCommand</li>
+  <li>matchStatement</li>
+  <li>matchStatementBlock</li>
+  <li>createGraphStatement</li>
+</ul>
+<h2>Patterns and Matching</h2>
+<ul>
+  <li>simpleMatchStatement</li>
+  <li>pathPattern</li>
+  <li>elementPatternPredicate</li>
+  <li>graphPatternYieldClause</li>
+  <li>graphPatternBindingTable</li>
+  <li>pathPrimary</li>
+  <li>pathOrPaths</li>
+  <li>simplifiedPathUnion</li>
+</ul>
+<h2>Structures and Schema</h2>
+<ul>
+  <li>procedureSpecification</li>
+  <li>compositeQueryPrimary</li>
+  <li>procedureBody</li>
+  <li>linearCatalogModifyingStatement</li>
+  <li>graphInitializer</li>
+  <li>schemaReference</li>
+</ul>
+<h2>Miscellaneous</h2>
+<ul>
+  <li>LEFT_ARROW_TILDE</li>
+  <li>SIMPLE_COMMENT_MINUS</li>
+  <li>optionalMatchStatement</li>
+  <li>UNIQUE</li>
+  <li>optionalOperand</li>
+  <li>simplifiedContents</li>
+</ul>
+</code>
diff --git a/developers/readers/terminal_symbol_list.txt b/developers/readers/terminal_symbol_list.txt
new file mode 100644 (file)
index 0000000..14946b0
--- /dev/null
@@ -0,0 +1,361 @@
+#--------------------------------------------------------------------------------
+# terminal symbols in the GQL_20240420 grammar
+#
+
+# Literals
+NULL
+TRUE
+FALSE
+NUMBER
+BOOLEAN_LITERAL
+
+# Data Types
+BIGINT
+BOOL
+BOOLEAN
+BYTES
+BYTE_LENGTH
+BYTE_STRING_LITERAL
+CARDINALITY
+CHAR
+DATE
+DATETIME
+DAY
+DEC
+DECIMAL
+DOUBLE
+DURATION
+DURATION_BETWEEN
+ELEMENT
+ELEMENT_ID
+FLOAT
+FLOAT
+INSTANT
+INT
+INT128
+INT16
+INT256
+INT32
+INT64
+INT8
+INTEGER
+INTERVAL
+MAX
+MIN
+MINUTE
+MODULUS
+MONTH
+NUMERIC
+REAL
+SIZE
+SMALLINT
+TEMP
+TEMPORAL
+TIME
+UBIGINT
+UINT
+UINT128
+UINT16
+UINT256
+UINT32
+UINT64
+UINT8
+UNSIGNED_BINARY_INTEGER
+UNSIGNED_DECIMAL_INTEGER
+UNSIGNED_HEXADECIMAL_INTEGER
+UNSIGNED_OCTAL_INTEGER
+USMALLINT
+VALUE
+VALUES
+VARBINARY
+VARCHAR
+YEAR
+ZONED
+ZONED_DATETIME
+ZONED_TIME
+
+
+# Functions
+ABS
+ACOS
+AGGREGATE
+AGGREGATES
+ALL_DIFFERENT
+ASIN
+ATAN
+AVG
+BTRIM
+CAST
+CEIL
+CEILING
+CHARACTER_LENGTH
+CONCATENATION_OPERATOR
+COS
+COSH
+COT
+COUNT
+EXP
+FLOOR
+LOG
+LOG10
+LOWER
+LTRIM
+MOD
+OCTET_LENGTH
+POSITION
+POWER
+RADIANS
+RTRIM
+SIN
+SINH
+SQRT
+STDDEV_POP
+STDDEV_SAMP
+SUBSTRING
+SUM
+TAN
+TANH
+TRIM
+UPPER
+
+# Punctuation and Operators
+AMPERSAND
+ASTERISK
+BRACKETED_COMMENT
+BRACKET_RIGHT_ARROW
+BRACKET_TILDE_RIGHT_ARROW
+COLON
+COMMA
+COMMERCIAL_AT
+CONCATENATION_OPERATOR
+DOLLAR_SIGN
+DOUBLE_COLON
+DOUBLE_DOLLAR_SIGN
+DOUBLE_PERIOD
+DOUBLE_QUOTE
+DOUBLE_QUOTED_CHARACTER_SEQUENCE
+EQUALS_OPERATOR
+EXCLAMATION_MARK
+GREATER_THAN_OR_EQUALS_OPERATOR
+LEFT_ANGLE_BRACKET
+LEFT_ARROW
+LEFT_BRACE
+LEFT_BRACKET
+LEFT_MINUS_RIGHT
+LEFT_MINUS_SLASH
+LEFT_PAREN
+LEFT_TILDE_SLASH
+LESS_THAN_OR_EQUALS_OPERATOR
+MINUS_LEFT_BRACKET
+MINUS_SIGN
+PERIOD
+PLUS_SIGN
+REVERSE_SOLIDUS
+RIGHT_ANGLE_BRACKET
+RIGHT_ARROW
+RIGHT_BRACE
+RIGHT_BRACKET
+RIGHT_BRACKET_MINUS
+RIGHT_BRACKET_TILDE
+RIGHT_DOUBLE_ARROW
+RIGHT_PAREN
+SINGLE_QUOTED_CHARACTER_SEQUENCE
+SLASH_MINUS
+SLASH_MINUS_RIGHT
+SLASH_TILDE
+SLASH_TILDE_RIGHT
+SOLIDUS
+TILDE
+TILDE_LEFT_BRACKET
+TILDE_RIGHT_ARROW
+TILDE_SLASH
+UNDERSCORE
+VERTICAL_BAR
+
+# Keywords
+ABSTRACT
+ALL
+ALTER
+AND
+ANY
+ARRAY
+AS
+ASC
+ASCENDING
+AT
+BIG
+BINARY
+BINDING
+BINDINGS
+BOTH
+CALL
+CATALOG
+CLEAR
+CLONE
+CLOSE
+COMMIT
+CONSTRAINT
+CREATE
+CURRENT_PROPERTY_GRAPH
+CURRENT_SCHEMA
+DELETE
+DESC
+DESCENDING
+DETACH
+DIFFERENT
+DIRECTED
+DIRECTORY
+DISTINCT
+DROP
+DRYRUN
+ELEMENTS
+EXCEPT
+EXISTING
+EXISTS
+FALSE
+FILTER
+FINISH
+FIRST
+FROM
+FUNCTION
+GENERAL_PARAMETER_REFERENCE
+GRANT
+GROUP
+GROUPS
+HAVING
+HOME_GRAPH
+HOME_PROPERTY_GRAPH
+HOME_SCHEMA
+IN
+INSERT
+INTERSECT
+IS
+KEEP
+LABELED
+LAST
+LEADING
+LEFT
+LEFT_ARROW_BRACKET
+LEFT_ARROW_TILDE
+LIKE
+LIST
+MATCH
+NOT
+NOTHING
+NULL
+NULLIF
+OF
+ON
+ONLY
+OPEN
+OPTIONAL
+OR
+ORDER
+ORDINALITY
+OTHERWISE
+PARENT
+PARENTHESIZED
+PATH
+PATHS
+PRECISION
+PRIMARY
+PRIORITY
+PROCEDURE
+PRODUCT
+PROPERTIES
+PROPERTY
+PROPERTY_EXISTS
+QUANTIFIER
+REFERENCE
+REFERENCES
+REFLECT
+REGULAR
+REMOVE
+RENAME
+REPEATABLE
+REPLACE
+RESET
+RETURN
+REVOKE
+RIGHT
+ROLLBACK
+SAME
+SCHEMA
+SELECT
+SESSION
+SET
+SHORTEST
+SIGNED
+SIMPLE
+SIMPLE_COMMENT_MINUS
+SIMPLE_COMMENT_SOLIDUS
+SOURCE
+SP
+START
+SUBSTITUTED_PARAMETER_REFERENCE
+TABLE
+TO
+TRAIL
+TRAILING
+TRANSACTION
+TRUE
+TYPED
+UNDIRECTED
+UNION
+UNIQUE
+UNIT
+UNSIGNED
+USE
+USING
+VERTEX
+WALK
+WHERE
+WHITESPACE
+WITH
+WITHOUT
+WRITE
+XOR
+YIELD
+ZONE
+
+
+# Control Flow
+BREAK
+CASE
+CONTINUE
+DO
+ELSE
+END
+FOR
+IF
+IMPLIES
+LOOP
+RETURN
+THEN
+WHEN
+WHILE
+
+# Miscellaneous
+ACCENT_QUOTED_CHARACTER_SEQUENCE
+ACYCLIC
+CURRENT_DATE
+CURRENT_GRAPH
+CURRENT_ROLE
+CURRENT_TIME
+CURRENT_TIMESTAMP
+CURRENT_USER
+EDGE
+EDGES
+GQLSTATUS
+GRAPH
+GRAVE_ACCENT
+LABEL
+LABELS
+NODE
+NODES
+RELATIONSHIP
+RELATIONSHIPS
+SESSION_USER
+SYSTEM_USER
+TYPE
+VARIABLE
diff --git a/developers/readers/terminal_symbol_list_unsorted.txt b/developers/readers/terminal_symbol_list_unsorted.txt
new file mode 100644 (file)
index 0000000..80be8af
--- /dev/null
@@ -0,0 +1,346 @@
+ABS
+ABSTRACT
+ACCENT_QUOTED_CHARACTER_SEQUENCE
+ACOS
+ACYCLIC
+AGGREGATE
+AGGREGATES
+ALL
+ALL_DIFFERENT
+ALTER
+AMPERSAND
+AND
+ANY
+ARRAY
+AS
+ASC
+ASCENDING
+ASIN
+ASTERISK
+AT
+ATAN
+AVG
+BIG
+BIGINT
+BINARY
+BINDING
+BINDINGS
+BOOL
+BOOLEAN
+BOOLEAN_LITERAL
+BOTH
+BRACKETED_COMMENT
+BRACKET_RIGHT_ARROW
+BRACKET_TILDE_RIGHT_ARROW
+BTRIM
+BY
+BYTES
+BYTE_LENGTH
+BYTE_STRING_LITERAL
+CALL
+CARDINALITY
+CASE
+CAST
+CATALOG
+CEIL
+CEILING
+CHAR
+CHARACTERISTICS
+CHARACTER_LENGTH
+CHAR_LENGTH
+CLEAR
+CLONE
+CLOSE
+COALESCE
+COLLECT_LIST
+COLON
+COMMA
+COMMERCIAL_AT
+COMMIT
+CONCATENATION_OPERATOR
+CONNECTING
+CONSTRAINT
+COPY
+COS
+COSH
+COT
+COUNT
+CREATE
+CURRENT_DATE
+CURRENT_GRAPH
+CURRENT_PROPERTY_GRAPH
+CURRENT_ROLE
+CURRENT_SCHEMA
+CURRENT_TIME
+CURRENT_TIMESTAMP
+CURRENT_USER
+DATA
+DATE
+DATETIME
+DAY
+DEC
+DECIMAL
+DEGREES
+DELETE
+DESC
+DESCENDING
+DESTINATION
+DETACH
+DIFFERENT
+DIRECTED
+DIRECTORY
+DISTINCT
+DOLLAR_SIGN
+DOUBLE
+DOUBLE_COLON
+DOUBLE_DOLLAR_SIGN
+DOUBLE_PERIOD
+DOUBLE_QUOTE
+DOUBLE_QUOTED_CHARACTER_SEQUENCE
+DROP
+DRYRUN
+DURATION
+DURATION_BETWEEN
+EDGE
+EDGES
+ELEMENT
+ELEMENTS
+ELEMENT_ID
+ELSE
+END
+EQUALS_OPERATOR
+EXACT
+EXCEPT
+EXCLAMATION_MARK
+EXISTING
+EXISTS
+EXP
+FILTER
+FINISH
+FIRST
+FLOAT
+FLOOR
+FOR
+FROM
+FUNCTION
+GENERAL_PARAMETER_REFERENCE
+GQLSTATUS
+GRANT
+GRAPH
+GRAVE_ACCENT
+GREATER_THAN_OR_EQUALS_OPERATOR
+GROUP
+GROUPS
+HAVING
+HOME_GRAPH
+HOME_PROPERTY_GRAPH
+HOME_SCHEMA
+HOUR
+IF
+IMPLIES
+IN
+INFINITY
+INSERT
+INSTANT
+INT
+INTEGER
+INTERSECT
+INTERVAL
+IS
+KEEP
+LABEL
+LABELED
+LABELS
+LAST
+LEADING
+LEFT
+LEFT_ANGLE_BRACKET
+LEFT_ARROW
+LEFT_ARROW_BRACKET
+LEFT_ARROW_TILDE
+LEFT_BRACE
+LEFT_BRACKET
+LEFT_MINUS_RIGHT
+LEFT_MINUS_SLASH
+LEFT_PAREN
+LEFT_TILDE_SLASH
+LESS_THAN_OR_EQUALS_OPERATOR
+LIKE
+LIST
+LOG
+LOG10
+LOWER
+LTRIM
+MATCH
+MAX
+MIN
+MINUS_LEFT_BRACKET
+MINUS_SIGN
+MINUTE
+MOD
+MODULUS
+MONTH
+MULTISET_ALTERNATION_OPERATOR
+NFKC
+NFKD
+NODE
+NODETACH
+NORMALIZE
+NOT
+NOT_EQUALS_OPERATOR
+NOTHING
+NULL
+NULLIF
+NUMBER
+NUMERIC
+OCTET_LENGTH
+OF
+ON
+ONLY
+OPEN
+OPTIONAL
+OR
+ORDER
+ORDINALITY
+OTHERWISE
+PARENT
+PARENTHESIZED
+PATH
+PATHS
+PERCENT
+PERIOD
+PLUS_SIGN
+POWER
+PRECISION
+PRIMARY
+PRIORITY
+PROCEDURE
+PRODUCT
+PROPERTIES
+PROPERTY
+PROPERTY_EXISTS
+QUANTIFIER
+QUOTE
+RADIANS
+REAL
+REFERENCE
+REFERENCES
+REFLECT
+REGULAR
+REMOVE
+RENAME
+REPEATABLE
+REPLACE
+RESET
+RETURN
+REVERSE_SOLIDUS
+REVOKE
+RIGHT
+RIGHT_ANGLE_BRACKET
+RIGHT_ARROW
+RIGHT_BRACE
+RIGHT_BRACKET
+RIGHT_BRACKET_MINUS
+RIGHT_BRACKET_TILDE
+RIGHT_DOUBLE_ARROW
+RIGHT_PAREN
+ROLLBACK
+RTRIM
+SAME
+SCHEMA
+SECOND
+SELECT
+SESSION
+SESSION_USER
+SET
+SHORTEST
+SIGNED
+SIMPLE
+SIMPLE_COMMENT_MINUS
+SIMPLE_COMMENT_SOLIDUS
+SIN
+SINGLE_QUOTED_CHARACTER_SEQUENCE
+SINH
+SIZE
+SKIP_RESERVED_WORD
+SLASH_MINUS
+SLASH_MINUS_RIGHT
+SLASH_TILDE
+SLASH_TILDE_RIGHT
+SMALL
+SMALLINT
+SOLIDUS
+SOURCE
+SP
+SQRT
+START
+STDDEV_POP
+STDDEV_SAMP
+STRING
+SUBSTITUTED_PARAMETER_REFERENCE
+SUBSTRING
+SUM
+SYSTEM_USER
+TABLE
+TAN
+TANH
+TEMP
+TEMPORAL
+THEN
+TILDE
+TILDE_LEFT_BRACKET
+TILDE_RIGHT_ARROW
+TILDE_SLASH
+TIME
+TIMESTAMP
+TO
+TRAIL
+TRAILING
+TRANSACTION
+TRIM
+TYPE
+TYPED
+UBIGINT
+UINT
+UNDERSCORE
+UNDIRECTED
+UNION
+UNIQUE
+UNIT
+UNSIGNED
+UNSIGNED_BINARY_INTEGER
+UNSIGNED_DECIMAL_INTEGER
+UNSIGNED_DECIMAL_INTEGER_WITH_APPROXIMATE_NUMBER_SUFFIX
+UNSIGNED_DECIMAL_INTEGER_WITH_EXACT_NUMBER_SUFFIX
+UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITHOUT_SUFFIX
+UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+UNSIGNED_DECIMAL_IN_COMMON_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITHOUT_SUFFIX
+UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_APPROXIMATE_NUMBER_SUFFIX
+UNSIGNED_DECIMAL_IN_SCIENTIFIC_NOTATION_WITH_EXACT_NUMBER_SUFFIX
+UNSIGNED_HEXADECIMAL_INTEGER
+UNSIGNED_OCTAL_INTEGER
+UPPER
+USE
+USMALLINT
+VALUE
+VALUES
+VARBINARY
+VARCHAR
+VARIABLE
+VERTEX
+VERTICAL_BAR
+WALK
+WHEN
+WHERE
+WHITESPACE
+WITH
+WITHOUT
+WRITE
+XOR
+YEAR
+YIELD
+ZONE
+ZONED
+ZONED_DATETIME
+ZONED_TIME
diff --git a/developers/tanuki/.gitignore b/developers/tanuki/.gitignore
new file mode 100644 (file)
index 0000000..2db43ed
--- /dev/null
@@ -0,0 +1,4 @@
+
+*
+!/.gitignore
+
diff --git a/developers/test/Arithmetic_SyntaxAnnotate__Test_0.txt b/developers/test/Arithmetic_SyntaxAnnotate__Test_0.txt
new file mode 100644 (file)
index 0000000..fe7e39e
--- /dev/null
@@ -0,0 +1 @@
+3 + 5
diff --git a/developers/test/Arithmetic_SyntaxAnnotate__Test_1.txt b/developers/test/Arithmetic_SyntaxAnnotate__Test_1.txt
new file mode 100644 (file)
index 0000000..fe7e39e
--- /dev/null
@@ -0,0 +1 @@
+3 + 5
diff --git a/developers/test/Arithmetic_SyntaxAnnotate__Test_2.txt b/developers/test/Arithmetic_SyntaxAnnotate__Test_2.txt
new file mode 100644 (file)
index 0000000..1603bfc
--- /dev/null
@@ -0,0 +1,2 @@
+2 * (3 + 4)
+
diff --git a/developers/test/Arithmetic_SyntaxAnnotate__Test_3.txt b/developers/test/Arithmetic_SyntaxAnnotate__Test_3.txt
new file mode 100644 (file)
index 0000000..d11b7e2
--- /dev/null
@@ -0,0 +1 @@
+10 / 2
diff --git a/developers/test/Arithmetic_SyntaxAnnotate__Test_4.txt b/developers/test/Arithmetic_SyntaxAnnotate__Test_4.txt
new file mode 100644 (file)
index 0000000..df1f368
--- /dev/null
@@ -0,0 +1,2 @@
+3 + 5 * (10 - 4)
+
diff --git a/developers/test/Neo4NBA/create_relationship_0.cypher b/developers/test/Neo4NBA/create_relationship_0.cypher
new file mode 100644 (file)
index 0000000..1f35649
--- /dev/null
@@ -0,0 +1,2 @@
+MATCH (player:Player {name: 'LeBron James'}), (team:Team {name: 'Lakers'})
+CREATE (player)-[:PLAYS_FOR]->(team)
diff --git a/developers/test/Neo4NBA/create_team_0.cypher b/developers/test/Neo4NBA/create_team_0.cypher
new file mode 100644 (file)
index 0000000..136ad4c
--- /dev/null
@@ -0,0 +1 @@
+CREATE (team:Team {name: 'Lakers', city: 'Los Angeles'})
diff --git a/developers/test/Neo4NBA/delete_player_and_relationship.cypher b/developers/test/Neo4NBA/delete_player_and_relationship.cypher
new file mode 100644 (file)
index 0000000..9f5d1b1
--- /dev/null
@@ -0,0 +1,3 @@
+MATCH (player:Player {name: 'LeBron James'})-[r:PLAYS_FOR]->(team:Team {name: 'Lakers'})
+DELETE r
+DELETE player
diff --git a/developers/test/Neo4NBA/notes.txt b/developers/test/Neo4NBA/notes.txt
new file mode 100644 (file)
index 0000000..e6410e4
--- /dev/null
@@ -0,0 +1,4 @@
+https://github.com/iftahro/Neo4NBA
+
+It appears these Cypher examples also conform to GQL syntax.
+
diff --git a/developers/test/Neo4NBA/query_players_by_team_0.cypher b/developers/test/Neo4NBA/query_players_by_team_0.cypher
new file mode 100644 (file)
index 0000000..8098ef0
--- /dev/null
@@ -0,0 +1,2 @@
+MATCH (player:Player)-[:PLAYS_FOR]->(team:Team {name: 'Lakers'})
+RETURN player.name
diff --git a/developers/test/Neo4NBA/updating_nodes_0.cypher b/developers/test/Neo4NBA/updating_nodes_0.cypher
new file mode 100644 (file)
index 0000000..aab1285
--- /dev/null
@@ -0,0 +1,2 @@
+MATCH (team:Team {name: 'Lakers'})
+SET team.championships = 17
diff --git a/developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(double_colon).gql b/developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(double_colon).gql
new file mode 100644 (file)
index 0000000..376c053
--- /dev/null
@@ -0,0 +1 @@
+CREATE GRAPH mySocialNetwork ::socialNetworkGraphType
diff --git a/developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(lexical).gql b/developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_graph_type_(lexical).gql
new file mode 100644 (file)
index 0000000..b0a7160
--- /dev/null
@@ -0,0 +1 @@
+CREATE GRAPH mySocialNetwork TYPED socialNetworkGraphType
diff --git a/developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_nested_graph_type_(double_colon).gql b/developers/test/opengql_grammar_samples_20240801/create_closed_graph_from_nested_graph_type_(double_colon).gql
new file mode 100644 (file)
index 0000000..2166f79
--- /dev/null
@@ -0,0 +1 @@
+CREATE GRAPH mySocialNetwork ::{(City :City {name STRING, state STRING, country STRING})}
diff --git a/developers/test/opengql_grammar_samples_20240801/create_graph.gql b/developers/test/opengql_grammar_samples_20240801/create_graph.gql
new file mode 100644 (file)
index 0000000..b415659
--- /dev/null
@@ -0,0 +1,15 @@
+CREATE GRAPH mygraph ANY
+
+CREATE GRAPH mygraph {
+  (Person :Person {lastname STRING, firstname STRING,joined DATE})
+}
+
+CREATE GRAPH mygraph mygraphtype
+
+CREATE GRAPH /mygraph LIKE /mysrcgraph
+
+CREATE GRAPH mygraph ANY AS COPY OF mysrcgraph
+
+CREATE GRAPH mygraph {
+  (Person :Person {lastname STRING, firstname STRING,joined DATE})
+} AS COPY OF mysrcgraph
diff --git a/developers/test/opengql_grammar_samples_20240801/create_schema.gql b/developers/test/opengql_grammar_samples_20240801/create_schema.gql
new file mode 100644 (file)
index 0000000..7a2277f
--- /dev/null
@@ -0,0 +1,6 @@
+CREATE SCHEMA /myschema
+
+CREATE SCHEMA /foo/myschema
+
+CREATE SCHEMA /foo
+NEXT CREATE SCHEMA /fee
diff --git a/developers/test/opengql_grammar_samples_20240801/insert_statement.gql b/developers/test/opengql_grammar_samples_20240801/insert_statement.gql
new file mode 100644 (file)
index 0000000..82e14eb
--- /dev/null
@@ -0,0 +1,3 @@
+INSERT (:Person { firstname: 'Firstname', lastname: 'Lastname', joined: DATE '2023-01-01' })
+        -[:MEMBER_SINCE { since: "2023-03-20" }]->
+        (:Team { name: 'Teamname' })
diff --git a/developers/test/opengql_grammar_samples_20240801/match_and_insert_example.gql b/developers/test/opengql_grammar_samples_20240801/match_and_insert_example.gql
new file mode 100644 (file)
index 0000000..0e36828
--- /dev/null
@@ -0,0 +1,2 @@
+MATCH (a { firstname: 'Robert' }), (b { lastname: 'Kowalski' })
+INSERT (a)-[:GRADUATED]->(b)
diff --git a/developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_braces).gql b/developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_braces).gql
new file mode 100644 (file)
index 0000000..86a8dd2
--- /dev/null
@@ -0,0 +1,3 @@
+MATCH (p:Person)-[r:IS_FRIENDS_WITH]->(friend:Person)
+WHERE EXISTS (MATCH (p)-[:WORKS_FOR]->(:Company {name: "GQL, Inc."}))
+RETURN p, r, friend
diff --git a/developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_parentheses).gql b/developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(match_block_statement_in_parentheses).gql
new file mode 100644 (file)
index 0000000..e4cb493
--- /dev/null
@@ -0,0 +1,3 @@
+MATCH (p:Person)-[r:IS_FRIENDS_WITH]->(friend:Person)
+WHERE EXISTS (MATCH (p)-[:WORKS_FOR]->(:Company { name: "GQL, Inc."}) )
+RETURN p, r, friend
diff --git a/developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(nested_match_statement).gql b/developers/test/opengql_grammar_samples_20240801/match_with_exists_predicate_(nested_match_statement).gql
new file mode 100644 (file)
index 0000000..9e461d8
--- /dev/null
@@ -0,0 +1,3 @@
+MATCH (p:Person)-[r:IS_FRIENDS_WITH]->(friend:Person)
+WHERE EXISTS { MATCH (p)-[:WORKS_FOR]->(:Company { name: "GQL, Inc." }) RETURN p }
+RETURN p, r, friend
diff --git a/developers/test/opengql_grammar_samples_20240801/session_set_graph_to_current_graph.gql b/developers/test/opengql_grammar_samples_20240801/session_set_graph_to_current_graph.gql
new file mode 100644 (file)
index 0000000..4b0e3fd
--- /dev/null
@@ -0,0 +1 @@
+SESSION SET GRAPH CURRENT_GRAPH
diff --git a/developers/test/opengql_grammar_samples_20240801/session_set_graph_to_current_property_graph.gql b/developers/test/opengql_grammar_samples_20240801/session_set_graph_to_current_property_graph.gql
new file mode 100644 (file)
index 0000000..0565fda
--- /dev/null
@@ -0,0 +1 @@
+SESSION SET GRAPH CURRENT_PROPERTY_GRAPH
diff --git a/developers/test/opengql_grammar_samples_20240801/session_set_property_as_value.gql b/developers/test/opengql_grammar_samples_20240801/session_set_property_as_value.gql
new file mode 100644 (file)
index 0000000..7107a66
--- /dev/null
@@ -0,0 +1 @@
+SESSION SET VALUE IF NOT EXISTS $exampleProperty = DATE '2022-10-10'
diff --git a/developers/test/opengql_grammar_samples_20240801/session_set_time_zone.gql b/developers/test/opengql_grammar_samples_20240801/session_set_time_zone.gql
new file mode 100644 (file)
index 0000000..f590e9b
--- /dev/null
@@ -0,0 +1 @@
+SESSION SET TIME ZONE "utc"
diff --git a/developers/test/transcript_Arithmetic_Syntax__Test.sh b/developers/test/transcript_Arithmetic_Syntax__Test.sh
new file mode 100644 (file)
index 0000000..d05b814
--- /dev/null
@@ -0,0 +1,33 @@
+2024-09-05T01:46:03Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> make Arithmetic_Syntax__Test
+mkdir -p ANTLR javac jvm
+mkdir -p executor test deprecated experiment ologist temporary
+/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
+make[1]: Nothing to be done for 'all'.
+/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Syntax__Test
+ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
+making grammar from: ANTLR/Arithmetic.g4
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
+/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Syntax__Test
+ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
+Compiling javac/Arithmetic_Syntax__Test.java...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Syntax__Test.java
+Created jvm/Arithmetic_Syntax__Test.class
+Building Arithmetic_Syntax__Test...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Syntax__Test.jar -C jvm Arithmetic_Syntax__Test.class
+Created jvm/Arithmetic_Syntax__Test.jar
+Creating script for Arithmetic_Syntax__Test...
+chmod +x executor/Arithmetic_Syntax__Test
+Created script executor/Arithmetic_Syntax__Test
+
+2024-09-05T01:46:11Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax__Test
+Total tests run: 5
+Total tests passed: 5
+Total tests failed: 0
+
+2024-09-05T01:46:16Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> 
diff --git a/developers/test/transcript_RuleNameList.sh b/developers/test/transcript_RuleNameList.sh
new file mode 100644 (file)
index 0000000..e2d089a
--- /dev/null
@@ -0,0 +1,139 @@
+2024-09-05T07:24:43Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
+> make Arithmetic_Echo
+mkdir -p ANTLR javac jvm executor test deprecated experiment ologist temporary
+/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
+make[1]: Nothing to be done for 'all'.
+/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Echo
+copiling grammar from: ANTLR/Arithmetic.g4
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
+/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Echo
+Compiling javac/Arithmetic_Echo.java...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Echo.java
+Created jvm/Arithmetic_Echo.class
+Building Arithmetic_Echo...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Echo.jar -C jvm Arithmetic_Echo.class
+Created jvm/Arithmetic_Echo.jar
+Creating script for Arithmetic_Echo...
+chmod +x executor/Arithmetic_Echo
+Created script executor/Arithmetic_Echo
+
+ [cut]
+
+2024-09-05T07:26:04Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
+> make RuleNameList
+mkdir -p ANTLR javac jvm executor test deprecated experiment ologist temporary
+/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
+make[1]: Nothing to be done for 'all'.
+/bin/make -f executor/makefile-project.mk -r --no-print-directory RuleNameList
+Compiling javac/RuleNameList.java...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/RuleNameList.java
+Created jvm/RuleNameList.class
+Building RuleNameList...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/RuleNameList.jar -C jvm RuleNameList.class
+Created jvm/RuleNameList.jar
+Creating script for RuleNameList...
+chmod +x executor/RuleNameList
+Created script executor/RuleNameList
+
+2024-09-05T07:28:47Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
+> RuleNameList Arithmetic
+Rule names found in the grammar:
+program
+expression
+
+2024-09-05T07:29:09Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
+> make ANTLRv4_Syntax
+mkdir -p ANTLR javac jvm executor test deprecated experiment ologist temporary
+/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
+make[1]: Nothing to be done for 'all'.
+/bin/make -f executor/makefile-project.mk -r --no-print-directory ANTLRv4_Syntax
+making lexer grammar from: ANTLR/ANTLRv4Lexer.g4
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/ANTLRv4Lexer.g4
+making other grammar files from: ANTLR/ANTLRv4Parser.g4
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -lib javac/ANTLR -o javac ANTLR/ANTLRv4Parser.g4
+executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4Visitor.java'.
+executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4BaseVisitor.java'.
+executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4Listener.java'.
+executor/makefile-project.mk:179: warning: pattern recipe did not update peer target 'javac/ANTLR/ANTLRv4BaseListener.java'.
+/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/ANTLRv4_Syntax
+Compiling javac/ANTLRv4_Syntax.java...
+
+ [ had errors, but we only need the grammar to be made ]
+
+2024-09-05T07:31:03Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
+> RuleNameList ANTLRv4
+Rule names found in the grammar:
+grammarSpec
+grammarDecl
+grammarType
+prequelConstruct
+optionsSpec
+option
+optionValue
+delegateGrammars
+delegateGrammar
+tokensSpec
+channelsSpec
+idList
+action_
+actionScopeName
+actionBlock
+argActionBlock
+modeSpec
+rules
+ruleSpec
+parserRuleSpec
+exceptionGroup
+exceptionHandler
+finallyClause
+rulePrequel
+ruleReturns
+throwsSpec
+localsSpec
+ruleAction
+ruleModifiers
+ruleModifier
+ruleBlock
+ruleAltList
+labeledAlt
+lexerRuleSpec
+lexerRuleBlock
+lexerAltList
+lexerAlt
+lexerElements
+lexerElement
+lexerBlock
+lexerCommands
+lexerCommand
+lexerCommandName
+lexerCommandExpr
+altList
+alternative
+element
+predicateOptions
+predicateOption
+labeledElement
+ebnf
+blockSuffix
+ebnfSuffix
+lexerAtom
+atom
+notSet
+blockSet
+setElement
+block
+ruleref
+characterRange
+terminalDef
+elementOptions
+elementOption
+identifier
+
+2024-09-05T07:31:24Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
+> 
diff --git a/developers/test/transcript_notes.txt b/developers/test/transcript_notes.txt
new file mode 100644 (file)
index 0000000..2d48a3f
--- /dev/null
@@ -0,0 +1,4 @@
+
+2024-09-06T01:27:05Z[GQL_to_Cypher] In test file names the word `Syntax` was
+changed to `SyntaxAnnotate`.
+
diff --git a/developers/test/transcript_test_Arithmetic_Echo.sh b/developers/test/transcript_test_Arithmetic_Echo.sh
new file mode 100644 (file)
index 0000000..005a636
--- /dev/null
@@ -0,0 +1,56 @@
+2024-09-05T01:03:35Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> make Arithmetic_Echo
+mkdir -p ANTLR javac jvm
+mkdir -p executor test deprecated experiment ologist temporary
+/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
+make[1]: Nothing to be done for 'all'.
+/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Echo
+ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
+making grammar from: ANTLR/Arithmetic.g4
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
+/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Echo
+ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
+Compiling javac/Arithmetic_Echo.java...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Echo.java
+Created jvm/Arithmetic_Echo.class
+Building Arithmetic_Echo...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Echo.jar -C jvm Arithmetic_Echo.class
+Created jvm/Arithmetic_Echo.jar
+Creating script for Arithmetic_Echo...
+chmod +x executor/Arithmetic_Echo
+Created script executor/Arithmetic_Echo
+
+2024-09-05T01:03:43Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Echo Arithmetic_Syntax__Test_0.txt
+(3 + 5)
+
+2024-09-05T01:04:01Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Echo Arithmetic_Syntax__Test_1.txt
+(3 + 5)
+
+2024-09-05T01:04:05Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Echo Arithmetic_Syntax__Test_2.txt
+(2 * (3 + 4))
+
+2024-09-05T01:04:11Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Echo Arithmetic_Syntax__Test_3.txt
+(10 / 2)
+
+2024-09-05T01:04:14Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Echo Arithmetic_Syntax__Test_4.txt
+(3 + (5 * (10 - 4)))
+
+2024-09-05T01:05:11Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> clean program Arithmetic_Echo
+Deleting program files for 'Arithmetic_Echo'
+
+2024-09-05T01:05:23Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+>
diff --git a/developers/test/transcript_test_Arithmetic_Syntax.sh b/developers/test/transcript_test_Arithmetic_Syntax.sh
new file mode 100644 (file)
index 0000000..a46c4b1
--- /dev/null
@@ -0,0 +1,157 @@
+2024-09-05T01:05:48Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> make Arithmetic_Syntax
+mkdir -p ANTLR javac jvm
+mkdir -p executor test deprecated experiment ologist temporary
+/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
+make[1]: Nothing to be done for 'all'.
+/bin/make -f executor/makefile-project.mk -r --no-print-directory Arithmetic_Syntax
+ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
+making grammar from: ANTLR/Arithmetic.g4
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/java -jar /var/user_data/Thomas-developer/GQL_to_Cypher/tool/executor/antlr-4.11.1-complete.jar -Dlanguage=Java -visitor -o javac ANTLR/Arithmetic.g4
+/bin/make -r --no-print-directory -f executor/makefile-project.mk executor/Arithmetic_Syntax
+ANTLR_OUT_Arithmetic_FPL: javac/ANTLR/ArithmeticLexer.java javac/ANTLR/ArithmeticParser.java javac/ANTLR/ArithmeticVisitor.java javac/ANTLR/ArithmeticBaseVisitor.java
+Compiling javac/Arithmetic_Syntax.java...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/Arithmetic_Syntax.java
+Created jvm/Arithmetic_Syntax.class
+Building Arithmetic_Syntax...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/Arithmetic_Syntax.jar -C jvm Arithmetic_Syntax.class
+Created jvm/Arithmetic_Syntax.jar
+Creating script for Arithmetic_Syntax...
+chmod +x executor/Arithmetic_Syntax
+Created script executor/Arithmetic_Syntax
+
+2024-09-05T01:06:00Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_0.txt 
+program
+  expression(
+    expression(
+      INT(3)
+    )
+    operator(+)
+    expression(
+      INT(5)
+    )
+  )
+
+
+2024-09-05T01:06:28Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_1.txt 
+program
+  expression(
+    expression(
+      INT(3)
+    )
+    operator(+)
+    expression(
+      INT(5)
+    )
+  )
+
+
+2024-09-05T01:06:41Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_2.txt 
+program
+  expression(
+    expression(
+      INT(2)
+    )
+    operator(*)
+    expression(
+      (
+        expression(
+          expression(
+            INT(3)
+          )
+          operator(+)
+          expression(
+            INT(4)
+          )
+        )
+      )
+    )
+  )
+
+
+2024-09-05T01:06:46Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_3.txt 
+program
+  expression(
+    expression(
+      INT(10)
+    )
+    operator(/)
+    expression(
+      INT(2)
+    )
+  )
+
+
+2024-09-05T01:06:50Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax -pp Arithmetic_Syntax__Test_4.txt 
+program
+  expression(
+    expression(
+      INT(3)
+    )
+    operator(+)
+    expression(
+      expression(
+        INT(5)
+      )
+      operator(*)
+      expression(
+        (
+          expression(
+            expression(
+              INT(10)
+            )
+            operator(-)
+            expression(
+              INT(4)
+            )
+          )
+        )
+      )
+    )
+  )
+
+
+2024-09-05T01:06:57Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax Arithmetic_Syntax__Test_0.txt 
+program(expression(INT(3) operator(+) INT(5)))
+
+2024-09-05T01:07:12Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax Arithmetic_Syntax__Test_1.txt 
+program(expression(INT(3) operator(+) INT(5)))
+
+2024-09-05T01:07:17Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax Arithmetic_Syntax__Test_2.txt 
+program(expression(INT(2) operator(*) (expression(INT(3) operator(+) INT(4)))))
+
+2024-09-05T01:07:21Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax Arithmetic_Syntax__Test_3.txt 
+program(expression(INT(10) operator(/) INT(2)))
+
+2024-09-05T01:07:24Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> Arithmetic_Syntax Arithmetic_Syntax__Test_4.txt 
+program(expression(INT(3) operator(+) expression(INT(5) operator(*) (expression(INT(10) operator(-) INT(4))))))
+
+2024-09-05T01:07:29Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> clean program Arithmetic_Syntax
+Deleting program files for 'Arithmetic_Syntax'
+
+2024-09-05T01:07:53Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> 
diff --git a/developers/test/transcript_test_PrintRuleNameListRegx.sh b/developers/test/transcript_test_PrintRuleNameListRegx.sh
new file mode 100644 (file)
index 0000000..f374647
--- /dev/null
@@ -0,0 +1,55 @@
+2024-09-05T02:06:09Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer§
+> cd test
+
+2024-09-05T02:06:11Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> PrintRuleNameListRegx
+bash: /var/user_data/Thomas-developer/GQL_to_Cypher/developer/executor/PrintRuleNameListRegx: No such file or directory
+
+2024-09-05T02:06:18Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> make PrintRuleNameListRegx
+mkdir -p ANTLR javac jvm
+mkdir -p executor test deprecated experiment ologist temporary
+/bin/make -f executor/makefile-tool.mk -r --no-print-directory all
+make[1]: Nothing to be done for 'all'.
+/bin/make -f executor/makefile-project.mk -r --no-print-directory PrintRuleNameListRegx
+Compiling javac/PrintRuleNameListRegx.java...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/javac -d jvm -sourcepath javac:javac/ANTLR javac/PrintRuleNameListRegx.java
+Created jvm/PrintRuleNameListRegx.class
+Building PrintRuleNameListRegx...
+/var/user_data/Thomas-developer/GQL_to_Cypher/tool/jdk-22.0.1+8/bin/jar cf jvm/PrintRuleNameListRegx.jar -C jvm PrintRuleNameListRegx.class
+Created jvm/PrintRuleNameListRegx.jar
+Creating script for PrintRuleNameListRegx...
+chmod +x executor/PrintRuleNameListRegx
+Created script executor/PrintRuleNameListRegx
+
+2024-09-05T02:06:39Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> PrintRuleNameListRegx
+Usage: PrintRuleNameListRegx <path-to-g4-file>
+
+2024-09-05T02:06:44Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> PrintRuleNameListRegx ../ANTLR/Arithmetic.g4 
+Extracted Rules:
+expression
+program
+WS
+INT
+
+2024-09-05T02:06:53Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> clean PrintRuleNameListRegx
+Unknown clean option: PrintRuleNameListRegx
+
+2024-09-05T02:07:18Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+> clean program PrintRuleNameListRegx
+Deleting program files for 'PrintRuleNameListRegx'
+
+2024-09-05T02:07:25Z[GQL_to_Cypher]
+Thomas-developer@Vivobook12§/var/user_data/Thomas-developer/GQL_to_Cypher/developer/test§
+>
+
index 22d6736..6cf8a9c 100755 (executable)
@@ -13,7 +13,7 @@ handle_error() {
 }
 
 # Clean the ANTLR directory
-antlr_dir=$(find "$REPO_HOME/tool" -maxdepth 1 -type d -name "antlr4-*" | head -n 1)
+antlr_dir=$(find "$REPO_HOME/toolsmiths" -maxdepth 1 -type d -name "antlr4-*" | head -n 1)
 if [ -n "$antlr_dir" ]; then
   find "$antlr_dir" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
   find "$antlr_dir" -maxdepth 1 -type l -exec rm -f {} + || handle_error
index 8c7df26..92b870d 100755 (executable)
@@ -13,7 +13,7 @@ handle_error() {
 }
 
 # Clean the JDK directory
-jdk_dir=$(find "$REPO_HOME/tool" -maxdepth 1 -type d -name "jdk-*" | head -n 1)
+jdk_dir=$(find "$REPO_HOME/toolsmiths" -maxdepth 1 -type d -name "jdk-*" | head -n 1)
 if [ -n "$jdk_dir" ]; then
   find "$jdk_dir" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
   find "$jdk_dir" -maxdepth 1 -type l -exec rm -f {} + || handle_error
index 2fc57e3..00bf610 100755 (executable)
@@ -13,10 +13,10 @@ handle_error() {
 }
 
 # Check if the upstream directory exists
-if [ -d "$REPO_HOME/tool/upstream" ]; then
+if [ -d "$REPO_HOME/toolsmith/upstream" ]; then
   echo "Cleaning up upstream directory..."
-  find "$REPO_HOME/tool/upstream" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
-  find "$REPO_HOME/tool/upstream" -maxdepth 1 -type l -exec rm -f {} + || handle_error
+  find "$REPO_HOME/toolsmiths/upstream" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
+  find "$REPO_HOME/toolsmiths/upstream" -maxdepth 1 -type l -exec rm -f {} + || handle_error
 else
   echo "Upstream directory does not exist."
 fi
index fa64f82..2bf6470 100644 (file)
@@ -12,12 +12,12 @@ if [ -z "$REPO_HOME" ]; then
   source "${script_path}/env_base"
 fi
 
-export DEVELOPER_HOME="$REPO_HOME/developer"
-export GRADLE_HOME="$REPO_HOME/tool/gradle-8.10-rc-1"
+export DEVELOPER_HOME="$REPO_HOME/developers"
+export GRADLE_HOME="$REPO_HOME/toolsmiths/gradle-8.10-rc-1"
 
 export PATH=\
 "$DEVELOPER_HOME"/executor\
-:"$REPO_HOME"/tool/executor\
+:"$REPO_HOME"/toolsmiths/executor\
 :"$GRADLE_HOME"/bin\
 :"$PATH"
 
index d784e3e..080c784 100644 (file)
@@ -12,9 +12,18 @@ if [ -z "$REPO_HOME" ]; then
   source "${script_path}/env_base"
 fi
 
-PATH="$REPO_HOME/executor:$PATH"
 PROJECT="$PROJECT"_PM
 
+export GRADLE_HOME="$REPO_HOME/toolsmiths/gradle-8.10-rc-1"
+
+# includes tools for installing and testing
+export PATH=\
+"$REPO_HOME"/executor\
+:"$REPO_HOME"/toolsmiths/executor\
+:"$GRADLE_HOME"/bin\
+:"$PATH"
+
+# no sneaky hidden files
 alias ls="ls -a"
 
 echo "${BASH_SOURCE[0]}" "complete"
diff --git a/executor/install_tools.txt b/executor/install_tools.txt
new file mode 100644 (file)
index 0000000..c58b9d2
--- /dev/null
@@ -0,0 +1,36 @@
+
+1. install gradle
+
+  As of the date of this writing, `gradle` is not available in the typical
+  repos, so:
+
+    cd "$REPO_HOME/toolsmiths/upstream"
+    curl -O https://services.gradle.org/distributions/gradle-8.10-rc-1-all.zip
+
+    cd "REPO_HOME"
+    unzip toolsmiths/upstream/gradle-8.10-rc-1-all.zip -d toolsmiths/
+
+    place in user's environment:
+    export GRADLE_HOME="$REPO_HOME/toolsmiths/gradle-8.10-rc-1"
+    export PATH="$GRADLE_HOME/bin:$PATH"
+
+2. other tool install scripts have been integrated into `$REPO_HOME/build.gradle`.
+(There is a separate `developer/build.gradle` for building the project. the
+$REPO_HOME/build.gradle is for installing the tools.
+
+3. about Groovy ...
+
+  $REPO_HOME/build.gradle makes the 'groovy' interpreter is a shell script
+  wrapper around the gradle library groovy jar.  Admin privileges are not needed
+  for this. 
+
+  To install Groovy directly:
+
+  sudo apt-get install groovy
+  sudo dnf install groovy
+
+  curl -s "https://get.sdkman.io" | bash
+  source "$HOME/.sdkman/bin/sdkman-init.sh"
+  sdk install groovy
+
+  .. apparently sdk can also be used to install gradle
diff --git a/ologist/README.md b/ologist/README.md
deleted file mode 100644 (file)
index 21b4176..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-This directory contains project management documentation.  Find here information
-about the directory structure, tools used, and installation required for setting
-up the environment.
-
-The `lector` directory under `developer` has documentation for the code
-being developed.
diff --git a/ologist/directory_structure.md b/ologist/directory_structure.md
deleted file mode 100644 (file)
index 36d4e9f..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-**directory_structure.txt**
-
-# Property-Based Directory Naming
-
-We think of a directory name as being the value of a property, where this
-property is shared by each and every file in said directory.
-
-When developing programs, we use a number of tools that process files. In this
-context, these are common property values to think of files having in common:
-
-* `processed_by`
-* `category_processed_by`
-
-The `processed_by` property is also known as `input`, which is often shortened
-to `in`. For example, C files to be compiled are processed by `cc`, so `cc` is a
-fine name for the directory. Other names could be `processed_by_cc`, `cc_input`,
-or `cc_in`.
-
-When input files destined to be processed by more than one related program are
-mixed in a directory, we generalize to the category. For example, a directory
-holding a collection of both Rust and C files could be called `compiler`, where
-`compiler` is the property that the related processing programs have. A mix of
-interpreted scripts destined to be processed by different interpreters could be
-`interpreter`.
-
-Files directly loaded and run by the machine are `processed_by` the architecture
-(e.g., `x86`) or `category_processed_by` a `machine`.
-
-An interpreter creates machine code on-the-fly. Calling an interpreter is the
-final step in a development chain, similar to calling the loader for a machine
-file. So, let us call the loader or the interpreter an `executor`. Thus, files
-in such a mixed directory are to be processed by an executor.
-
-The processing of files in a collection can be done by a person. Such is the
-case of the directory used by developers when they work, hence such a directory
-is called `developer`.
-
-We run into a bit of a problem when there is no word in English for the role a
-person plays when processing files in a directory. Such is the case for a
-directory full of documentation. The term `reader` comes close, but when you
-think about it, everything is a reader. For example, a compiler reads its input
-files. I thought to appeal to Latin and use `lector`, which indeed would refer
-to a person. However, the term is not intuitive, and people who cannot find this
-documentation will not be reading it so as to understand this term.
-
-In such a situation, we can move on to other property values shared by the files
-in the directory:
-
-* `purpose_is`
-* `is_a`
-* `is X`
-* `owned_by`
-
-Each file in a documentation directory shares the purpose of being
-documentation, hence such directories are called `documentation`.
-
-
-# Implicit Property Name
-
-The property used when naming a directory is implicit, so coming up with a
-directory name is essentially a mental exercise. The reader of the directory
-name is left to figure out the shared property value the person had in mind when
-naming the directory. 
-
-Adopting a convention makes the task of deriving the property name easier, but
-if this is still not sufficient, then integrate the property name into the the
-directory name along with the common value.  `is_a_red_car`, might be full of
-files that are describing read cars. This examples enters the gray area between
-file systems and databases.
-
-Sometimes a directory name will be held in a variable in a script, and we need
-to further distinguish the fact that the variable is referring to a
-directory. For example, a variable that holds the name of the directory that
-holds files to be processed by `javac` can be called `javac_input_directory`, or
-for those who want to be swank, `javac_in_dir`.
-
-# Why Directory Names Are Often Singular
-
-Each and every file in a directory has the same property value for a given
-property. Hence, this property value comes from the property of a file, 
-a single object.
-
-For example, if a directory is named `compiler`, it signifies that each file in
-the directory is `processed_by` a `compiler`.
-
-However, there can be cases where the property value, though it comes from an
-individual file, will be plural. For example, a directory could conceivably be
-named `insights`, where each file in the directory contains multiple
-insights. When we look at the property value for a single file, it is plural.
-
-# Hidden Files
-
-In my humble opinion, that git uses hidden files is unfortunate. In general, I
-find hidden files in shared projects to be a bad idea. The approach of using a
-symbolic link to give hidden files visible names creates a maintenance
-problem. The idea of setting explicit parameters for git can be used to force
-git to not create hidden files, but this approach does not expose other hidden
-files that might be placed into a project repository. There is also an issue of
-coordinating with other team members who want hidden files. Hence, a general
-solution that solves all these issues is to alias `ls` to `ls -a`, which is done
-in the environment initialization file for the project.
-
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
-
-Each project has a virtual environment.  So, for the GQL project, gradle is
-installed under .../GQL_to_Cypher/tools.  `gradle` is found under
-`..GQL_to_Cypher/tool/gradle-8.10-rc-1/bin/` and the `env_dev` script sets the
-paths to make it accessible (analogous to Python virtual environment
-`activate`).
-
-`.git` is under the `.../GQL_to_Cypher` directory, so the 'project' directory is
-`.../GQL_to_Cypher`.
-
-All development is done under `.../GQL_to_Cypher/developer` directory.  There
-are no files under that directory, instead all files go into subdirectories.
-The current (being replaced) makefile is under
-`.../GQL_to_Cypher/devloper/executor` There is a bash script that is found first
-in the path that wraps the call to `make` and provides customizing options.
-
-Where does the `settings.gradle` file go?  Where does the `build.gradle` file
-go?  Perhaps `gradle` will also need a script that provides options to wrap the
-`gradle` call?
-
--->
-
-GQL_to_Cypher/
-├── settings.gradle
-├── build.gradle
-├── developer/
-│   ├── executor/
-│   │   ├── build.gradle
-│   │   └── other-subdirectories/
-│   └── other-subdirectories/
-├── tools/
-│   └── gradle-8.10-rc-1/
-│       └── bin/
-└── other-directories/
-
-
---->
-
-gradle-wrapper.sh
-
-#!/usr/bin/env bash
-
-# Source the environment setup script
-source .../GQL_to_Cypher/tools/env_dev  # this should probably be env_build
-
-# Call gradle with any additional options
-.../GQL_to_Cypher/tools/gradle-8.10-rc-1/bin/gradle "$@"
-
-./gradle-wrapper.sh build
-
-
-
-<!--  LocalWords:  lector
- -->
diff --git a/ologist/gradle_notes.txt b/ologist/gradle_notes.txt
deleted file mode 100644 (file)
index c09e2a2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-
-gradle
-
-1. This is risky software.
-
-  It searches for its files, thus traverses the directory tree.
-
-  It access the internet for data.
-
-  The installer downloads binaries from the site. It is not distributed as a repo
-  with Fedora, Debian, or .. anything else.
-
-  It has access to everyone's projects. Big honeypot.
-
-
-2. Java
-
-  Gradle is a Java program so it needs the JVM to run.  
-
-  Gradle is being used to install most of the tools. 
-
-    It does not install  Gradle of course.  There is a bash script for that.
-
-    We assume that Gradle is using a version of Java on the system. But it will
-    still install a specific version of Java required by the project build.
-    `gradle.parameters` sets the version number for the build Java.  The build
-    Java will be installed under the 'tools' directory.
-    
-
-
diff --git a/ologist/log.md b/ologist/log.md
deleted file mode 100644 (file)
index 2dc2a77..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-This is a project management log. This is not a code development log. (Git does
-a pretty good job of that already.)
-
-2024-07-25
-
-  formal git project directory creation
-
-  Preparation, studies, and discussion occur before this time.
-  
-2024-09-05
-
-  Diligence to the project was spotty in August. 
-
-  Build environment appears to be stable. A toy grammar syntax parse, and echo,
-  and syntax 'diagramming' is working. Here 'diagramming' is a pretty print
-  annotation of the syntax parts.
-  
-  GQL turns out to have a great deal in common with Cypher. So, might start by
-  using the Cypher movie database for testing.  The ISO standard document should
-  clarify the differences.
-  
-  The AI could not deal with the GQL grammar due to its size, so would not
-  generate a print visitor. I am working on abstracting the grammar to reduce
-  the number of rules.
-
-  In said abstraction, all terminal symbols will be under single token
-  `terminal`. Currently these are then categorized, then differentiated. The
-  categories were created manually. I wonder if categories are necessary, but
-  they can't hurt, and as they are done I will keep them.
-  
-2024-09-11
-
-  I have tried, have a working example of, a synthesis approach, where one
-  program synthesizes another program that does the syntax annotation. 
-
-  Also worked on reducing the GQL grammar by abstracting it. For example
-  creating one token that stands for all terminal symbols. Though not sure what
-  the advantage is of working with the abstracted grammar instead of the
-  original, as we will have to make a distinction among the various rules that
-  collapsed together before generating the output.
-
-  Now trying to apply rewrite rules to transform tree T0 to tree T1.
-
-  Make does not chain pattern rules, which is causing problems. Everyone in
-  Javaland apparently is using Maven or Gradle, so switching over to Gradle.
-  
-
-<!--  LocalWords:  Javaland Gradle
- -->
diff --git a/readers/README.md b/readers/README.md
new file mode 100644 (file)
index 0000000..21b4176
--- /dev/null
@@ -0,0 +1,7 @@
+
+This directory contains project management documentation.  Find here information
+about the directory structure, tools used, and installation required for setting
+up the environment.
+
+The `lector` directory under `developer` has documentation for the code
+being developed.
diff --git a/readers/directory_naming.txt b/readers/directory_naming.txt
new file mode 100644 (file)
index 0000000..5a4cf3e
--- /dev/null
@@ -0,0 +1,40 @@
+Generally, project directories are named after the agent the files are for.
+
+The top level directory is reserved for the project manager. The project
+manager's directory will hold the git repo, virtual environment tool installs,
+and one or more files to be sourced for initializing the environment.  The
+environment variable $REPO_HOME points to the top level directory.
+
+The developers' directory is $REPO_HOME/developer, which is the also
+$DEVELOPER_HOME.
+
+When 'make' or 'build.gradle' is found in the top level directory,
+i.e. $REPO_HOME, it is for building tools. The developer will have a separate
+build file under $DEVELOPER_HOME.
+
+When a project has files for the C compiler, cc, are put in a directory called "cc".
+Files for the java compiler, javac, are in the directory "javac". Etc.
+
+An `executor` is a generic name for a program that runs a file. Example
+executors include the OS loader for binary files, the JVM for .jar files,
+and bash for running shell scripts.  A directory that holds a mix of such
+files is called `executor`, as the files are for the `executor`.
+
+A directory full of documents is then for 'readers'.
+
+Some directories are more difficult to name after an agent that uses the
+files in them. Like our ancestors who personified nearly everything with
+spirits, we will do the same.
+
+When programs use a directory as a scratch pad, where files will disappear
+seemingly without reason we will call the directory "tanuki". This is a Japanese
+raccoon so famous for making things disappear that it has taken on mystical
+proportions.
+
+As a developer I often have files that I set aside just in case I want to look
+at them again, or later make new versions. So I give them to the God of sleep,
+Somnus. Maybe they will be woken up, maybe they won't. Unlike tanuki files,
+they are not deleted by any of the tools.
+
+Files in tanuki and Soumnus are not placed into the repo.
+
diff --git a/readers/log.md b/readers/log.md
new file mode 100644 (file)
index 0000000..60cb41c
--- /dev/null
@@ -0,0 +1,55 @@
+This is a project management log. This is not a code development log. (Git does
+a pretty good job of that already.)
+
+2024-07-25
+
+  formal git project directory creation
+
+  Preparation, studies, and discussion occur before this time.
+  
+2024-09-05
+
+  Diligence to the project was spotty in August. 
+
+  Build environment appears to be stable. A toy grammar syntax parse, and echo,
+  and syntax 'diagramming' is working. Here 'diagramming' is a pretty print
+  annotation of the syntax parts.
+  
+  GQL turns out to have a great deal in common with Cypher. So, might start by
+  using the Cypher movie database for testing.  The ISO standard document should
+  clarify the differences.
+  
+  The AI could not deal with the GQL grammar due to its size, so would not
+  generate a print visitor. I am working on abstracting the grammar to reduce
+  the number of rules.
+
+  In said abstraction, all terminal symbols will be under single token
+  `terminal`. Currently these are then categorized, then differentiated. The
+  categories were created manually. I wonder if categories are necessary, but
+  they can't hurt, and as they are done I will keep them.
+  
+2024-09-11
+
+  I have tried, have a working example of, a synthesis approach, where one
+  program synthesizes another program that does the syntax annotation. 
+
+  Also worked on reducing the GQL grammar by abstracting it. For example
+  creating one token that stands for all terminal symbols. Though not sure what
+  the advantage is of working with the abstracted grammar instead of the
+  original, as we will have to make a distinction among the various rules that
+  collapsed together before generating the output.
+
+  Now trying to apply rewrite rules to transform tree T0 to tree T1.
+
+  Make does not chain pattern rules, which is causing problems. Everyone in
+  Javaland apparently is using Maven or Gradle, so switching over to Gradle.
+  
+2024-10-01
+
+  Hve moved to gradle and have developed a bespoke dependency graph tool.
+  Breaking out the dependency graph tool as its own project, albeit a
+  small one.
+
+
+<!--  LocalWords:  Javaland Gradle
+ -->
diff --git a/tanuki/.gitignore b/tanuki/.gitignore
new file mode 100644 (file)
index 0000000..120f485
--- /dev/null
@@ -0,0 +1,2 @@
+*
+!/.gitignore
diff --git a/tool/.gitignore b/tool/.gitignore
deleted file mode 100644 (file)
index 2db43ed..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-*
-!/.gitignore
-
diff --git a/toolsmiths/.gitignore b/toolsmiths/.gitignore
new file mode 100644 (file)
index 0000000..2db43ed
--- /dev/null
@@ -0,0 +1,4 @@
+
+*
+!/.gitignore
+