public sealed override object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { this.BeginVisit(gotoCaseStatement); object result = this.TrackedVisitGotoCaseStatement(gotoCaseStatement, data); this.EndVisit(gotoCaseStatement); return result; }
public override object TrackedVisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { Console.WriteLine("VisitGotoCaseStatement"); return null; }
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { throw new global::System.NotImplementedException("GotoCaseStatement"); }
public virtual object TrackedVisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { return base.VisitGotoCaseStatement(gotoCaseStatement, data); }
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { throw CreateException(gotoCaseStatement); }
void GotoStatement( #line 1772 "cs.ATG" out Statement stmt) { #line 1773 "cs.ATG" Expression expr; stmt = null; Expect(78); if (StartOf(18)) { Identifier(); #line 1777 "cs.ATG" stmt = new GotoStatement(t.val); Expect(11); } else if (la.kind == 55) { lexer.NextToken(); Expr( #line 1778 "cs.ATG" out expr); Expect(11); #line 1778 "cs.ATG" stmt = new GotoCaseStatement(expr); } else if (la.kind == 63) { lexer.NextToken(); Expect(11); #line 1779 "cs.ATG" stmt = new GotoCaseStatement(null); } else SynErr(203); }
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { Debug.Assert((gotoCaseStatement != null)); Debug.Assert((gotoCaseStatement.Expression != null)); return gotoCaseStatement.Expression.AcceptVisitor(this, data); }
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { Debug.Assert((gotoCaseStatement != null)); Debug.Assert((gotoCaseStatement.Expression != null)); nodeStack.Push(gotoCaseStatement.Expression); gotoCaseStatement.Expression.AcceptVisitor(this, data); gotoCaseStatement.Expression = ((Expression)(nodeStack.Pop())); return null; }
public virtual bool VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object d) { if ((gotoCaseStatement == null)) { return SetFailure(); } if ((d == null)) { return SetFailure(); } if ((gotoCaseStatement.Expression == null)) { return SetFailure(); } if(gotoCaseStatement.GetType() != d.GetType()) {return SetFailure();} var data = (GotoCaseStatement)d; if (!IsMatch(gotoCaseStatement, data)) { return SetFailure(); } return gotoCaseStatement.Expression.AcceptVisitor(this, data.Expression); }
public object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { throw new NotImplementedException (); }
public override object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { gotoCases.Add(gotoCaseStatement); return base.VisitGotoCaseStatement(gotoCaseStatement, data); }
bool CompareCase(CaseLabel label, GotoCaseStatement stmt) { if (label.IsDefault && stmt.IsDefaultCase) return true; if (stmt.Expression is PrimitiveExpression && label.Label is PrimitiveExpression) { PrimitiveExpression e1 = stmt.Expression as PrimitiveExpression; PrimitiveExpression e2 = label.Label as PrimitiveExpression; return object.Equals(e1.Value, e2.Value); } return false; }
public override object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { this.isOk = false; foreach (CaseLabel label in this.cases) { if (label.Label.ToString() == gotoCaseStatement.Expression.ToString()) this.isOk = true; } if (!this.isOk) { MessageService.ShowError("Case section '" + ((PrimitiveExpression)gotoCaseStatement.Expression).StringValue + "' not found inside the selected range!"); } return base.VisitGotoCaseStatement(gotoCaseStatement, data); }
private bool IsMatch(GotoCaseStatement left, GotoCaseStatement data) { return true; }
public object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) { if (currentSwitchTempName == null) { AddError(gotoCaseStatement, "goto case cannot be used outside switch"); return null; } string labelName; if (gotoCaseStatement.IsDefaultCase) { labelName = "default"; } else { B.Expression expr = ConvertExpression(gotoCaseStatement.Expression); if (expr == null) return null; labelName = expr.ToCodeString().GetHashCode().ToString(System.Globalization.NumberFormatInfo.InvariantInfo); } return new B.GotoStatement(GetLexicalInfo(gotoCaseStatement), new B.ReferenceExpression(currentSwitchTempName + "_" + labelName)); }