public SyntaxTreeNode(GrammarEngine gren, IntPtr hNode) { _gren = gren; _hNode = hNode; Entry = gren.GetEntry(GrammarApi.sol_GetNodeIEntry(_gren.GetEngineHandle(), _hNode)); SourceWord = GetNodeContents(_hNode); int nleaf = GrammarApi.sol_CountLeafs(_hNode); Leafs = new SyntaxTreeNode[nleaf]; for (int i = 0; i < nleaf; ++i) { Leafs[i] = new SyntaxTreeNode(_gren, GrammarApi.sol_GetLeaf(_hNode, i)); } }