Patent attributes
Provided is a computer program stored in a computer readable storage medium, which includes encoded commands, wherein when the computer program is executed by one or more processors of a computer system, the computer program allows the one or more processor to perform the following steps for generating a balanced parse tree having an optimized height, the steps including: receiving a token stream including at least one token—the token stream meets an associate law—; determining whether an n-ary parse tree is full—the n-ary parse tree includes at least one node and the at least one node each includes n or less child nodes; a first node generating operation of generating a node while increasing a height of the parse tree based on the token stream when the n-ary parse tree is full; and a second node generating operation of generating the node while maintaining the height of the parse tree based on the token stream when the n-ary parse tree is not full.