6
votes

I am looking for a Bison/Flex implementation for parsing R code, so that I can use it in a C++ program to implement a programming language that makes use of R expressions.

I couldn't find anything available on Google, other than this:

https://github.com/halpo/parser

and this does not seem to be quite an R parser. (For example, I couldn't find the BNF grammar for R expressions.)

Is the only way left actually to download R source code and play with it? R is quite a complex piece of software, and I am not sure it would be very easy to isolate the parser from the rest of the code.

1
Not an answer but did you try to use RInside?agstudy
i think the highlight package dug into this sort of thing - Edit: actually, using the parser package.baptiste
@baptiste thanks. I am looking for writing a domain specific language that uses syntax similar to R, so I want to base myself on some bison/flex code for R. the parser package can be run inside R. When I looked into it, I couldn't find any BNF specification for R or something that I could use to continue from there.kloop
scratch that. it was in a directory I didn't expect it to be... exploring now.kloop

1 Answers