コード例 #1
0
        /// <summary>
        /// Generates a unary operator of the specified type with the specified node.
        /// </summary>
        /// <param name="opType">The type of unary operator.</param>
        /// <param name="node">The child node.</param>
        /// <returns>The root node of this AST.</returns>
        public static Node Generate(UnaryOperatorType opType, Node node)
        {
            var unaryOp = new UnaryOperator(opType);

            unaryOp.AddChild(node);
            return(unaryOp);
        }