Beispiel #1
0
        /// <summary>
        /// Parses the specified stream.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <returns></returns>
        public Stylesheet Parse(Stream stream)
        {
            Errors.Clear();

            var builder = new StringBuilder();
            var errorStream = new StringWriter(builder);
            var scanner = new Scanner(stream);
            var parser = new Parser(scanner)
            {
                errors =
                {
                    errorStream = errorStream
                }
            };

            parser.Parse();
            Stylesheet = parser.Stylesheet;
            SpitErrors(builder);
            return Stylesheet;
        }
Beispiel #2
0
 /*-----------------------------------------------------------------------
                     SCANNER DESCRIPTION
 ------------------------------------------------------------------------*/
 public Parser(Scanner scanner)
 {
     this.scanner = scanner;
     errors = new Errors();
 }