On 8/17/07, Ali - <[EMAIL PROTECTED]> wrote: > Hi, > > Is there any parser generator like www.antlr.org? Moreover, how does simple
Given the response, it looks like no one has come up with an antlr parser for R but there are some facilities within R itself. showTree() in the R codetools package which can generate a Lisp style expression for any R expression: > library(codetools) > showTree(quote(for(i in myvec[1:3]) print(i+88*2+3*4))) (for i ([ myvec (: 1 3)) (print (+ (+ i (* 88 2)) (* 3 4)))) Looking at the source of showTree would show you how to walk an R parse tree. The Ryacas R package has a recursive descent R parser that is used to process R code translating it to yacas and it also can translate OpenMath XML code generated by yacas to R. See: http://ryacas.googlecode.com ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.