/// <summary> /// Creates a USFM parser /// </summary> /// <param name="scrStylesheet"></param> /// <param name="tokens">list of tokens to parse</param> /// <param name="verseRef">initial reference for the parser</param> /// <param name="sink">optional sink to send parse events to. Null for none</param> public UsfmParser(ScrStylesheet scrStylesheet, List <UsfmToken> tokens, VerseRef verseRef, UsfmParserSink sink) { this.scrStylesheet = scrStylesheet; this.tokens = tokens; this.state = new UsfmParserState(scrStylesheet, verseRef); this.sink = sink; }
/// <summary> /// Creates a USFM parser /// </summary> /// <param name="scrStylesheet"></param> /// <param name="tokens">list of tokens to parse</param> /// <param name="state">initial state of the parser</param> /// <param name="sink">optional sink to send parse events to. Null for none</param> /// <param name="tokensPreserveWhitespace">True if the tokens were created while preserving whitespace, /// false otherwise</param> public UsfmParser(ScrStylesheet scrStylesheet, List <UsfmToken> tokens, UsfmParserState state, UsfmParserSink sink, bool tokensPreserveWhitespace = false) { this.scrStylesheet = scrStylesheet; this.tokens = tokens; this.state = state; this.sink = sink; this.tokensPreserveWhitespace = tokensPreserveWhitespace; }
/// <summary> /// Constructor for making a duplicate for looking ahead to find closing /// tokens of notes and character styles. /// </summary> UsfmParser(UsfmParser usfmParser, UsfmParserSink sink = null) { scrStylesheet = usfmParser.scrStylesheet; tokens = usfmParser.tokens; this.sink = sink; }