public CloneableStack <T> Clone() { CloneableStack <T> result = new CloneableStack <T> (); result.count = count; result.top = top; return(result); }
public static void ScanSpans(TextDocument doc, SyntaxMode mode, Rule rule, CloneableStack <Span> spanStack, int start, int end) { if (mode == null) { return; } SyntaxMode.SpanParser parser = mode.CreateSpanParser(null, spanStack); parser.ParseSpans(start, end - start); }
public SpanParser(Document doc, SyntaxMode mode, CloneableStack <Span> spanStack) { if (doc == null) { throw new ArgumentNullException("doc"); } this.doc = doc; this.mode = mode; this.SpanStack = spanStack; this.CurRule = mode; this.ruleStack = CreateRuleStack(); this.CurRule = ruleStack.Peek(); this.CurSpan = spanStack.Count > 0 ? spanStack.Peek() : null; FoundSpanBegin = DefaultFoundSpanBegin; FoundSpanEnd = DefaultFoundSpanEnd; FoundSpanExit = DefaultFoundSpanEnd; ParseChar = delegate(ref int i, char ch) {}; }
public SpanParser(SyntaxMode mode, CloneableStack <Span> spanStack) { if (mode == null) { throw new ArgumentNullException("mode"); } this.doc = mode.Document; if (this.doc == null) { throw new ArgumentException("Syntax mode isn't bound to any document.", "mode"); } this.mode = mode; this.SpanStack = spanStack; this.CurRule = mode; this.ruleStack = CreateRuleStack(); this.CurRule = ruleStack.Peek(); this.CurSpan = spanStack.Count > 0 ? spanStack.Peek() : null; FoundSpanBegin = DefaultFoundSpanBegin; FoundSpanEnd = DefaultFoundSpanEnd; FoundSpanExit = DefaultFoundSpanEnd; ParseChar = delegate(ref int i, char ch) {}; }
public virtual SpanParser CreateSpanParser(DocumentLine line, CloneableStack <Span> spanStack) { return(new SpanParser(this, spanStack ?? line.StartSpan.Clone())); }
public override SpanParser CreateSpanParser(DocumentLine line, CloneableStack <Span> spanStack) { return(new JaySpanParser(this, spanStack ?? line.StartSpan.Clone())); }
public JaySpanParser(SyntaxMode mode, CloneableStack <Span> spanStack) : base(mode, spanStack) { }
public virtual SpanParser CreateSpanParser(Document doc, SyntaxMode mode, LineSegment line, CloneableStack <Span> spanStack) { return(new SpanParser(doc, mode, spanStack ?? line.StartSpan.Clone())); }
public static void ScanSpans(Document doc, SyntaxMode mode, Rule rule, CloneableStack <Span> spanStack, int start, int end) { SyntaxMode.SpanParser parser = mode.CreateSpanParser(doc, mode, null, spanStack); parser.ParseSpans(start, end - start); }
public JaySpanParser(Document doc, SyntaxMode mode, CloneableStack <Span> spanStack) : base(doc, mode, spanStack) { }
public bool Equals(CloneableStack <T> other) { return(ReferenceEquals(top, other.top)); }