예제 #1
0
        public override Node VisitUnaryMinus([NotNull] TigerParser.UnaryMinusContext context)
        {
            var node = new NegativeNode(context);

            node.Children.Add(Visit(context.expr())); // OPERAND
            return(node);
        }
예제 #2
0
        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));
        }
예제 #3
0
 /// <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);
     }
 }
예제 #4
0
 /// <summary>
 /// Called when [negative node] is visited.
 /// </summary>
 /// <param name="node">The node.</param>
 public virtual void OnNegativeNode(NegativeNode node)
 {
 }
예제 #5
0
 /// <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);
     }
 }
예제 #6
0
 /// <summary>
 /// Called when [negative node] is visited.
 /// </summary>
 /// <param name="node">The node.</param>
 public virtual void OnNegativeNode(NegativeNode node)
 {
 }