private List <CCompoundStatmentItemType> GetBlockItemTypes(CParser.BlockItemListContext itmeList) { List <CCompoundStatmentItemType> result = new List <CCompoundStatmentItemType>(); GetBlockItemTypes(itmeList, result); return(result); }
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); } }
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); }