示例#1
0
 public YamlStream(YamlNodeTracker tracker = null)
 {
     _streamStart = new StreamStart();
     _streamEnd   = new StreamEnd();
     _documents   = new List <YamlDocument>();
     Tracker      = tracker;
 }
示例#2
0
 public void Exit()
 {
     Streaming = false;
     Client?.Close();
     Client?.Dispose();
     Client2114?.Close();
     Client2114?.Dispose();
     Task.Run(() => StreamEnd?.Invoke());
 }
示例#3
0
        private ParsingEvent ParseDocumentStart(bool isImplicit)
        {
            if (!isImplicit)
            {
                while (this.GetCurrentToken() is DocumentEnd)
                {
                    this.Skip();
                }
            }
            if (isImplicit && (!(this.GetCurrentToken() is VersionDirective) && (!(this.GetCurrentToken() is TagDirective) && (!(this.GetCurrentToken() is DocumentStart) && !(this.GetCurrentToken() is StreamEnd)))))
            {
                TagDirectiveCollection directives = new TagDirectiveCollection();
                this.ProcessDirectives(directives);
                this.states.Push(ParserState.DocumentEnd);
                this.state = ParserState.BlockNode;
                return(new DocumentStart(null, directives, true, this.GetCurrentToken().Start, this.GetCurrentToken().End));
            }
            if (this.GetCurrentToken() is StreamEnd)
            {
                this.state = ParserState.StreamEnd;
                ParsingEvent event3 = new StreamEnd(this.GetCurrentToken().Start, this.GetCurrentToken().End);
                if (this.scanner.MoveNextWithoutConsuming())
                {
                    throw new InvalidOperationException("The scanner should contain no more tokens.");
                }
                return(event3);
            }
            Mark start = this.GetCurrentToken().Start;
            TagDirectiveCollection tags    = new TagDirectiveCollection();
            VersionDirective       version = this.ProcessDirectives(tags);
            Token currentToken             = this.GetCurrentToken();

            if (!(currentToken is DocumentStart))
            {
                throw new SemanticErrorException(currentToken.Start, currentToken.End, "Did not find expected <document start>.");
            }
            this.states.Push(ParserState.DocumentEnd);
            this.state = ParserState.DocumentContent;
            ParsingEvent event2 = new DocumentStart(version, tags, false, start, currentToken.End);

            this.Skip();
            return(event2);
        }
示例#4
0
        YamlStream(StreamStart streamStart, StreamEnd streamEnd, List <YamlDocument> documents, YamlNodeTracker tracker = null)
        {
            Tracker = tracker;

            this._streamStart = streamStart;
            this._streamEnd   = streamEnd;

            if (Tracker == null)
            {
                _documents = documents;
            }
            else
            {
                _documents = new List <YamlDocument>();
                foreach (var document in documents)
                {
                    Add(document);
                }
            }
        }
示例#5
0
 void IParsingEventVisitor.Visit(StreamEnd e)
 {
     throw new NotSupportedException();
 }
示例#6
0
 public void Visit(StreamEnd e)
 {
 }
 public void Visit(StreamEnd e)
 {
     _emitter.Emit(e);
 }
示例#8
0
 void IXAudio2VoiceCallback.OnStreamEnd()
 {
     StreamEnd?.Invoke(this, EventArgs.Empty);
 }