[Rd] Question on parsing R code from C

KR krunal.rao78 at gmail.com
Tue Nov 8 20:42:07 CET 2011


Hi all,

I am facing the necessity to parse R code from C-side. As a first approximation 
the goal would be a re-implementation of the R shell (not Rgui).

I read the document at http://cran.r-project.org/doc/manuals/R-exts.html section 
5.12, and the related source code example. 

I have some questions:

1. I need to declare the types and function signatures that I am going to use 
for this task without having to actually include the R headers. Can I safely 
declare SEXP according to the following ?
typedef struct SEXP *unknwn_handle;
More in general, is there a reference document for the C API (listing function 
signatures, and type definitions) ?

2. If the parsed R code of the working implementation contain commands like 
plot(), will the opportune windows pop-up as if I were using the R shell (on 
both windows and unix systems) ?

3. What initialization do I need to perform to be in exactly the same starting 
state as if I had executed the R shell with the --vanilla option?


Any help or feedback is appreciated.

Thank you.

Kind regard



More information about the R-devel mailing list