Module Name: othersrc
Committed By: agc
Date: Tue Apr 25 20:03:40 UTC 2023
Modified Files:
othersrc/external/bsd/elex/bin: Makefile
othersrc/external/bsd/elex/dist: Makefile
Added Files:
othersrc/external/bsd/elex/dist/tests: 31.expected 31.in 32.expected
32.in json.lex
Log Message:
Add an example json lexer, and some tests for it.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/elex/bin/Makefile
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/Makefile
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/elex/dist/tests/31.expected \
othersrc/external/bsd/elex/dist/tests/31.in \
othersrc/external/bsd/elex/dist/tests/32.expected \
othersrc/external/bsd/elex/dist/tests/32.in \
othersrc/external/bsd/elex/dist/tests/json.lex
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: othersrc/external/bsd/elex/bin/Makefile
diff -u othersrc/external/bsd/elex/bin/Makefile:1.2 othersrc/external/bsd/elex/bin/Makefile:1.3
--- othersrc/external/bsd/elex/bin/Makefile:1.2 Fri Feb 24 23:07:54 2023
+++ othersrc/external/bsd/elex/bin/Makefile Tue Apr 25 20:03:39 2023
@@ -143,3 +143,11 @@ t: ${PROG}
env LD_LIBRARY_PATH=${LIB_ELEX_DIR} ./${PROG} -g -f ${DIST}/tests/30.lex ${DIST}/tests/21.in > 30.out
diff ${DIST}/tests/30.expected 30.out
rm -f 30.out
+ @echo "31. json"
+ env LD_LIBRARY_PATH=${LIB_ELEX_DIR} ./${PROG} -f ${DIST}/tests/json.lex ${DIST}/tests/31.in > 31.out
+ diff ${DIST}/tests/31.expected 31.out
+ rm -f 31.out
+ @echo "32. more json"
+ env LD_LIBRARY_PATH=${LIB_ELEX_DIR} ./${PROG} -f ${DIST}/tests/json.lex ${DIST}/tests/32.in > 32.out
+ diff ${DIST}/tests/32.expected 32.out
+ rm -f 32.out
Index: othersrc/external/bsd/elex/dist/Makefile
diff -u othersrc/external/bsd/elex/dist/Makefile:1.1 othersrc/external/bsd/elex/dist/Makefile:1.2
--- othersrc/external/bsd/elex/dist/Makefile:1.1 Thu Dec 9 04:15:26 2021
+++ othersrc/external/bsd/elex/dist/Makefile Tue Apr 25 20:03:39 2023
@@ -1,6 +1,7 @@
PROG= elex
SRCS+= agcre.c
SRCS+= elex.c
+SRCS+= striter.c
SRCS+= main.c
MKMAN= no
WARNS= 5
Added files:
Index: othersrc/external/bsd/elex/dist/tests/31.expected
diff -u /dev/null othersrc/external/bsd/elex/dist/tests/31.expected:1.1
--- /dev/null Tue Apr 25 20:03:40 2023
+++ othersrc/external/bsd/elex/dist/tests/31.expected Tue Apr 25 20:03:40 2023
@@ -0,0 +1,65 @@
+[6] 1 '{'
+[1] 10 '"glossary"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 7 '"title"'
+[9] 1 ':'
+[1] 18 '"example glossary"'
+[8] 1 ','
+[1] 10 '"GlossDiv"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 7 '"title"'
+[9] 1 ':'
+[1] 3 '"S"'
+[8] 1 ','
+[1] 11 '"GlossList"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 12 '"GlossEntry"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 4 '"ID"'
+[9] 1 ':'
+[1] 6 '"SGML"'
+[8] 1 ','
+[1] 8 '"SortAs"'
+[9] 1 ':'
+[1] 6 '"SGML"'
+[8] 1 ','
+[1] 11 '"GlossTerm"'
+[9] 1 ':'
+[1] 38 '"Standard Generalized Markup Language"'
+[8] 1 ','
+[1] 9 '"Acronym"'
+[9] 1 ':'
+[1] 6 '"SGML"'
+[8] 1 ','
+[1] 8 '"Abbrev"'
+[9] 1 ':'
+[1] 15 '"ISO 8879:1986"'
+[8] 1 ','
+[1] 10 '"GlossDef"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 6 '"para"'
+[9] 1 ':'
+[1] 74 '"A meta-markup language, used to create markup languages such as DocBook."'
+[8] 1 ','
+[1] 14 '"GlossSeeAlso"'
+[9] 1 ':'
+[4] 1 '['
+[1] 5 '"GML"'
+[8] 1 ','
+[1] 5 '"XML"'
+[5] 1 ']'
+[7] 1 '}'
+[8] 1 ','
+[1] 10 '"GlossSee"'
+[9] 1 ':'
+[1] 8 '"markup"'
+[7] 1 '}'
+[7] 1 '}'
+[7] 1 '}'
+[7] 1 '}'
+[7] 1 '}'
Index: othersrc/external/bsd/elex/dist/tests/31.in
diff -u /dev/null othersrc/external/bsd/elex/dist/tests/31.in:1.1
--- /dev/null Tue Apr 25 20:03:40 2023
+++ othersrc/external/bsd/elex/dist/tests/31.in Tue Apr 25 20:03:40 2023
@@ -0,0 +1,22 @@
+{
+ "glossary": {
+ "title": "example glossary",
+ "GlossDiv": {
+ "title": "S",
+ "GlossList": {
+ "GlossEntry": {
+ "ID": "SGML",
+ "SortAs": "SGML",
+ "GlossTerm": "Standard Generalized Markup Language",
+ "Acronym": "SGML",
+ "Abbrev": "ISO 8879:1986",
+ "GlossDef": {
+ "para": "A meta-markup language, used to create markup languages such as DocBook.",
+ "GlossSeeAlso": ["GML", "XML"]
+ },
+ "GlossSee": "markup"
+ }
+ }
+ }
+ }
+}
Index: othersrc/external/bsd/elex/dist/tests/32.expected
diff -u /dev/null othersrc/external/bsd/elex/dist/tests/32.expected:1.1
--- /dev/null Tue Apr 25 20:03:40 2023
+++ othersrc/external/bsd/elex/dist/tests/32.expected Tue Apr 25 20:03:40 2023
@@ -0,0 +1,335 @@
+[6] 1 '{'
+[1] 9 '"web-app"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 9 '"servlet"'
+[9] 1 ':'
+[4] 1 '['
+[6] 1 '{'
+[1] 14 '"servlet-name"'
+[9] 1 ':'
+[1] 10 '"cofaxCDS"'
+[8] 1 ','
+[1] 15 '"servlet-class"'
+[9] 1 ':'
+[1] 26 '"org.cofax.cds.CDSServlet"'
+[8] 1 ','
+[1] 12 '"init-param"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 31 '"configGlossary:installationAt"'
+[9] 1 ':'
+[1] 18 '"Philadelphia, PA"'
+[8] 1 ','
+[1] 27 '"configGlossary:adminEmail"'
+[9] 1 ':'
+[1] 15 '"[email protected]"'
+[8] 1 ','
+[1] 26 '"configGlossary:poweredBy"'
+[9] 1 ':'
+[1] 7 '"Cofax"'
+[8] 1 ','
+[1] 30 '"configGlossary:poweredByIcon"'
+[9] 1 ':'
+[1] 19 '"/images/cofax.gif"'
+[8] 1 ','
+[1] 27 '"configGlossary:staticPath"'
+[9] 1 ':'
+[1] 17 '"/content/static"'
+[8] 1 ','
+[1] 24 '"templateProcessorClass"'
+[9] 1 ':'
+[1] 27 '"org.cofax.WysiwygTemplate"'
+[8] 1 ','
+[1] 21 '"templateLoaderClass"'
+[9] 1 ':'
+[1] 31 '"org.cofax.FilesTemplateLoader"'
+[8] 1 ','
+[1] 14 '"templatePath"'
+[9] 1 ':'
+[1] 11 '"templates"'
+[8] 1 ','
+[1] 22 '"templateOverridePath"'
+[9] 1 ':'
+[1] 2 '""'
+[8] 1 ','
+[1] 21 '"defaultListTemplate"'
+[9] 1 ':'
+[1] 18 '"listTemplate.htm"'
+[8] 1 ','
+[1] 21 '"defaultFileTemplate"'
+[9] 1 ':'
+[1] 21 '"articleTemplate.htm"'
+[8] 1 ','
+[1] 8 '"useJSP"'
+[9] 1 ':'
+[3] 5 'false'
+[8] 1 ','
+[1] 17 '"jspListTemplate"'
+[9] 1 ':'
+[1] 18 '"listTemplate.jsp"'
+[8] 1 ','
+[1] 17 '"jspFileTemplate"'
+[9] 1 ':'
+[1] 21 '"articleTemplate.jsp"'
+[8] 1 ','
+[1] 23 '"cachePackageTagsTrack"'
+[9] 1 ':'
+[2] 3 '200'
+[8] 1 ','
+[1] 23 '"cachePackageTagsStore"'
+[9] 1 ':'
+[2] 3 '200'
+[8] 1 ','
+[1] 25 '"cachePackageTagsRefresh"'
+[9] 1 ':'
+[2] 2 '60'
+[8] 1 ','
+[1] 21 '"cacheTemplatesTrack"'
+[9] 1 ':'
+[2] 3 '100'
+[8] 1 ','
+[1] 21 '"cacheTemplatesStore"'
+[9] 1 ':'
+[2] 2 '50'
+[8] 1 ','
+[1] 23 '"cacheTemplatesRefresh"'
+[9] 1 ':'
+[2] 2 '15'
+[8] 1 ','
+[1] 17 '"cachePagesTrack"'
+[9] 1 ':'
+[2] 3 '200'
+[8] 1 ','
+[1] 17 '"cachePagesStore"'
+[9] 1 ':'
+[2] 3 '100'
+[8] 1 ','
+[1] 19 '"cachePagesRefresh"'
+[9] 1 ':'
+[2] 2 '10'
+[8] 1 ','
+[1] 21 '"cachePagesDirtyRead"'
+[9] 1 ':'
+[2] 2 '10'
+[8] 1 ','
+[1] 26 '"searchEngineListTemplate"'
+[9] 1 ':'
+[1] 26 '"forSearchEnginesList.htm"'
+[8] 1 ','
+[1] 26 '"searchEngineFileTemplate"'
+[9] 1 ':'
+[1] 22 '"forSearchEngines.htm"'
+[8] 1 ','
+[1] 22 '"searchEngineRobotsDb"'
+[9] 1 ':'
+[1] 19 '"WEB-INF/robots.db"'
+[8] 1 ','
+[1] 14 '"useDataStore"'
+[9] 1 ':'
+[3] 4 'true'
+[8] 1 ','
+[1] 16 '"dataStoreClass"'
+[9] 1 ':'
+[1] 24 '"org.cofax.SqlDataStore"'
+[8] 1 ','
+[1] 18 '"redirectionClass"'
+[9] 1 ':'
+[1] 26 '"org.cofax.SqlRedirection"'
+[8] 1 ','
+[1] 15 '"dataStoreName"'
+[9] 1 ':'
+[1] 7 '"cofax"'
+[8] 1 ','
+[1] 17 '"dataStoreDriver"'
+[9] 1 ':'
+[1] 46 '"com.microsoft.jdbc.sqlserver.SQLServerDriver"'
+[8] 1 ','
+[1] 14 '"dataStoreUrl"'
+[9] 1 ':'
+[1] 61 '"jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon"'
+[8] 1 ','
+[1] 15 '"dataStoreUser"'
+[9] 1 ':'
+[1] 4 '"sa"'
+[8] 1 ','
+[1] 19 '"dataStorePassword"'
+[9] 1 ':'
+[1] 20 '"dataStoreTestQuery"'
+[8] 1 ','
+[1] 20 '"dataStoreTestQuery"'
+[9] 1 ':'
+[1] 36 '"SET NOCOUNT ON;select test='test';"'
+[8] 1 ','
+[1] 18 '"dataStoreLogFile"'
+[9] 1 ':'
+[1] 38 '"/usr/local/tomcat/logs/datastore.log"'
+[8] 1 ','
+[1] 20 '"dataStoreInitConns"'
+[9] 1 ':'
+[2] 2 '10'
+[8] 1 ','
+[1] 19 '"dataStoreMaxConns"'
+[9] 1 ':'
+[2] 3 '100'
+[8] 1 ','
+[1] 25 '"dataStoreConnUsageLimit"'
+[9] 1 ':'
+[2] 3 '100'
+[8] 1 ','
+[1] 19 '"dataStoreLogLevel"'
+[9] 1 ':'
+[1] 7 '"debug"'
+[8] 1 ','
+[1] 14 '"maxUrlLength"'
+[9] 1 ':'
+[2] 3 '500'
+[7] 1 '}'
+[7] 1 '}'
+[8] 1 ','
+[6] 1 '{'
+[1] 14 '"servlet-name"'
+[9] 1 ':'
+[1] 12 '"cofaxEmail"'
+[8] 1 ','
+[1] 15 '"servlet-class"'
+[9] 1 ':'
+[1] 28 '"org.cofax.cds.EmailServlet"'
+[8] 1 ','
+[1] 12 '"init-param"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 10 '"mailHost"'
+[9] 1 ':'
+[1] 7 '"mail1"'
+[8] 1 ','
+[1] 18 '"mailHostOverride"'
+[9] 1 ':'
+[1] 7 '"mail2"'
+[7] 1 '}'
+[7] 1 '}'
+[8] 1 ','
+[6] 1 '{'
+[1] 14 '"servlet-name"'
+[9] 1 ':'
+[1] 12 '"cofaxAdmin"'
+[8] 1 ','
+[1] 15 '"servlet-class"'
+[9] 1 ':'
+[1] 28 '"org.cofax.cds.AdminServlet"'
+[7] 1 '}'
+[8] 1 ','
+[6] 1 '{'
+[1] 14 '"servlet-name"'
+[9] 1 ':'
+[1] 13 '"fileServlet"'
+[8] 1 ','
+[1] 15 '"servlet-class"'
+[9] 1 ':'
+[1] 27 '"org.cofax.cds.FileServlet"'
+[7] 1 '}'
+[8] 1 ','
+[6] 1 '{'
+[1] 14 '"servlet-name"'
+[9] 1 ':'
+[1] 12 '"cofaxTools"'
+[8] 1 ','
+[1] 15 '"servlet-class"'
+[9] 1 ':'
+[1] 33 '"org.cofax.cms.CofaxToolsServlet"'
+[8] 1 ','
+[1] 12 '"init-param"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 14 '"templatePath"'
+[9] 1 ':'
+[1] 17 '"toolstemplates/"'
+[8] 1 ','
+[1] 5 '"log"'
+[9] 1 ':'
+[2] 1 '1'
+[8] 1 ','
+[1] 13 '"logLocation"'
+[9] 1 ':'
+[1] 39 '"/usr/local/tomcat/logs/CofaxTools.log"'
+[8] 1 ','
+[1] 12 '"logMaxSize"'
+[9] 1 ':'
+[1] 2 '""'
+[8] 1 ','
+[1] 9 '"dataLog"'
+[9] 1 ':'
+[2] 1 '1'
+[8] 1 ','
+[1] 17 '"dataLogLocation"'
+[9] 1 ':'
+[1] 36 '"/usr/local/tomcat/logs/dataLog.log"'
+[8] 1 ','
+[1] 16 '"dataLogMaxSize"'
+[9] 1 ':'
+[1] 2 '""'
+[8] 1 ','
+[1] 17 '"removePageCache"'
+[9] 1 ':'
+[1] 39 '"/content/admin/remove?cache=pages&id="'
+[8] 1 ','
+[1] 21 '"removeTemplateCache"'
+[9] 1 ':'
+[1] 43 '"/content/admin/remove?cache=templates&id="'
+[8] 1 ','
+[1] 20 '"fileTransferFolder"'
+[9] 1 ':'
+[1] 54 '"/usr/local/tomcat/webapps/content/fileTransferFolder"'
+[8] 1 ','
+[1] 15 '"lookInContext"'
+[9] 1 ':'
+[2] 1 '1'
+[8] 1 ','
+[1] 14 '"adminGroupID"'
+[9] 1 ':'
+[2] 1 '4'
+[8] 1 ','
+[1] 12 '"betaServer"'
+[9] 1 ':'
+[3] 4 'true'
+[7] 1 '}'
+[7] 1 '}'
+[5] 1 ']'
+[8] 1 ','
+[1] 17 '"servlet-mapping"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 10 '"cofaxCDS"'
+[9] 1 ':'
+[1] 3 '"/"'
+[8] 1 ','
+[1] 12 '"cofaxEmail"'
+[9] 1 ':'
+[1] 21 '"/cofaxutil/aemail/*"'
+[8] 1 ','
+[1] 12 '"cofaxAdmin"'
+[9] 1 ':'
+[1] 10 '"/admin/*"'
+[8] 1 ','
+[1] 13 '"fileServlet"'
+[9] 1 ':'
+[1] 11 '"/static/*"'
+[8] 1 ','
+[1] 12 '"cofaxTools"'
+[9] 1 ':'
+[1] 10 '"/tools/*"'
+[7] 1 '}'
+[8] 1 ','
+[1] 8 '"taglib"'
+[9] 1 ':'
+[6] 1 '{'
+[1] 12 '"taglib-uri"'
+[9] 1 ':'
+[1] 11 '"cofax.tld"'
+[8] 1 ','
+[1] 17 '"taglib-location"'
+[9] 1 ':'
+[1] 25 '"/WEB-INF/tlds/cofax.tld"'
+[7] 1 '}'
+[7] 1 '}'
+[7] 1 '}'
Index: othersrc/external/bsd/elex/dist/tests/32.in
diff -u /dev/null othersrc/external/bsd/elex/dist/tests/32.in:1.1
--- /dev/null Tue Apr 25 20:03:40 2023
+++ othersrc/external/bsd/elex/dist/tests/32.in Tue Apr 25 20:03:40 2023
@@ -0,0 +1,88 @@
+{"web-app": {
+ "servlet": [
+ {
+ "servlet-name": "cofaxCDS",
+ "servlet-class": "org.cofax.cds.CDSServlet",
+ "init-param": {
+ "configGlossary:installationAt": "Philadelphia, PA",
+ "configGlossary:adminEmail": "[email protected]",
+ "configGlossary:poweredBy": "Cofax",
+ "configGlossary:poweredByIcon": "/images/cofax.gif",
+ "configGlossary:staticPath": "/content/static",
+ "templateProcessorClass": "org.cofax.WysiwygTemplate",
+ "templateLoaderClass": "org.cofax.FilesTemplateLoader",
+ "templatePath": "templates",
+ "templateOverridePath": "",
+ "defaultListTemplate": "listTemplate.htm",
+ "defaultFileTemplate": "articleTemplate.htm",
+ "useJSP": false,
+ "jspListTemplate": "listTemplate.jsp",
+ "jspFileTemplate": "articleTemplate.jsp",
+ "cachePackageTagsTrack": 200,
+ "cachePackageTagsStore": 200,
+ "cachePackageTagsRefresh": 60,
+ "cacheTemplatesTrack": 100,
+ "cacheTemplatesStore": 50,
+ "cacheTemplatesRefresh": 15,
+ "cachePagesTrack": 200,
+ "cachePagesStore": 100,
+ "cachePagesRefresh": 10,
+ "cachePagesDirtyRead": 10,
+ "searchEngineListTemplate": "forSearchEnginesList.htm",
+ "searchEngineFileTemplate": "forSearchEngines.htm",
+ "searchEngineRobotsDb": "WEB-INF/robots.db",
+ "useDataStore": true,
+ "dataStoreClass": "org.cofax.SqlDataStore",
+ "redirectionClass": "org.cofax.SqlRedirection",
+ "dataStoreName": "cofax",
+ "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
+ "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",
+ "dataStoreUser": "sa",
+ "dataStorePassword": "dataStoreTestQuery",
+ "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
+ "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
+ "dataStoreInitConns": 10,
+ "dataStoreMaxConns": 100,
+ "dataStoreConnUsageLimit": 100,
+ "dataStoreLogLevel": "debug",
+ "maxUrlLength": 500}},
+ {
+ "servlet-name": "cofaxEmail",
+ "servlet-class": "org.cofax.cds.EmailServlet",
+ "init-param": {
+ "mailHost": "mail1",
+ "mailHostOverride": "mail2"}},
+ {
+ "servlet-name": "cofaxAdmin",
+ "servlet-class": "org.cofax.cds.AdminServlet"},
+
+ {
+ "servlet-name": "fileServlet",
+ "servlet-class": "org.cofax.cds.FileServlet"},
+ {
+ "servlet-name": "cofaxTools",
+ "servlet-class": "org.cofax.cms.CofaxToolsServlet",
+ "init-param": {
+ "templatePath": "toolstemplates/",
+ "log": 1,
+ "logLocation": "/usr/local/tomcat/logs/CofaxTools.log",
+ "logMaxSize": "",
+ "dataLog": 1,
+ "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",
+ "dataLogMaxSize": "",
+ "removePageCache": "/content/admin/remove?cache=pages&id=",
+ "removeTemplateCache": "/content/admin/remove?cache=templates&id=",
+ "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",
+ "lookInContext": 1,
+ "adminGroupID": 4,
+ "betaServer": true}}],
+ "servlet-mapping": {
+ "cofaxCDS": "/",
+ "cofaxEmail": "/cofaxutil/aemail/*",
+ "cofaxAdmin": "/admin/*",
+ "fileServlet": "/static/*",
+ "cofaxTools": "/tools/*"},
+
+ "taglib": {
+ "taglib-uri": "cofax.tld",
+ "taglib-location": "/WEB-INF/tlds/cofax.tld"}}}
Index: othersrc/external/bsd/elex/dist/tests/json.lex
diff -u /dev/null othersrc/external/bsd/elex/dist/tests/json.lex:1.1
--- /dev/null Tue Apr 25 20:03:40 2023
+++ othersrc/external/bsd/elex/dist/tests/json.lex Tue Apr 25 20:03:40 2023
@@ -0,0 +1,22 @@
+%type STRING 1
+%type NUMBER 2
+%type BOOLEAN 3
+%type NULLTYPE 3
+%type LBRACKET 4
+%type RBRACKET 5
+%type LBRACE 6
+%type RBRACE 7
+%type COMMA 8
+%type COLON 9
+
+<INITIAL>"(\\.|\\u[0-9a-fA-F]{1,4}|[^"])*"</> { return STRING; }
+<INITIAL>[0-9]+(\\.[0-9])?([eE][\u002b|\u002d][0-9]+)?</> { return NUMBER; }
+<INITIAL>(true|false)\></> { return BOOLEAN; }
+<INITIAL>null\></> { return NULLTYPE; }
+<INITIAL>\u005b</> { return LBRACKET; }
+<INITIAL>\u005d</> { return RBRACKET; }
+<INITIAL>\u007b</> { return LBRACE; }
+<INITIAL>\u007d</> { return RBRACE; }
+<INITIAL>\u002c</> { return COMMA; }
+<INITIAL>\u003a</> { return COLON; }
+<INITIAL>([ \t\n]+)</> { }