Ejemplo n.º 1
0
        public CStatment GetDefinitionStatment()
        {
            CStatment.BeginCompoundStatement();

            int stats = 0;

            foreach (CIdentifier ident in idents)
            {
                if (ident.Init != null)
                {
                    CStatment.PushStatement(ident.GetDefinitionStatment());
                    stats++;
                }
            }

            List <CCompoundStatmentItemType> items = new List <CCompoundStatmentItemType>();

            for (int i = 0; i < stats; i++)
            {
                items.Add(CCompoundStatmentItemType.Statment);
            }

            CStatment.EndCompoundStatement(items);

            return(CStatment.PopStatement());
        }
Ejemplo n.º 2
0
 public override void ExitCompoundStatement(CParser.CompoundStatementContext context)
 {
     //'{' blockItemList? '}'
     SafeCall(context, () => CStatment.EndCompoundStatement(GetBlockItemTypes(context.blockItemList())));
 }