begin compiler-like assembling tokens to elements