protected override void OnRegistration(StackEx<SpanSyntaxNode> stack) { if (stack.Count > 1) { var neighbor = stack.TopNode.Next; int whitespace_count = 0; while (neighbor.Value is PartialWhitespaceExpression.WhitespaceExpression && neighbor.Next != null) { whitespace_count++; neighbor = neighbor.Next; } if (neighbor != null && (exp = neighbor.Value as TerminalSpan) != null) { parentStack.Pop (); for (var i = 0; i < whitespace_count; i++) parentStack.Pop (); neighbor.Value = this; } } }
protected override void OnRegistration(StackEx<SpanSyntaxNode> stack) { var neighbor = GetNeighbor (); if (neighbor != null) { var non_wp = neighbor.GetImmediatelyNearestNonWhitesSpace (); if (non_wp != null) { var attr = non_wp.GetAttribute<AcceptsAnchor> (); if (attr != null) { parentStack.Pop (); if (neighbor is PartialWhitespaceExpression.WhitespaceExpression) parentStack.Pop (); attr.IgnoreOpenInNewWindw = true; attr.Apply ("mailto:" + EscapeChars(email)); } } } }
//public HyperLinkExpression(HyperLinkReference href, string text = null, string title = null) // : this (href.ToString (), text, title) //{ //} //public HyperLinkExpression(string href, string text = null, string title = null) //{ // this.href = href; // this.text = text; // this.title = title; //} protected override void OnRegistration(StackEx<SpanSyntaxNode> stack) { if (node != null) { var neighbor = GetNeighbor (); if (neighbor != null) { var non_whitespace = neighbor.GetImmediatelyNearestNonWhitesSpace (); if (non_whitespace != null) { var accept_href = non_whitespace.GetAttribute<AcceptsAnchor> (); if (accept_href != null) { stack.Pop (); if (neighbor is PartialWhitespaceExpression.WhitespaceExpression) stack.Pop (); accept_href.Apply (_href, titleText: title); } } } } }
public GoalStack(IntObjective intObjective) { m_StackAndState = new StackEx <StackEx <Goal> >(); m_StackAnd = new StackEx <Goal>(); m_StackOr = new StackEx <GoalOr>(); m_IntObjective = intObjective; m_IsExecuting = false; m_Stop = false; m_StackAndMax = 0; m_StackOrMax = 0; m_StackOrCount = 0; m_IsFailed = false; m_CountFail = 0; }
static bool GoodState(StackEx<SpanSyntaxNode> stack) { var top = stack.TopNode; while (top != null) { if(top.Value == null) return false; top = top.Next; } return true; }
protected override void OnRegistration(StackEx<SpanSyntaxNode> stack) { if (parentStack.Count > 1) { var neighbor = parentStack.TopNode.Next; while (neighbor.Value is PartialWhitespaceExpression.WhitespaceExpression && neighbor.Next != null) neighbor = neighbor.Next; if (neighbor != null && neighbor.Value != null) { parentStack.Pop (); exp = neighbor.Value as TerminalSpan; neighbor.Value = this; } } }
protected override void OnRegistration(StackEx<SpanSyntaxNode> stack) { if(stack.Count == 1) is_first = true; }
protected override void OnRegistration(StackEx<SyntaxNode> stack) { var neighbor = stack.TopNode.Next; if (neighbor != null) { var acceptsParagraph = neighbor.Value.GetAttribute<AcceptsParagraph> (); if (acceptsParagraph != null) { parentStack.Pop (); parentStack.Push (acceptsParagraph.Accept (this)); } } }
internal void Push() { m_StackAndState.Push(m_StackAnd); m_StackAnd = new StackEx <Goal>(m_StackAnd); }
public static void Main(string[] args) { QueueEx.Test(); StackEx.Test(); Console.ReadKey(); }
public GoalStack( IntObjective intObjective ) { m_StackAndState = new StackEx<StackEx<Goal>>(); m_StackAnd = new StackEx<Goal>(); m_StackOr = new StackEx<GoalOr>(); m_IntObjective = intObjective; m_IsExecuting = false; m_Stop = false; m_StackAndMax = 0; m_StackOrMax = 0; m_StackOrCount = 0; m_IsFailed = false; m_CountFail = 0; }
internal void Push() { m_StackAndState.Push( m_StackAnd ); m_StackAnd = new StackEx<Goal>( m_StackAnd ); }
internal void Pop() { m_StackAnd = m_StackAndState.Pop(); }
protected override void OnRegistration(StackEx<SyntaxNode> stack) { if (stack.Count > 1) { var completeColumn = stack.TopNode.Next.Value as CompleteColumn; if (completeColumn != null) { parentStack.Pop (); parentStack.Pop (); parentStack.Push (new MultiColumn (completeColumn, this)); return; } var multi = stack.TopNode.Next.Value as MultiColumn; if (multi != null) { parentStack.Pop (); multi.Add (this); return; } } }