Exemplo n.º 1
0
        public override void Interpret()
        {
            var condition = Conditional.Interpret();

            while (((BoolValue)condition).Value)
            {
                foreach (var statementNode in StatementList)
                {
                    statementNode.Interpret();
                }
            }
        }
Exemplo n.º 2
0
        public override void Interpret()
        {
            var condition = (BoolValue)Conditional.Interpret();

            if (condition.Value)
            {
                foreach (var statementNode in StatementListTrue)
                {
                    statementNode.Interpret();
                }
            }
            else
            {
                if (StatementListFalse != null)
                {
                    foreach (var statementNode in StatementListFalse)
                    {
                        statementNode.Interpret();
                    }
                }
            }
        }