private Node SetState(CursorState state, string word) { Node node = null; if (state != currentState) { if (state == CursorState.FieldName) { node = new FieldNode(word); } if (state == CursorState.Condition) { node = new ConditionNode(word); } if (state == CursorState.Parameter) { node = new ParameterNode(word); } if (state == CursorState.Constant) { node = new ConstantNode(word); } if (state == CursorState.ArrayOfValues) { node = new ArrayOfValues(word); } if (state == CursorState.OpenBracket) { node = new OpenBracketNode(); } if (state == CursorState.CloseBracket) { node = new CloseBracketNode(); } if (state == CursorState.Operator) { node = new OperatorNode(word); } if (node != null) nodes.Add(node); currentState = state; } return node; }
private void WriterStartGroup(OperatorNode operatorNode, XmlWriter writer) { writer.WriteStartElement("Group"); writer.WriteAttributeString("GroupOperator", operatorNode.Operator.ToString()); }