예제 #1
0
 internal SyntaxNodeOrToken(SyntaxNode parent, InternalSyntax.GreenNode token, int position, int index)
 {
     _position     = position;
     _tokenIndex   = index;
     _nodeOrParent = parent;
     _token        = token;
 }
예제 #2
0
파일: SyntaxToken.cs 프로젝트: drcjt/Sloth
 internal SyntaxToken(SyntaxNode parent, InternalSyntax.GreenNode token, int position, int index)
 {
     Parent   = parent;
     Node     = token;
     Position = position;
     Index    = index;
 }
예제 #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);
        }
예제 #4
0
 internal SyntaxNode(InternalSyntax.GreenNode internalNode, RedNode parent, int position) : base(internalNode, parent, position)
 {
 }
예제 #5
0
파일: RedNode.cs 프로젝트: drcjt/Sloth
 internal RedNode(InternalSyntax.GreenNode greenNode, RedNode parent, int position)
 {
     GreenNode = greenNode;
     _parent   = parent;
     Position  = position;
 }
예제 #6
0
 private static int Occupancy(InternalSyntax.GreenNode green)
 {
     return(green.IsList ? green.SlotCount : 1);
 }