wcandillon / xqlint

JSONiq & XQuery Quality Checker
Apache License 2.0
52 stars 22 forks source link

Can not generate parsers #108

Closed ccheraa closed 2 years ago

ccheraa commented 2 years ago

Problem:

The command grunt parsers is not working as expected

Expected behavior:

Generates JSONiqParser.js and XQueryParser.js

Actual behavior:

Both JSONiqParser.js and XQueryParser.js have the same content:

Usage: REx [OPTION]... [input-file]

  -ll NUM        use strong-LL(K) algorithm up to K=NUM (default 3)
  -backtrack     allow PEG-style backtracking for LL-conflicts

  -cpp           generate parser in C++
  -csharp        generate parser in C#
  -haxe          generate parser in Haxe
  -java          generate parser in Java
  -javascript    generate parser in JavaScript
  -scala         generate parser in Scala
  -typescript    generate parser in TypeScript
  -xquery        generate parser in XQuery
  -xslt          generate parser in XSLT

  -saxon         generate Saxon 10 extension function (requires -java, too)
  -basex         generate BaseX extension function (requires -java, too)

  -xml           create XML representation of grammar
  -asi           handle EcmaScript automatic semicolon insertion (LL(1) only)
  -name NAME     use non-default class name, or XQuery/XSLT module namespace

  -tree          generate code for parse tree or parsing event handler
  -trace         generate code for tokenizer trace
  -main          generate simple main program
  -performance   generate performance test program
  -faster        optimize speed
  -smaller       optimize memory consumption

  -version       show REx version

At first, I was getting a different content, but then I changed: https://github.com/wcandillon/xqlint/blob/10e3885793fe1cd0c8db1c971777549261732184/Gruntfile.js#L23 to

var r = request.post('https://www.bottlecaps.de/rex/', function(err, res, body) {

Also, I set NODE_TLS_REJECT_UNAUTHORIZED=0 because the certificate is apparently expired

wcandillon commented 2 years ago

The API still seems to be available, do you think it has no a breaking change? Incredible from @GuntherRademacher that this tool is still online after all these year :) This was truly an incredible parser generator, I still think it is :)

GuntherRademacher commented 2 years ago

Indeed the REx server changed from HTTP to HTTPS some years ago, so the URL change is necessary, Can't see though, why you think the certificate is expired. It's a certificate from Let's Encrypt, the current version was issued July 23rd and is valid through October 21st. The content of the parser files shows a REx usage info. This indicates that the server has received an empty command line, which I think is caused by the request from Gruntfile.js being submitted before it has been equipped with the form data. I have made a change that passes the form data when invoking the request, and sent a pull request: https://github.com/wcandillon/xqlint/pull/109