/* Vec3 bejárása. * * Az egyes koordináták mind operation-ök. * */ public override dynamic VisitVec3([NotNull] DDD_layout_scriptParser.Vec3Context context) { var operationArr = context.operation(); dynamic[] executedOperationValues = new dynamic[3]; bool ok = true; for (int i = 0; i < 3; ++i) { executedOperationValues[i] = VisitOperation(operationArr[i]); // valamelyik koordináta vec3 volt, annak nincs értelme if (executedOperationValues[i] is vec3) { alerts.Add(new error(context.Start.Line, $"{operationArr[i].GetText()} evaluates to vec3")); ok = false; } if (!ok && i == 3 - 1) { return(null); } } return(new vec3(executedOperationValues[0], executedOperationValues[1], executedOperationValues[2])); }
/// <summary> /// Exit a parse tree produced by <see cref="DDD_layout_scriptParser.vec3"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitVec3([NotNull] DDD_layout_scriptParser.Vec3Context context) { }
/// <summary> /// Visit a parse tree produced by <see cref="DDD_layout_scriptParser.vec3"/>. /// <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 VisitVec3([NotNull] DDD_layout_scriptParser.Vec3Context context) { return(VisitChildren(context)); }