Esempio n. 1
0
        private void _addButton_Click(object sender, EventArgs e)
        {
            var expression = new AssignmentExpression(new VariableExpression("?"), new LiteralExpression("[[?]]?"));

            var oldIndex = SelectedLineIndex;
            var head = _root.Children.Take(oldIndex + 1);
            var @new = new ExpressionStatement(expression);
            var tail = _root.Children.Skip(oldIndex + 1);
            var newchi = head.Concat(@new.AsArray()).Concat(tail).Cast<Statement>();

            _root = (Block)_root.ReplaceMeWith(() => new Block(newchi));
            RebuildTopPanelContent();
            SelectedLineIndex = oldIndex + 1;
        }
Esempio n. 2
0
        private IEnumerable<ElfVmInstruction> CompileAssignment(AssignmentExpression ae)
        {
            foreach(var evi in Compile(ae.Expression))
                yield return evi;

            yield return new Dup();
            yield return new PopRef(ae.Target.Name);
        }