本文整理汇总了C#中GreenNode类的典型用法代码示例。如果您正苦于以下问题:C# GreenNode类的具体用法?C# GreenNode怎么用?C# GreenNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GreenNode类属于命名空间,在下文中一共展示了GreenNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResetPoint
internal ResetPoint(int resetCount, LexerMode mode, int position, GreenNode prevTokenTrailingTrivia)
{
this.ResetCount = resetCount;
this.Mode = mode;
this.Position = position;
this.PrevTokenTrailingTrivia = prevTokenTrailingTrivia;
}
示例2: AreTokensEquivalent
private static bool AreTokensEquivalent(GreenNode before, GreenNode after)
{
// NOTE(cyrusn): Do we want to drill into trivia? Can documentation ever affect the
// global meaning of symbols? This can happen in java with things like the "@obsolete"
// clause in doc comment. However, i don't know if anything like that exists in C#.
// NOTE(cyrusn): I don't believe we need to examine pp directives. We actually want to
// intentionally ignore them as we're only paying attention to the trees that affect
// symbolic information.
// NOTE(cyrusn): I don't believe we need to examine skipped text. It isn't relevant from
// the perspective of global symbolic information.
Debug.Assert(before.RawKind == after.RawKind);
if (before.IsMissing != after.IsMissing)
{
return false;
}
// These are the tokens that don't have fixed text.
switch ((SyntaxKind)before.RawKind)
{
case SyntaxKind.IdentifierToken:
return ((Green.SyntaxToken)before).ValueText == ((Green.SyntaxToken)after).ValueText;
case SyntaxKind.NumericLiteralToken:
case SyntaxKind.CharacterLiteralToken:
case SyntaxKind.StringLiteralToken:
case SyntaxKind.InterpolatedStringTextToken:
return ((Green.SyntaxToken)before).Text == ((Green.SyntaxToken)after).Text;
}
return true;
}
示例3: Enumerator
internal Enumerator(GreenNode node)
{
this.node = node;
this.childIndex = -1;
this.listIndex = -1;
this.list = null;
this.currentChild = null;
}
示例4: WithTwoChildren
internal WithTwoChildren(GreenNode child0, GreenNode child1)
{
this.SlotCount = 2;
this.AdjustFlagsAndWidth(child0);
_child0 = child0;
this.AdjustFlagsAndWidth(child1);
_child1 = child1;
}
示例5: NoteGreen
internal static void NoteGreen(GreenNode node)
{
Interlocked.Increment(ref stats.greenNodes);
if (node.IsToken)
{
Interlocked.Increment(ref stats.greenTokens);
}
}
示例6: Enumerator
internal Enumerator(GreenNode node)
{
_node = node;
_childIndex = -1;
_listIndex = -1;
_list = null;
_currentChild = null;
}
示例7: SyntaxIdentifierWithTrailingTrivia
internal SyntaxIdentifierWithTrailingTrivia(string text, GreenNode trailing, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations)
: base(text, diagnostics, annotations)
{
if (trailing != null)
{
this.AdjustFlagsAndWidth(trailing);
_trailing = trailing;
}
}
示例8: Add
internal void Add(GreenNode item)
{
if (_nodes == null || _count >= _nodes.Length)
{
this.Grow(_count == 0 ? 8 : _nodes.Length * 2);
}
_nodes[_count++] = item;
}
示例9: WithThreeChildren
internal WithThreeChildren(GreenNode child0, GreenNode child1, GreenNode child2)
{
this.SlotCount = 3;
this.AdjustFlagsAndWidth(child0);
_child0 = child0;
this.AdjustFlagsAndWidth(child1);
_child1 = child1;
this.AdjustFlagsAndWidth(child2);
_child2 = child2;
}
示例10: Enumerator
internal Enumerator(GreenNode node)
{
_current = null;
_stack = null;
_count = 0;
if (node != null && node.ContainsDiagnostics)
{
_stack = new NodeIteration[8];
this.PushNodeOrToken(node);
}
}
示例11: SyntaxTokenWithTrivia
internal SyntaxTokenWithTrivia(SyntaxKind kind, GreenNode leading, GreenNode trailing)
: base(kind)
{
if (leading != null)
{
this.AdjustFlagsAndWidth(leading);
this.LeadingField = leading;
}
if (trailing != null)
{
this.AdjustFlagsAndWidth(trailing);
this.TrailingField = trailing;
}
}
示例12: SyntaxTreeDiagnosticEnumerator
internal SyntaxTreeDiagnosticEnumerator(SyntaxTree syntaxTree, GreenNode node, int position)
{
this.syntaxTree = null;
this.current = null;
this.position = position;
if (node != null && node.ContainsDiagnostics)
{
this.syntaxTree = syntaxTree;
this.stack = new NodeIterationStack(DefaultStackCapacity);
this.stack.PushNodeOrToken(node);
}
else
{
this.stack = new NodeIterationStack();
}
}
示例13: Enumerator
internal Enumerator(GreenNode node)
{
if (node != null)
{
this.node = node;
this.childIndex = node.SlotCount;
this.listIndex = -1;
}
else
{
this.node = null;
this.childIndex = 0;
this.listIndex = -1;
}
this.list = null;
this.currentChild = null;
}
示例14: Enumerator
internal Enumerator(GreenNode node)
{
if (node != null)
{
_node = node;
_childIndex = node.SlotCount;
_listIndex = -1;
}
else
{
_node = null;
_childIndex = 0;
_listIndex = -1;
}
_list = null;
_currentChild = null;
}
示例15: SyntaxIdentifierWithTrivia
internal SyntaxIdentifierWithTrivia(
SyntaxKind contextualKind,
string text,
string valueText,
GreenNode leading,
GreenNode trailing)
: base(contextualKind, text, valueText)
{
if (leading != null)
{
this.AdjustFlagsAndWidth(leading);
_leading = leading;
}
if (trailing != null)
{
this.AdjustFlagsAndWidth(trailing);
_trailing = trailing;
}
}