Ejemplo n.º 1
0
        public override void EnterField([NotNull] InsurancePolicyRulesParser.FieldContext context)
        {
            base.EnterField(context);

            switch (context.Start.TokenIndex)
            {
            case 0:
                int policyID = 0;
                if (int.TryParse(context.Start.Text, out policyID))
                {
                    _insurancePolicyDataInstance.PolicyID = policyID;
                }
                break;

            case 2:
                _insurancePolicyDataInstance.StateCode = context.Start.Text;
                break;

            case 4:
                _insurancePolicyDataInstance.Country = context.Start.Text;
                break;

            case 6:
                double eqSiteLimit = 0;
                if (double.TryParse(context.Start.Text, out eqSiteLimit))
                {
                    _insurancePolicyDataInstance.EqSiteLimit = eqSiteLimit;
                }
                break;

            case 8:
                double huSiteLimit = 0;
                if (double.TryParse(context.Start.Text, out huSiteLimit))
                {
                    _insurancePolicyDataInstance.HuSiteLimit = huSiteLimit;
                }
                break;

            case 10:
                double flSiteLimit = 0;
                if (double.TryParse(context.Start.Text, out flSiteLimit))
                {
                    _insurancePolicyDataInstance.FlSiteLimit = flSiteLimit;
                }
                break;

            case 30:
                _insurancePolicyDataInstance.Line = context.Start.Text;
                break;

            case 32:
                _insurancePolicyDataInstance.Construction = context.Start.Text;
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Enter a parse tree produced by <see cref="InsurancePolicyRulesParser.field"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void EnterField([NotNull] InsurancePolicyRulesParser.FieldContext context)
 {
 }
Ejemplo n.º 3
0
 public override void ExitField([NotNull] InsurancePolicyRulesParser.FieldContext context)
 {
     base.ExitField(context);
 }
 /// <summary>
 /// Visit a parse tree produced by <see cref="InsurancePolicyRulesParser.field"/>.
 /// <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 VisitField([NotNull] InsurancePolicyRulesParser.FieldContext context)
 {
     return(VisitChildren(context));
 }