From loren.cahlander at gmail.com Thu Nov 29 13:01:59 2018 From: loren.cahlander at gmail.com (Loren Cahlander) Date: Thu, 29 Nov 2018 16:01:59 -0500 Subject: [xquery-talk] [ANN] xqDoc XQuery code documentation generator version 1.9.3 is released References: Message-ID: Announcing an updated xqDoc (http://xqdoc.org ) XQuery code documentation generator! Thank you to Darin McBeath and Curt Kohler from Elsevier that originally developed xqDoc. The previous version had not been updated to deal with the recent additions to the XQuery grammar. It was also developed using Antlr 2 and Antlr 4 is the current release. Antlr 4 allows for the separation of the parsing of the grammar and the visiting of the parsed grammar. This allows for the grammar file to be utilized for other parsing reasons by writing a new visitor class. The source is available at: https://github.com/lcahlander/xqdoc and the jar file is available through the maven repository https://mvnrepository.com/artifact/org.xqdoc/xqdoc 1.0 Additions The parsing of the content of a function signature was in the specification, but not in the available codebase. The following XQuery function now generates parameter, return type and annotation tags within the function xqDoc tag. 1.1 Function Signature declare %rest:GET %rest:path("/test2") %rest:query-param("hello", "{$hello}", "") function test:hello2($hello as xs:string*) as node() { {$hello} }; 1.1.1 Parameters hello xs:string 1.1.2 Return Types node() 1.1.3 Annotations "/test2" "hello" "{$hello}" "" 1.2 Custom Comment Tag The @custom tag identifies a tag for any other purpose. If the @custom is followed immediately by a colon, then that value is in the tag attribute of the custom tag. e.g. @custom:openapi creates the tag " } maven { url "http://repository.cloudera.com/artifactory/cloudera-repos/ " } } configurations { mlcp { resolutionStrategy { force "xml-apis:xml-apis:1.4.01" } } } dependencies { mlcp "com.marklogic:mlcp:9.0.6" mlcp files("marklogic/lib") } class XQDocFilter extends BaseFilterReader { XQDocFilter(Reader input) { super(new StringReader(new org.xqdoc.MarkLogicProcessor().process(input.text))) } } task generateXQDocs(type: Copy) { into 'xqDoc' from 'src/main/ml-modules' include '**/*.xqy' rename { it - '.xqy' + '.xml' } includeEmptyDirs = false filter XQDocFilter } task importXQDoc(type: com.marklogic.gradle.task.MlcpTask) { classpath = configurations.mlcp command = "IMPORT" database = "emh-accelerator-content" input_file_path = "xqDoc" output_collections = "xqdoc" output_uri_replace = ".*xqDoc,'/xqDoc'" document_type = "mixed" } 2.1 eXist-db equivalent The equivalent call would be new org.xqdoc.ExistDBProcessor().process(input.text) 3.0 Issues 3.1 XQuery 3.1 extensions The current grammar file is not properly parsing the following two items: String Constructors https://www.w3.org/TR/xquery-31/#id-string-constructors URI Qualified Name https://www.w3.org/TR/xquery-31/#doc-xquery31-URIQualifiedName I need some help with the XQueryParser.g4 and XQueryLexer.g4 files to properly include those. I have a question posted to StackOverflow on the String Constructors https://stackoverflow.com/questions/53462040/i-am-having-trouble-translating-an-ebnf-grammar-to-an-antlr4-grammar 3.2 Implementation specific extensions I believe that I have al of the eXist-db and MarkLogic language extensions implemented, but I need help testing the parser. I still need to add the BaseX and Saxon extensions. 4.0 Future I would appreciate the help from any that would like to contribute to the development Once the following issues are resolved, then I am planning on coming out with a 2.0 release. Add the display of the comments in markdown in the xqDoc display code I am also interested in if anyone would be interested in helping me with MarkLogic XQuery Code Scan using SonarQube utilizing the XQuery grammar and possibly the xqDoc files. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: