public void VBNetResumeStatementTest() { ResumeStatement resumeStatement = ParseUtilVBNet.ParseStatement <ResumeStatement>("Resume"); }
public virtual object Visit(ResumeStatement resumeStatement, object data) { Debug.Assert(resumeStatement != null); return(data); }
public virtual object VisitResumeStatement(ResumeStatement resumeStatement, object data) { throw new global::System.NotImplementedException("ResumeStatement"); }
public override object VisitResumeStatement(ResumeStatement resumeStatement, object data) { return(base.VisitResumeStatement(resumeStatement, data)); }
void ResumeStatement( #line 3167 "VBNET.ATG" out ResumeStatement resumeStatement) { #line 3169 "VBNET.ATG" resumeStatement = null; string label = String.Empty; if ( #line 3172 "VBNET.ATG" IsResumeNext()) { Expect(179); Expect(149); #line 3173 "VBNET.ATG" resumeStatement = new ResumeStatement(true); } else if (la.kind == 179) { lexer.NextToken(); if (StartOf(42)) { LabelName( #line 3174 "VBNET.ATG" out label); } #line 3174 "VBNET.ATG" resumeStatement = new ResumeStatement(label); } else SynErr(284); }
public void ResumeStatementTest() { ResumeStatement resumeStatement = ParseUtil.ParseStatement <ResumeStatement>("Resume"); }
public object VisitResumeStatement(ResumeStatement resumeStatement, object data) { AddError(resumeStatement, "old VB-style exception handling is not supported."); return(null); }
//factory method that takes a line of input and creates a statement //object public static Statement CreateStatement(Scanner s) { //Remember what line we started on in case the //statement spans lines. int line = s.LineNumber; bool please = false; bool enabled = true; int percent = 100; Statement retval = null; string Label = null; try { //First we look to see if there is a label... if (s.Current.Groups["label"].Success) { Label = Statement.ReadGroupValue(s, "label"); s.MoveNext(); } bool validPrefix = false; //Next we expect either DO, PLEASE, or PLEASE DO if (s.Current.Value == "PLEASE") { validPrefix = true; please = true; s.MoveNext(); } //If they've said PLEASE then they don't *have* to //use DO. Unless they plan on doing a DON'T or DO NOT if (s.Current.Value == "DO") { validPrefix = true; s.MoveNext(); if (s.Current.Value == "NOT" || s.Current.Value == "N'T") { enabled = false; s.MoveNext(); } } //Finally the user might put a %50 here. Note that //even if the statement is disabled we need to remember //the % on the off chance that the statement gets enabled //later. if (s.Current.Value == "%") { s.MoveNext(); string p = Statement.ReadGroupValue(s, "digits"); percent = Int32.Parse(p); s.MoveNext(); } //Here we parse out the statement prefix. Easier to //do it here than break out a separate function. while (s.Current.Groups["prefix"].Success) { switch (s.Current.Value) { case "DO": validPrefix = true; break; case "PLEASE": validPrefix = true; please = true; break; case "NOT": case "N'T": enabled = false; break; case "%": s.MoveNext(); string p = Statement.ReadGroupValue(s, "digits"); percent = Int32.Parse(p); break; } s.MoveNext(); } if (!validPrefix) { throw new ParseException(String.Format(Messages.E017, s.LineNumber + 1)); } if (s.Current.Groups["statement"].Success) { //We are looking at the beginning of a statement switch (s.Current.Value) { case "ABSTAIN FROM": retval = new AbstainStatement(s); break; case "READ OUT": retval = new ReadOutStatement(s); break; case "WRITE IN": retval = new WriteInStatement(s); break; case "COME FROM": retval = new ComeFromStatement(s); break; case "REINSTATE": retval = new ReinstateStatement(s); break; case "STASH": retval = new StashStatement(s); break; case "RESUME": retval = new ResumeStatement(s); break; case "FORGET": retval = new ForgetStatement(s); break; case "IGNORE": retval = new IgnoreStatement(s); break; case "REMEMBER": retval = new RememberStatement(s); break; case "RETRIEVE": retval = new RetrieveStatement(s); break; case "GIVE UP": retval = new GiveUpStatement(s); break; } } else if (s.Current.Groups["label"].Success) { retval = new NextStatement(s); } else if (s.Current.Groups["var"].Success) { retval = new CalculateStatement(s); } else { throw new ParseException(String.Format(Messages.E017, s.LineNumber + 1)); } //Move on to what should be the beginning of the next statement s.MoveNext(); } catch (ParseException) { //Console.WriteLine(p.Message); if (retval != null) { retval.Splatted = true; } else { retval = new NonsenseStatement(s); } s.Panic(); } //Note that even badly formed statements get their labels set. This way //you can still jump to them (though that will cause an exception). if (Label != null) { retval.Label = Label; } retval.LineNumber = line; retval.bEnabled = enabled; retval.bPlease = please; retval.Percent = percent; return(retval); }
public virtual object VisitResumeStatement(ResumeStatement resumeStatement, object data) { Debug.Assert((resumeStatement != null)); return null; }
public object VisitResumeStatement(ResumeStatement resumeStatement, object data) { throw new NotImplementedException(); }
private bool IsMatch(ResumeStatement left, ResumeStatement data) { return(false); }
public sealed override object VisitResumeStatement(ResumeStatement resumeStatement, object data) { BeginVisit(resumeStatement); object result = TrackedVisitResumeStatement(resumeStatement, data); EndVisit(resumeStatement); return result; }
public virtual object TrackedVisitResumeStatement(ResumeStatement resumeStatement, object data) { return base.VisitResumeStatement(resumeStatement, data); }