jplevyak / dparser

A Scannerless GLR parser/parser generater.
https://github.com/jplevyak/dparser
BSD 3-Clause "New" or "Revised" License
105 stars 14 forks source link

Version for CRAN? #10

Closed mattfidler closed 7 years ago

mattfidler commented 7 years ago

Thank you John for all of the efforts.

I have used dparser with Wenping for RxODE, and I'm happy with how efficient it is and how well it works.

I have also ported dparser in general to R:

https://github.com/nlmixrdevelopment/dparser-R

I would like to publish it to CRAN and add you as an author.

I was wondering what version of the tree you would consider the most stable. (I currently use the master branch). I also wanted to match the version of dparser available elsewhere. Is that a "released" version?

Just wondering,

Best Regards,

Matt

jplevyak commented 7 years ago

The current master is the most stable. In the last 5 years the only changes have been bug fixes and minor features.

I am glad it has worked for you.

On Tue, Apr 18, 2017 at 8:14 AM, Matthew Fidler notifications@github.com wrote:

Thank you John for all of the efforts.

I have used dparser with Wenping for RxODE, and I'm happy with how efficient it is and how well it works.

I have also ported dparser in general to R:

https://github.com/nlmixrdevelopment/dparser-R

I would like to publish it to CRAN and add you as an author.

I was wondering what version of the tree you would consider the most stable. (I currently use the master branch). I also wanted to match the version of dparser available elsewhere. Is that a "released" version?

Just wondering,

Best Regards,

Matt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jplevyak/dparser/issues/10, or mute the thread https://github.com/notifications/unsubscribe-auth/AARLoOz_HiucsYOqHi8fzNCjuJ_pA0Dfks5rxNM-gaJpZM4NAfPa .

mattfidler commented 7 years ago

Hi John,

According to CRAN, I need to fix the following

Found the following significant warnings:
  read_binary.c:40:14: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
  read_binary.c:42:14: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
  read_binary.c:44:12: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
  read_binary.c:50:34: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
mattfidler commented 7 years ago

They also are having the following failure in the testsuite, using gcc 6

Last 13 lines of output:
  x[1]: "g10.test.g.1:1: syntax error after 'c'"
  y[1]: "5 states 3 scans 3 shifts 1 reductions 0 compares 0 ambiguities"

  x[2]: "fatal error, 'g10.test.g.1' line 1"
  y[2]: "( a  b  c )"
mattfidler commented 7 years ago

One last thing, they have a standard template for the BSD 3 license. I changed your licence to match it, if that's OK:

https://github.com/nlmixrdevelopment/dparser-R/blob/master/LICENSE

Before I separated out my name for the R porting and your name for the awesome dparser.

jplevyak commented 7 years ago

Looks good to me.

On Wed, Apr 19, 2017 at 6:52 AM, Matthew Fidler notifications@github.com wrote:

One last thing, they have a standard template for the BSD 3 license. I changed your licence to match it, if that's OK:

https://github.com/nlmixrdevelopment/dparser-R/blob/master/LICENSE

Before I separated out my name for the R porting and your name for the awesome dparser.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jplevyak/dparser/issues/10#issuecomment-295277911, or mute the thread https://github.com/notifications/unsubscribe-auth/AARLoLkDb55Ega027B7XIfmI3HR0Cd7tks5rxhG4gaJpZM4NAfPa .

jplevyak commented 7 years ago

I just pushed a patch. PTAL. Because this is patching a binary dump of the tables which is expected to be used on the same machine that generated it, the "fix" for interconverting the data and function pointer is really just a hack to get the compiler to shut up.

On Wed, Apr 19, 2017 at 6:27 AM, Matthew Fidler notifications@github.com wrote:

Hi John,

According to CRAN, I need to fix the following

Found the following significant warnings: read_binary.c:40:14: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic] read_binary.c:42:14: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic] read_binary.c:44:12: warning: pointer of type 'void ' used in arithmetic [-Wpointer-arith] read_binary.c:50:34: warning: pointer of type 'void ' used in arithmetic [-Wpointer-arith]

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jplevyak/dparser/issues/10#issuecomment-295269805, or mute the thread https://github.com/notifications/unsubscribe-auth/AARLoMXKfD7_hkCPCBjfQ4okcpMHlR6Oks5rxgu6gaJpZM4NAfPa .

jplevyak commented 7 years ago

Oddly this doesn't repro on gcc6.1 for me. Is that the version you are using? Could you try it?

On Wed, Apr 19, 2017 at 6:41 AM, Matthew Fidler notifications@github.com wrote:

They also are having the following failure in the testsuite, using gcc 6

Last 13 lines of output: x[1]: "g10.test.g.1:1: syntax error after 'c'" y[1]: "5 states 3 scans 3 shifts 1 reductions 0 compares 0 ambiguities"

x[2]: "fatal error, 'g10.test.g.1' line 1" y[2]: "( a b c )"

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jplevyak/dparser/issues/10#issuecomment-295274299, or mute the thread https://github.com/notifications/unsubscribe-auth/AARLoMDCjTONtTPLvrFVtGZfGso6PWjuks5rxg8GgaJpZM4NAfPa .

mattfidler commented 7 years ago

It could be an interaction between R and dparser. I don't actually have gcc6.1, it was a comment from the CRAN developer who has R. His full comment was:


