This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new cf135b4ebf Clean-up production of HTML for the SPARQL grammar
cf135b4ebf is described below

commit cf135b4ebff5fca2257ec1b7710720d5ba3bf248
Author: Andy Seaborne <[email protected]>
AuthorDate: Fri Apr 25 17:00:35 2025 +0100

    Clean-up production of HTML for the SPARQL grammar
---
 jena-arq/Grammar/.gitignore  |  6 ++---
 jena-arq/Grammar/Notes       | 49 -----------------------------------------
 jena-arq/Grammar/README      | 52 ++++++++++++++++++++++++++++++++++++++++++--
 jena-arq/Grammar/sparql2bnf  |  2 +-
 jena-arq/Grammar/sparql2html |  4 +---
 5 files changed, 54 insertions(+), 59 deletions(-)

diff --git a/jena-arq/Grammar/.gitignore b/jena-arq/Grammar/.gitignore
index a786afe999..fea721fdcf 100644
--- a/jena-arq/Grammar/.gitignore
+++ b/jena-arq/Grammar/.gitignore
@@ -8,8 +8,6 @@ Y12.html
 # Grammar in HTML 
 sparql-grammar.html
 # Grammar in BNF text
-sparql.bnf
-## BNF
-sparql.bnf
-## Grammar in HTML as a standalone web page.
+sparql-grammar.bnf
+# Grammar as a complete web page
 sparql-html.html
diff --git a/jena-arq/Grammar/Notes b/jena-arq/Grammar/Notes
deleted file mode 100644
index 77dec4455b..0000000000
--- a/jena-arq/Grammar/Notes
+++ /dev/null
@@ -1,49 +0,0 @@
-## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
-
-==== The Grammars
-See Archive for old, historical material.
-
-main.jj - Template for SPARQL and ARQ
-    cpp input to produce sparql.jj or arq.jj
-
-sparql_11.jj - The SPARQL working group syntax
-    This should be exactly the grammar in the SPARQL 1.1 rec.
-    Generates org.apache.jena.query.parser.sparql_11.SPARQLParser
-
-sparql_12.jj - The RDF Star working group syntax
-    This should be exactly the grammar in the SPARQL 1.2 rec.
-    Generates org.apache.jena.query.parser.sparql_12.SPARQLParser
-
-arq.jj - The native query language of the query engine
-    Generates org.apache.jena.query.parser.arq.ARQParser
-
-sparql_10-final.jj - SPARQL 1.0, but updated to match internal chnages in ARQ.
-    This should produce the grammar in the SPARQ 1.0/DAWG rec.
-    Generates org.apache.jena.query.parser.sparql_10.SPARQLParser
-    
-Final/sparql_10-final.jj is original for the SPARQL 1.0 specification. 
-Final/sparql_11-final.jj is original for the SPARQL 1.1 specification.
-
-This should produce the HTML grammar in the SPARQL 1.0/DAWG and SPARQL 1.1
-specifications.
-
-==== Making the parsers
-
-See "grammar"
-Note this runs cpp over main.jj to produce arq.jj or sparql.jj
-
-==== Making the HTML
-
-sparql_N.txt is produced by "grammar", and is used to make HTML.
-We don't use jjdoc to produce HTML but instead get jjdoc to produce
-its text form and process that, toegther with a hand-managed
-token.txt file.
-
-== Tokens
-
-Run "jj2tokens sparql_11.jj > tokens.txt" to get a first pass at a tokens file.
-Manually tidy, noting which to inline
-
-Produce HTML suitable for inclusion in the SPARQL recomendations.
-Includes some hand-craft tidying up. 
-  jj2html arq.txt tokens.txt 
diff --git a/jena-arq/Grammar/README b/jena-arq/Grammar/README
index 65c77d522a..9398f10db2 100644
--- a/jena-arq/Grammar/README
+++ b/jena-arq/Grammar/README
@@ -1,5 +1,8 @@
 ==== SPARQL Parser
 
+The active grammar is in main.jj.
+This covers current SPARQL and any ARQ extensions.
+
 Run
 
     grammar
@@ -7,7 +10,11 @@ Run
 This produces the code for the current version SPARQL
 and the ARQ (SPARQL with extensions) parsers.
 
-==
+Note:
+cpp (the C Preprocessor) must be installed.
+The grammar script runs cpp over main.jj to produce arq.jj and sparql.jj.
+
+==== HTML
 
 To produce the HTML for the SPARQL Grammar for the W3C spec:
 produce the SPARQL 1.2 specific file
@@ -28,4 +35,45 @@ Running
 
     sparql2bnf
 
-produces a text BNF form.
+produces a text BNF form in sparql-grammar.bnf
+
+Run
+
+   grammarExtracts < sparql-grammar.html > sparql-html.html
+
+to get a webpage for the grammar.
+
+====
+
+To generate the "tokens.txt" file, use
+
+    jj2tokens sparql_12.jj > tokens.txt
+
+to get a basic starting point. It will need manual editing, noting which token 
to inline
+and not to go in the terminal section.
+==== The Grammars
+See Archive for old, historical material.
+
+main.jj - Template for SPARQL and ARQ
+    cpp input to produce sparql.jj or arq.jj
+
+sparql_11.jj - The SPARQL working group syntax
+    This should be exactly the grammar in the SPARQL 1.1 rec.
+    Generates org.apache.jena.query.parser.sparql_11.SPARQLParser
+
+sparql_12.jj - The RDF Star working group syntax
+    This should be exactly the grammar in the SPARQL 1.2 rec.
+    Generates org.apache.jena.query.parser.sparql_12.SPARQLParser
+
+arq.jj - The native query language of the query engine
+    Generates org.apache.jena.query.parser.arq.ARQParser
+
+sparql_10-final.jj - SPARQL 1.0, but updated to match internal chnages in ARQ.
+    This should produce the grammar in the SPARQ 1.0/DAWG rec.
+    Generates org.apache.jena.query.parser.sparql_10.SPARQLParser
+    
+Final/sparql_10-final.jj is original for the SPARQL 1.0 specification. 
+Final/sparql_11-final.jj is original for the SPARQL 1.1 specification.
+
+This should produce the HTML grammar in the SPARQL 1.0/DAWG and SPARQL 1.1
+specifications.
diff --git a/jena-arq/Grammar/sparql2bnf b/jena-arq/Grammar/sparql2bnf
index 74b1b9034d..7271582844 100755
--- a/jena-arq/Grammar/sparql2bnf
+++ b/jena-arq/Grammar/sparql2bnf
@@ -4,4 +4,4 @@ echo "Grammar to sparql.bnf (text)"
 
 (
     jj2bnf 'sparql_12.txt' 'tokens.txt'
-) > sparql.bnf
+) > sparql-grammar.bnf
diff --git a/jena-arq/Grammar/sparql2html b/jena-arq/Grammar/sparql2html
index e2d449bf97..fadfe1c2f9 100755
--- a/jena-arq/Grammar/sparql2html
+++ b/jena-arq/Grammar/sparql2html
@@ -13,9 +13,7 @@ echo "Grammar output in sparql-grammar.html"
 
 ## Produce a standlone web page
 ## mv sparql-grammar.html X12.hmtl
-## grammarExtracts < sparql-grammar.html > sparql-html.thml
+## grammarExtracts < sparql-grammar.html > sparql-html.html
 
 ## jj2html 'arq_12.txt' 'tokens.txt' > X.html
 ## grammarExtracts < X.html > Y.html
-
-##?? echo "Check X and Y for IRI_REF because \" became '"

Reply via email to