lang_2_tree {autoharp}R Documentation

Convert language object to tree.

Description

A recursive function for converting a language object to treeharp.

Usage

lang_2_tree(lang_obj, node_id, ni_env)

Arguments

lang_obj

A language object.

node_id

The calling node to this language object. This should only be greater than 0 if the ni_env already contains a partial adjacency list and corresponding node information. This will happen when this function is called recursively.

ni_env

An environment to store the adjacency list and node information.

Details

This function is used by TreeHarp constructors. It should not have to be called by a user. It works by bulding up an adjacency list and node node information data frame within the supplied environment.

Value

Nothing

Examples

e1 <- new.env() 
lang_2_tree(quote(X <- 1), 0, e1) 
e1$adj_list 
e1$node_info

[Package autoharp version 0.0.8 Index]