Exemplo n.º 1
0
        /// <summary>
        /// Constructs a new <see cref="TerminalReader"/> which can recoganize the specified <see cref="IGrammar"/>.
        /// </summary>
        /// <param name="grammar">The <see cref="IGrammar"/> to be recognized by the <see cref="TerminalReader"/>.</param>
        /// <returns>A <see cref="TerminalReaderGeneratorResult"/> containing <see cref="TerminalReader"/> and information pertaining to the
        /// success or failure of the generation process.
        /// </returns>
        public TerminalReaderGeneratorResult GenerateTerminalReader(IGrammar grammar)
        {
            ITerminalReader terminalReader = new TerminalReader(grammar.GetTerminals(), grammar.StopTerminal);

            var result = new TerminalReaderGeneratorResult(terminalReader);
            return result;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs a new <see cref="TerminalReader"/> which can recoganize the specified <see cref="IGrammar"/>.
        /// </summary>
        /// <param name="grammar">The <see cref="IGrammar"/> to be recognized by the <see cref="TerminalReader"/>.</param>
        /// <returns>A <see cref="TerminalReaderGeneratorResult"/> containing <see cref="TerminalReader"/> and information pertaining to the
        /// success or failure of the generation process.
        /// </returns>
        public TerminalReaderGeneratorResult GenerateTerminalReader(IGrammar grammar)
        {
            ITerminalReader terminalReader = new TerminalReader(grammar.GetTerminals(), grammar.StopTerminal);

            TerminalReaderGeneratorResult result = new TerminalReaderGeneratorResult(terminalReader);

            return(result);
        }