コード例 #1
0
ファイル: AnalyseVisitor.cs プロジェクト: omeruis/COO_Projet
        /// <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"));
        }
コード例 #2
0
 /// <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));
 }
コード例 #3
0
 /// <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)
 {
 }