Ejemplo n.º 1
0
        public override Node VisitUnaryMinus([NotNull] TigerParser.UnaryMinusContext context)
        {
            var node = new NegativeNode(context);

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