예제 #1
0
        //IdentifierExpr
        public override double VisitIdentifierExpr(LabCalculatorParser.IdentifierExprContext context)
        {
            var    result = context.GetText();
            double value;

            //видобути значення змінної з таблиці
            if (tableIdentifier.TryGetValue(result.ToString(), out value))
            {
                return(value);
            }
            else
            {
                return(0.0);
            }
        }
 /// <summary>
 /// Exit a parse tree produced by the <c>IdentifierExpr</c>
 /// labeled alternative in <see cref="LabCalculatorParser.expression"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitIdentifierExpr([NotNull] LabCalculatorParser.IdentifierExprContext context)
 {
 }