Beispiel #1
0
 internal SyntaxNodeOrToken(SyntaxNode parent, InternalSyntax.GreenNode token, int position, int index)
 {
     _position     = position;
     _tokenIndex   = index;
     _nodeOrParent = parent;
     _token        = token;
 }
Beispiel #2
0
 internal SyntaxToken(SyntaxNode parent, InternalSyntax.GreenNode token, int position, int index)
 {
     Parent   = parent;
     Node     = token;
     Position = position;
     Index    = index;
 }
Beispiel #3
0
        internal static int CountNodes(InternalSyntax.GreenNode green)
        {
            var n = 0;
            var s = green.SlotCount;

            for (int i = 0; i < s; i++)
            {
                var child = green.GetSlot(i);
                if (child != null)
                {
                    if (!child.IsList)
                    {
                        n++;
                    }
                    else
                    {
                        n += child.SlotCount;
                    }
                }
            }

            return(n);
        }
Beispiel #4
0
 internal SyntaxNode(InternalSyntax.GreenNode internalNode, RedNode parent, int position) : base(internalNode, parent, position)
 {
 }
Beispiel #5
0
 internal RedNode(InternalSyntax.GreenNode greenNode, RedNode parent, int position)
 {
     GreenNode = greenNode;
     _parent   = parent;
     Position  = position;
 }
Beispiel #6
0
 private static int Occupancy(InternalSyntax.GreenNode green)
 {
     return(green.IsList ? green.SlotCount : 1);
 }