public override Node VisitUnaryMinus([NotNull] TigerParser.UnaryMinusContext context) { var node = new NegativeNode(context); node.Children.Add(Visit(context.expr())); // OPERAND return(node); }
public override Class Decide(TObj x) { if (NegativeNode == null) { throw new MLException("NegativeNode is null"); } if (PositiveNode == null) { throw new MLException("PositiveNode is null"); } return(m_Condition(x) ? PositiveNode.Decide(x) : NegativeNode.Decide(x)); }
/// <summary> /// Called when [negative node] is visited. /// </summary> /// <param name="node">The node.</param> public override void OnNegativeNode(NegativeNode node) { _sb.Append(_indentString).Append("Negative Node <------ "); node.AlphaMemory.Accept(this); _sb.Append(_indentString).AppendLine(" |"); _sb.Append(_indentString).AppendLine(" | ====== MATCHES ======"); foreach (Token item in node.Items) { item.Accept(this); } _sb.Append(_indentString).AppendLine(" |"); _sb.Append(_indentString).AppendLine(" V"); foreach (ReteNode child in node.Children) { child.Accept(this); } }
/// <summary> /// Called when [negative node] is visited. /// </summary> /// <param name="node">The node.</param> public virtual void OnNegativeNode(NegativeNode node) { }