| Parser | R Documentation |
The parser class for generating abstract syntax trees for given table formulas.
The parser class for generating abstract syntax trees for given table formulas.
R6Class object.
Aho, A. V., Lam, M. S., Sethi, R., and Ullman, J. D. (2006) Compilers: Principles, Techniques, and Tools, 2nd edition. Addison Wesley.
inputStorage for input string of a formula
posThe current parsing position
lenThe length of the input
new()Create a parser
Parser$new()
expect()Specify expectation of next token from lexer
Parser$expect(id)
idThe token id expected in stream, otherwise it's an error
peek()Peek at the next token from parser
Parser$peek()
eat_whitespace()Remove white space to find start of next token
Parser$eat_whitespace()
next_token()Returns next lexical token
Parser$next_token()
format()Return format string as token from lexical stream
Parser$format()
r_expression()Return R expression as token from lexical stream
Parser$r_expression()
factor()Return next factor as token.
Parser$factor()
term()Parse and return next term in stream
Parser$term()
expression()Parse and return next expression in stream
Parser$expression()
table_formula()Parse and return table formula from stream
Parser$table_formula()
run()Run the parser
Parser$run(x)
x(character,formula) The table specification to parse
clone()The objects of this class are cloneable with this method.
Parser$clone(deep = FALSE)
deepWhether to make a deep clone.
Parser$new()$run("col1 + col2 + col3 ~ drug*age+spiders")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.