public IState Process(char @char) { IState next = null; switch (@char) { case '<': next = new GarbageState(Context.Push(this)); break; case '}': Context.GroupCount += Context.GetGroupScore() + 1; next = Context.Pop(); break; case '{': next = new GroupState(Context.Push(this)); break; default: next = this; break; } return(next); }
public IState Process(char @char) { IState next = null; switch (@char) { case '{': next = new GroupState(Context.Push(this)); break; case '<': next = new GarbageState(Context.Push(this)); break; default: next = this; break; } return(next); }