public StringSet GetExpectedTermSet() {
if (CurrentParserState == null)
return new StringSet();
//See note about multi-threading issues in ComputeReportedExpectedSet comments.
if (CurrentParserState.ReportedExpectedSet == null)
CurrentParserState.ReportedExpectedSet = CoreParser.ComputeGroupedExpectedSetForState(Language.Grammar, CurrentParserState);
//Filter out closing braces which are not expected based on previous input.
// While the closing parenthesis ")" might be expected term in a state in general,
// if there was no opening parenthesis in preceding input then we would not
// expect a closing one.
var expectedSet = FilterBracesInExpectedSet(CurrentParserState.ReportedExpectedSet);
return expectedSet;
}