/// <summary> /// Execute la copie d'une cellule dans une autre /// </summary> /// <param name="context">la partie droite de la regle de la grammaire</param> /// <returns>Un message de confirmation</returns> public override Term VisitCopy([NotNull] TableurParser.CopyContext context) { //recupere l'adresse de la source et de la cible ITerminalNode[] adr = context.ADR(); String adr1 = adr[0].GetText(); String adr2 = adr[1].GetText(); String[] targetSplit = adr2.Split('@'); String[] srcSplit = adr1.Split('@'); CellCoord target = new CellCoord(ulong.Parse(targetSplit[0]), ulong.Parse(targetSplit[1])); CellCoord src = new CellCoord(ulong.Parse(srcSplit[0]), ulong.Parse(srcSplit[1])); //copie this.kern.CopyData(target, src); return(new Texte("Copy Success")); }
/// <summary> /// Visit a parse tree produced by the <c>Copy</c> /// labeled alternative in <see cref="TableurParser.instr"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitCopy([NotNull] TableurParser.CopyContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by the <c>Copy</c> /// labeled alternative in <see cref="TableurParser.instr"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitCopy([NotNull] TableurParser.CopyContext context) { }