ComputeGroupedExpectedSetForState() static private method

static private ComputeGroupedExpectedSetForState ( Grammar grammar, ParserState state ) : StringSet
grammar Grammar
state ParserState
return StringSet
Exemplo n.º 1
0
        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);
        }