public addressed_value Into(addressed_value x, addressed_value v) // При возникновении новой конструкции в грамматике variable добавить обработку сюда { if (v.GetType() == typeof(dot_question_node)) { var vv = v as dot_question_node; var res = new dot_question_node(Into(x, vv.left), vv.right, x.source_context); return(res); } else if (v.GetType() == typeof(dot_node)) { var vv = v as dot_node; var res = new dot_node(Into(x, vv.left), vv.right, x.source_context); return(res); } else if (v.GetType() == typeof(indexer)) { var vv = v as indexer; var res = new indexer(Into(x, vv.dereferencing_value), vv.indexes, x.source_context); return(res); } else if (v.GetType() == typeof(slice_expr)) { var vv = v as slice_expr; var res = new slice_expr(Into(x, vv.dereferencing_value), vv.from, vv.to, vv.step, x.source_context); return(res); } else if (v.GetType() == typeof(slice_expr_question)) { var vv = v as slice_expr_question; var res = new slice_expr_question(Into(x, vv.dereferencing_value), vv.from, vv.to, vv.step, x.source_context); return(res); } else if (v.GetType() == typeof(method_call)) { var vv = v as method_call; var res = new method_call(Into(x, vv.dereferencing_value), vv.parameters, x.source_context); return(res); } else if (v.GetType() == typeof(roof_dereference)) { var vv = v as roof_dereference; var res = new roof_dereference(Into(x, vv.dereferencing_value), x.source_context); return(res); } else if (v.GetType() == typeof(ident_with_templateparams)) { var vv = v as ident_with_templateparams; var res = new ident_with_templateparams(Into(x, vv.name), vv.template_params, x.source_context); return(res); } else { var res = new dot_node(x, v, x.source_context); return(res); } }
public override void visit(slice_expr_question sl) { var el = construct_expression_list_for_slice_expr(sl); var mc = method_call.NewP(dot_node.NewP(sl.v, new ident("SystemSliceQuestion", sl.v.source_context), sl.v.source_context), el, sl.source_context); var sug = sugared_addressed_value.NewP(sl, mc, sl.source_context); ReplaceUsingParent(sl, sug); visit(mc); // обойти заменённое на предмет наличия такого же синтаксического сахара }
public virtual void visit(slice_expr_question _slice_expr_question) { DefaultVisit(_slice_expr_question); }