Пример #1
0
        public static void RAW(string code)
        {
            var block = BlockContext.GetBlockOrThrow();

            block.AppendStatement(new RawCodeStatement {
                Code = code
            });
        }
Пример #2
0
        public FluentIf(AbstractExpression condition)
        {
            var block = BlockContext.GetBlockOrThrow();

            _statement = new IfStatement {
                Condition = block.PopExpression(condition),
                ThenBlock = null,
                ElseBlock = null
            };

            block.AppendStatement(_statement);
        }
Пример #3
0
        public static void LOCAL(TypeMember type, string name, out LocalVariable @ref, AbstractExpression initialValue = null)
        {
            @ref = new LocalVariable {
                Name = name,
                Type = type
            };

            var block = BlockContext.GetBlockOrThrow();

            block.AddLocal(@ref);
            block.AppendStatement(new VariableDeclarationStatement {
                Variable     = @ref,
                InitialValue = PopExpression(initialValue)
            });
        }
Пример #4
0
 public void RETURN(AbstractExpression value)
 => BlockContext.Append(new ReturnStatement {
     Expression = BlockContext.Pop(value)
 });