示例#1
0
        /// <summary>
        /// Creer un Terme 'Reference' qui permet de referencer une cellule dans un expression
        /// </summary>
        /// <param name="context">la partie droite de la regle de la grammaire</param>
        /// <returns>Le Terme 'Reference' qui reference une cellule du tableur</returns>
        public override Term VisitReference([NotNull] TableurParser.ReferenceContext context)
        {
            String adr = context.ADR().GetText();

            String[]  cur    = adr.Split('@');
            CellCoord target = new CellCoord(ulong.Parse(cur[0]), ulong.Parse(cur[1]));

            try
            {
                Cell referenced = this.kern.searchCell(target);
                return(new References(referenced));
            }
            catch (Exception e)
            {
                return(new Texte(e.Message));
            }
        }
示例#2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>Reference</c>
 /// labeled alternative in <see cref="TableurParser.atom"/>.
 /// <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 VisitReference([NotNull] TableurParser.ReferenceContext context)
 {
     return(VisitChildren(context));
 }
示例#3
0
 /// <summary>
 /// Exit a parse tree produced by the <c>Reference</c>
 /// labeled alternative in <see cref="TableurParser.atom"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitReference([NotNull] TableurParser.ReferenceContext context)
 {
 }