private void extruseUntilExclusively(String lastSign) { StackElement innerElement = null; if (stack.Count > 1) { innerElement = stack[stack.Count - 1]; } else { return; } while (stack.Count > 1 && !innerElement.Value.Equals(lastSign)) { if (!isHiddenSymbol(innerElement.Value)) { Result.Add(innerElement.Value); } stack.RemoveAt(stack.Count - 1); if (stack.Count > 0) { innerElement = stack[stack.Count - 1]; } } }
private void extruseAll() { while (stack.Count > 0) { StackElement el = stack[stack.Count - 1]; if (!isHiddenSymbol(el.Value)) { Result.Add(el.Value); } stack.RemoveAt(stack.Count - 1); } }
private void extruseUntil(String lastSign) { StackElement innerElement = stack[stack.Count - 1]; while (stack.Count > 1 && !innerElement.Value.Equals(lastSign)) { if (!isHiddenSymbol(innerElement.Value)) { Result.Add(innerElement.Value); } stack.RemoveAt(stack.Count - 1); if (stack.Count > 0) { innerElement = stack[stack.Count - 1]; } } if (!isHiddenSymbol(innerElement.Value)) { Result.Add(innerElement.Value); } stack.RemoveAt(stack.Count - 1); }
private void extruse() { if (stack.Count > 1) { StackElement lastElement = stack[stack.Count - 1]; StackElement innerElement = stack[stack.Count - 2]; while (innerElement.StackPriority >= lastElement.Priority) { if (!isHiddenSymbol(innerElement.Value)) { Result.Add(innerElement.Value); } stack.RemoveAt(stack.Count - 2); if (stack.Count > 1) { innerElement = stack[stack.Count - 2]; } else { break; } } } }