/// <summary> /// Given an input text, and set of options, parses out a fully representative syntax tree /// and list of diagnostics. Parsing should always succeed, except in the case of the stack /// overflowing. /// </summary> public static StackFrameTree?TryParse(VirtualCharSequence text) { if (text.IsDefault) { return(null); } try { var lexer = StackFrameLexer.TryCreate(text); if (!lexer.HasValue) { return(null); } return(new StackFrameParser(lexer.Value).TryParseTree()); } catch (InsufficientExecutionStackException) { return(null); } }
private StackFrameParser(StackFrameLexer lexer) { _lexer = lexer; }