restructure logging
parse a simple AST from R