Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there some code for a basic R parser?

Tags:

parsing

r

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.

like image 621
kloop Avatar asked Feb 25 '14 23:02

kloop


1 Answers

You should have a better look: https://github.com/halpo/parser/blob/master/inst/grammar/gram.y

like image 146
Karl Forner Avatar answered Sep 28 '22 00:09

Karl Forner