private bool TryParseTerm(ITokenStream tokens, out Expression?term) { if (TermParser == null) { throw new ArgumentNullException("Term parser must be set before parsing"); } term = TermParser.Parse(tokens); if (term == null) { tokens.Reset(); return(false); } else { tokens.ForgetPreceding(); return(true); } }