/*public var_def_statement NewVarOrIdentifier(ident identifier, named_type_reference fptype, LexLocation loc) * { * var n_t_r = fptype; * var vds = new var_def_statement(); * vds.vars = new ident_list(); * vds.vars.idents.Add(identifier); * vds.vars_type = n_t_r; * vds.source_context = loc; * return vds; * }*/ /* Функция стала короткой и утратила необходимость * public statement_list NewLambdaBody(expression expr_l1, LexLocation loc) * { * var sl = new statement_list(); * sl.expr_lambda_body = true; * var id = new ident("result"); * var op = new op_type_node(Operators.Assignment); * var ass = new assign(id, expr_l1, op.type); * parsertools.create_source_context(ass, id, expr_l1); // дурацкая функция - если хотя бы у одного sc=null, то возвращает null * if (ass.source_context == null) * if (expr_l1.source_context != null) * ass.source_context = expr_l1.source_context; * else if (id.source_context != null) * ass.source_context = id.source_context; * sl.subnodes.Add(ass); * sl.source_context = loc; * var sl = new statement_list(new assign("result",expr_l1,loc),loc); * * return sl; * }/**/ public procedure_definition CreateAndAddToClassReadFunc(expression ex, ident id, SourceContext sc) { var fd = SyntaxTreeBuilder.BuildShortFuncDefinition(new formal_parameters(), null, new method_name(id.name, sc), new no_type(), ex, sc); return(fd); }