示例#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);
     }
 }
 /// <summary>
 /// Called when [negative node] is visited.
 /// </summary>
 /// <param name="node">The node.</param>
 public virtual void OnNegativeNode(NegativeNode node)
 {
 }
 /// <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)
 {
 }