You mis-use file LICENSE: for BSD_3_clause this should only be the
completed template, see
<https://www.r-project.org/Licenses/BSD_3_clause>.

Re compilation warnings, with GCC 6 I get

* checking whether package ‘dparser’ can be installed ... [10s/10s] WARNING
Found the following significant warnings:
  read_binary.c:44:12: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
  read_binary.c:50:34: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]

Pls fix these.

Otoh, I get

* checking tests ... [5s/5s] ERROR
  Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  x[1]: "g10.test.g.1:1: syntax error after 'c'"
  y[1]: "5 states 3 scans 3 shifts 1 reductions 0 compares 0 ambiguities"

  x[2]: "fatal error, 'g10.test.g.1' line 1"
  y[2]: "( a  b  c )"

  testthat results ================================================================
  OK: 590 SKIPPED: 0 FAILED: 1
  1. Failure: g10.test.g: g10.test.g.1 (@test-dparser.R#96)

  Error: testthat unit tests failed
  In addition: Warning message:
  In body(fun) : argument is not a function
  Execution halted

(with a very current r-devel)

???

-k
mattfidler commented 7 years ago

For me all the tests succeed:

> test(filter="dparser")
Loading dparser
Testing dparser
Grammar ansic.test.g: .
Grammar g1.test.g: .
Grammar g10.test.g: .
Grammar g11.test.g: ...
Grammar g12.test.g: .
Grammar g13.test.g: .
Grammar g14.test.g: .
Grammar g15.test.g: .
Grammar g16.test.g: .
Grammar g17.test.g: .
Grammar g18.test.g: .
Grammar g19.test.g: .
Grammar g2.test.g: .
Grammar g20.test.g: .
Grammar g21.test.g: .
Grammar g22.test.g: .
Grammar g23.test.g: .
Grammar g24.test.g: .
Grammar g25.test.g: .
Grammar g26.test.g: .
Grammar g27.test.g: .
Grammar g28.test.g: ..
Grammar g29.test.g: .
Grammar g3.test.g: .
Grammar g30.test.g: .
Grammar g31.test.g: .
Grammar g32.test.g: .
Grammar g33.test.g: .
Grammar g34.test.g: .
Grammar g35.test.g: .
Grammar g36.test.g: .
Grammar g37.test.g: .
Grammar g38.test.g: .
Grammar g39.test.g: .
Grammar g4.test.g: .
Grammar g40.test.g: .
Grammar g41.test.g: .
Grammar g42.test.g: .
Grammar g43.test.g: ...
Grammar g44.test.g: .
Grammar g45.test.g: .
Grammar g46.test.g: .
Grammar g47.test.g: .
Grammar g48.test.g: .
Grammar g49.test.g: .
Grammar g5.test.g: .
Grammar g50.test.g: .
Grammar g51.test.g: .
Grammar g6.test.g: .
Grammar g7.test.g: ..
Grammar g8.test.g: .
Grammar g9.test.g: .
Grammar python.test.g: .
Grammar sample.test.g: ..................................
Grammar utf8.test.g: .

DONE ===========================================================================
> 

This is also true of all the test environments that I have looked into with appveyor and travis.

What I did was allowed it to fail. I'm not sure that is a good idea, but it still didn't parse the file correctly. I really don't know what the implications of not-matching the tests are...

mattfidler commented 7 years ago

Thank you for all your help, by the way. I am so grateful for your help.

mattfidler commented 7 years ago

I was wondering if you could help me with some of the questions from CRAN; They asked:

This passes checking ok now, but pls make the Description more complete:
write out GLR, add a reference for Tomita algorithm, ideally using a
DOI: write

   Authors (year) <DOI:.....>

(with no space after 'DOI:').

Finally, the title mentions a 'Dparser' package (should be in single
quotes), so pls explain that in the Description too, ideally giving a
URL for it written as <http....>, e.g.

  the 'Dparser' package ........ (see <http...> for more information)

Best

Can you provide any of the information? I don't know if you have a DOI.

Of course I can provide the URL to the dparser page, but which would you prefer (the github?)

mattfidler commented 7 years ago
mattfidler commented 7 years ago

For now, I could use

Description: A Scannerless GLR parser/parser generator.  Note that GLR standing for "generalized LR", where L stands for "left-to-right" and
   R stands for "rightmost (derivation)".  For more information see <https://en.wikipedia.org/wiki/GLR_parser>. This parser is based on the Tomita
   (1987) algorithm. (Paper can be found at <http://acl-arc.comp.nus.edu.sg/archives/acl-arc-090501d3/data/pdf/anthology-PDF/J/J87/J87-1004.pdf>).
   The original dparser package documentation can be found at <http://dparser.sourceforge.net/>.  This allows you to add mini-languages to R (like
   RxODE's ODE mini-language Wang, Hallow, and James 2015 <DOI:10.1002/psp4.12052>) or to parse other languages like NONMEM to automatically translate
   them to R code.   To use this in your code, add a LinkingTo 'dparser' in your DESCRIPTION file and instead of using '#include <dparse.h>' use
   '#include <dparser.h>'.  This also provides a R-based port of the make_dparser <http://dparser.sourceforge.net/d/make_dparser.cat> command called
   'mkdparser'.  Additionally you can parse an arbitrary grammar within R using the 'dparse' function.
mattfidler commented 7 years ago

It's on cran now. Thank you!