Help finding some code in the R source code
Greg,
On Nov 13, 2005, at 7:03 PM, Greg Evans wrote:
I'm trying to write some Python code to check if a string text contains a complete R statement. I'm hoping someone will be able to point me to the right place in the R source code, so I can use it as a starting point.
What happens internally is that R runs the expression through the parser. When the parser returns PARSE_INCOMPLETE then you know that the expression is not complete and thus more input is needed. If you are directly interfacing R from Python then you can easily do exactly the same thing. However, if you want a solution in pure Python, it may be more difficult as it would be equal to re-writing the R parser in Python... (or some 'light' version of it..). Cheers, Simon