A system comprising: a processor and a memory including a module configured to cause the processor to: create a data structure accessible to a consumer using said data structure, the data structure representing a tree that is a compiler-generated tree comprising a parse tree, a syntax tree, a semantic tree or a bound tree, wherein the data structure comprises: a re-useable first tree representing a shared read-only tree not directly accessible to the consumer and that is shared by multiple consumers, wherein nodes in the read-only tree have uni-directional pointers such that the nodes of the first tree do not have pointers to parent nodes; and a second tree representing a mutable tree accessible to the consumer, comprising at least a root node that controls access of the consumer to the first tree, wherein the root node of the second tree comprises a pointer to the first tree's root node and wherein the root node of the second tree wraps the root node of the first tree; and wherein the second tree is constructed on demand when the consumer requests to modify a node in the first tree, by generating a node in the second tree for each node in the first tree on a path to the, by the consumer, requested node in the first tree, wherein the generated node corresponds to a next node in the first tree on the path to the requested node, the generated node comprising a pointer to the corresponding node of the first tree, and a pointer to a parent node of the generated node in the second tree. a processor and a memory including a module configured to cause the processor to: create a data structure accessible to a consumer using said data structure, the data structure representing a tree that is a compiler-generated tree comprising a parse tree, a syntax tree, a semantic tree or a bound tree, wherein the data structure comprises: a re-useable first tree representing a shared read-only tree not directly accessible to the consumer and that is shared by multiple consumers, wherein nodes in the read-only tree have uni-directional pointers such that the nodes of the first tree do not have pointers to parent nodes; and a second tree representing a mutable tree accessible to the consumer, comprising at least a root node that controls access of the consumer to the first tree, wherein the root node of the second tree comprises a pointer to the first tree's root node and wherein the root node of the second tree wraps the root node of the first tree; and create a data structure accessible to a consumer using said data structure, the data structure representing a tree that is a compiler-generated tree comprising a parse tree, a syntax tree, a semantic tree or a bound tree, wherein the data structure comprises: a re-useable first tree representing a shared read-only tree not directly accessible to the consumer and that is shared by multiple consumers, wherein nodes in the read-only tree have uni-directional pointers such that the nodes of the first tree do not have pointers to parent nodes; and a second tree representing a mutable tree accessible to the consumer, comprising at least a root node that controls access of the consumer to the first tree, wherein the root node of the second tree comprises a pointer to the first tree's root node and wherein the root node of the second tree wraps the root node of the first tree; and wherein the second tree is constructed on demand when the consumer requests to modify a node in the first tree, by generating a node in the second tree for each node in the first tree on a path to the, by the consumer, requested node in the first tree, wherein the generated node corresponds to a next node in the first tree on the path to the requested node, the generated node comprising a pointer to the corresponding node of the first tree, and a pointer to a parent node of the generated node in the second tree. <EOS>