Beispiel #1
0
        private Node CreateMethod(List <Node> parameters)
        {
            parameters.CheckLength(6);
            var node = new Method
            {
                Visibility       = (Visibility)parameters[0],
                Virtual_Override = (TokenNode)parameters[1],
                ReturnType       = (Type)parameters[2],
                Name             = (TokenNode)parameters[3],
                Parameters       = ((NodeList)parameters[4])?.Nodes.Cast <Parameter>().ToList(),
                Body             = (Body)parameters[5],
            };

            node.AddChildren(node.Visibility, node.Virtual_Override, node.ReturnType, node.Name, node.Body);
            node.AddChildren(node.Parameters?.ToArray());

            return(node);
        }