internal static void SetModifiers(AstNode node, Modifiers newValue)
        {
            Modifiers oldValue     = GetModifiers(node);
            AstNode   insertionPos = node.GetChildrenByRole(AttributeRole).LastOrDefault();

            foreach (Modifiers m in CppModifierToken.AllModifiers)
            {
                if ((m & newValue) != 0)
                {
                    if ((m & oldValue) == 0)
                    {
                        // Modifier was added
                        var newToken = new CppModifierToken(TextLocation.Empty, m);
                        node.InsertChildAfter(insertionPos, newToken, ModifierRole);
                        insertionPos = newToken;
                    }
                    else
                    {
                        // Modifier already exists
                        insertionPos = node.GetChildrenByRole(ModifierRole).First(t => t.Modifier == m);
                    }
                }
                else
                {
                    if ((m & oldValue) != 0)
                    {
                        // Modifier was removed
                        node.GetChildrenByRole(ModifierRole).First(t => t.Modifier == m).Remove();
                    }
                }
            }
        }
        internal static Modifiers GetModifiers(AstNode node)
        {
            Modifiers m = 0;

            foreach (CppModifierToken t in node.GetChildrenByRole(ModifierRole))
            {
                m |= t.Modifier;
            }
            return(m);
        }