public XmlTokenStateTransition(ITokenState from, ITokenState to, ITokenPatternMatch match) : base(from, to, match) { }
protected TokenStateTransition(ITokenState from, ITokenState to, ITokenPatternMatch match) { this.From = from; this.To = to; this.Match = match; }
protected TokenReaderState(ITokenState defaultState, long position, Stack <ITokenStateTransition> transitions) { position.ThrowIfNegative(); this.DefaultState = defaultState; this.Position = position; this.Transitions = transitions; }
private ITokenStateTransition?GetNextTransition(ITokenStateTransition?currentTransition, ITokenState tokenState, Stack <ITokenStateTransition> transitions, ref ReadOnlySequence <byte> buffer, ref long position) { ITokenStateTransition?previousTransition = currentTransition; if (transitions.Count > 0) { previousTransition = transitions.Peek(); } return(tokenState.GetNextTransition(previousTransition, ref buffer, ref position)); }
public bool Read(ref ITokenReaderState state, ref ReadOnlySequence <byte> buffer, out ReadOnlySequence <byte> token, out long consumedBytes) { token = new ReadOnlySequence <byte>(); consumedBytes = 0; bool messageFound = false; ITokenState tokenState = state.GetTokenState(); Stack <ITokenStateTransition> transitions = state.Transitions; long position = state.Position; ITokenStateTransition?currentTransition = null; do { currentTransition = this.GetNextTransition(currentTransition, tokenState, transitions, ref buffer, ref position); if (currentTransition is not null) { ExecutionLogProvider.Log.LogTrace(currentTransition.ToString()); tokenState = currentTransition.To; messageFound = this.HandleTransition(currentTransition, transitions, ref buffer, ref token, out consumedBytes); } }while(currentTransition is not null && messageFound == false); state = this.CreateTokenReaderState(position, transitions); return(messageFound); }
public TokenManager() { state = new ConfingToken(); }
public TokenManager(ITokenState its) { state = its; }
protected TokenReaderState(ITokenState defaultState) { this.DefaultState = defaultState; }