コード例 #1
0
        private List <CCompoundStatmentItemType> GetBlockItemTypes(CParser.BlockItemListContext itmeList)
        {
            List <CCompoundStatmentItemType> result = new List <CCompoundStatmentItemType>();

            GetBlockItemTypes(itmeList, result);
            return(result);
        }
コード例 #2
0
 private void GetBlockItemTypes(CParser.BlockItemListContext itmeList, List <CCompoundStatmentItemType> results)
 {
     if (itmeList == null)
     {
         return;
     }
     else if (itmeList.blockItemList() == null)
     {
         results.Add(itmeList.blockItem().declaration() == null ? CCompoundStatmentItemType.Statment : CCompoundStatmentItemType.Declaration);
     }
     else
     {
         GetBlockItemTypes(itmeList.blockItemList(), results);
         results.Add(itmeList.blockItem().declaration() == null ? CCompoundStatmentItemType.Statment : CCompoundStatmentItemType.Declaration);
     }
 }
コード例 #3
0
        public static Stack <CParser.BlockItemContext> RBABlockItemStack(
            this CParser.BlockItemListContext blockItemList)
        {
            var localBlockItemList = blockItemList;
            var blockItemStack
                = new Stack <CParser.BlockItemContext>();

            while (localBlockItemList.blockItemList() != null)
            {
                blockItemStack
                .Push(localBlockItemList.blockItem());

                localBlockItemList = localBlockItemList.blockItemList();
            }

            blockItemStack
            .Push(localBlockItemList.blockItem());

            return(blockItemStack);
        }