Exemplo n.º 1
0
        public virtual void Parse(LookaheadTextReader input, ParserVisitor visitor)
        {
            ParserResults results = ParseCore(new SeekableTextReader(input));

            // Replay the results on the visitor
            visitor.Visit(results);
        }
Exemplo n.º 2
0
        public virtual void Parse(LookaheadTextReader input, ParserVisitor visitor)
        {
            var results = ParseCore(new SeekableTextReader(input));

            // Replay the results on the visitor
            visitor.Visit(results);
        }
Exemplo n.º 3
0
 public static void Visit([NotNull] this ParserVisitor self, [NotNull] ParserResults result)
 {
     result.Document.Accept(self);
     foreach (RazorError error in result.ParserErrors)
     {
         self.VisitError(error);
     }
     self.OnComplete();
 }
Exemplo n.º 4
0
 public virtual Task CreateParseTask(TextReader input,
                                     ParserVisitor consumer)
 {
     return(new Task(() =>
     {
         try
         {
             Parse(input, consumer);
         }
         catch (OperationCanceledException)
         {
             return; // Just return if we're cancelled.
         }
     }));
 }
Exemplo n.º 5
0
        public static void Visit(this ParserVisitor self, ParserResults result)
        {
            if (self == null)
            {
                throw new ArgumentNullException("self");
            }
            if (result == null)
            {
                throw new ArgumentNullException("result");
            }

            result.Document.Accept(self);
            foreach (RazorError error in result.ParserErrors)
            {
                self.VisitError(error);
            }
            self.OnComplete();
        }
Exemplo n.º 6
0
 public virtual void Parse(TextReader input, ParserVisitor visitor)
 {
     Parse(new SeekableTextReader(input), visitor);
 }
Exemplo n.º 7
0
 public virtual void Parse(TextReader input, ParserVisitor visitor)
 {
     Parse(new SeekableTextReader(input), visitor);
 }
Exemplo n.º 8
0
 public virtual Task CreateParseTask(TextReader input,
                                     ParserVisitor consumer)
 {
     return new Task(() =>
     {
         try
         {
             Parse(input, consumer);
         }
         catch (OperationCanceledException)
         {
             return; // Just return if we're cancelled.
         }
     });
 }