Re: [Rd] Question on parsing R code from C

2011-11-16 Thread KR
Simon Urbanek r-project.org> writes: > Not without seeing the actual code. (And details such as which platform > you're on). > Note that setup_Rmainloop() is the last to set the SETJMP context target so you should make sure the stack is > still present after it finished (i.e. you can't call it

Re: [Rd] Question on parsing R code from C

2011-11-15 Thread KR
Simon Urbanek r-project.org> writes: > AFAIR you have to evaluate parse(text=...) for that, there is no C-level access to parser errors. Yes that did it, thanks! > If you get a crash, you're not setting up you R correctly. If your R quits then you are in non-interactive mode > and you didn't

Re: [Rd] Question on parsing R code from C

2011-11-11 Thread KR
First of all thanks a lot to you both for all the replies, they have been of great help to me! I got the basic embedding running, however I still have some issues to solve in order to complete the interface to R I am working on: 1. I initialize with Rf_initEmbeddR(). - Is there a way to have mo

Re: [Rd] Question on parsing R code from C

2011-11-08 Thread KR
Simon Urbanek r-project.org> writes: > Except that you don't know what are macros, inlined functions and actual functions. If you are careful you > can possibly fall back to external functions but, obviously, your code will > be less efficient. I would > still prefer including Rinternals.h - yo

Re: [Rd] Question on parsing R code from C

2011-11-08 Thread KR
Simon Urbanek r-project.org> writes: > I'm not sure I understand this really - it doesn't define SEXP. I would > expect something like > > typedef void *SEXP; > > Which may work for declarations. Note, however, that for the actual code you'll need to include the headers anyway. Thanks for th

[Rd] Question on parsing R code from C

2011-11-08 Thread KR
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 que