public override AST.RuleTree VisitSingleOutcome([NotNull] WordLangParser.SingleOutcomeContext context) { var outcome = new AST.Outcome(); //outcome.Action = new AST.FieldString() //{ // Value = context.text().NAME().CombineTokens(), // StartIndex = context.text().NAME().First().Symbol.StartIndex, // StopIndex = context.text().NAME().Last().Symbol.StopIndex //}; return(outcome); }
public override string VisitSingleOutcome([NotNull] WordLangParser.SingleOutcomeContext context) { if (context.outcomeSetter() != null) { return(Visit(context.outcomeSetter())); } if (context.outcomeFunction() != null) { return(Visit(context.outcomeFunction())); } if (context.outcomePass() != null) { return(Visit(context.outcomePass())); } throw new InvalidOperationException(); }
public override List <GeneralError> VisitSingleOutcome([NotNull] WordLangParser.SingleOutcomeContext context) { var errs = new List <GeneralError>(); //var modifierErrs = context.outcomeModifier()?.Accept(this); //if (modifierErrs != null) //{ // errs.AddRange(modifierErrs); //} var setterErrs = context.outcomeSetter()?.Accept(this); if (setterErrs != null) { errs.AddRange(setterErrs); } return(errs); }