예제 #1
0
파일: VBinaryOp.cs 프로젝트: PShuvaev/vpl
 public VBinaryOp(IFunctionCall functionCall) : this(functionCall.function)
 {
     firstArg = VElementBuilder.Create(functionCall.arguments.FirstOrDefault());
     SetFirstArg(firstArg);
     secondArg = VElementBuilder.Create(functionCall.arguments.Skip(1).FirstOrDefault());
     SetSecondArg(secondArg);
     UpdateSize();
 }
예제 #2
0
        public VCondStatement(string condType, ICondStatement condStatement) : this(condType)
        {
            foreach (var statement in condStatement.statements)
            {
                AddExpression(VElementBuilder.Create(statement));
            }

            SetCondElement(VElementBuilder.Create(condStatement.condition));
            UpdateSize();
        }
예제 #3
0
        public VFunction(IFunctionDefinition funDef) : this(funDef.name)
        {
            foreach (var arg in funDef.arguments)
            {
                AddArgument(arg.varName);
            }
            foreach (var v in funDef.variables)
            {
                AddVariable(v.varName);
            }
            foreach (var statement in funDef.statements)
            {
                var velement = VElementBuilder.Create(statement);
                AddExpression(velement);
            }

            var sourceVariables = vvariables.Concat(varguments).ToList();

            foreach (var @ref in refs)
            {
                var variable = sourceVariables.FirstOrDefault(x => x.varName == @ref.markInitVarName);
                variable.AttachVarRef(@ref);
            }
        }
예제 #4
0
 public VSetVariable(ISetVariableStatement setVarStatement) : this()
 {
     SetVariableRef(VElementBuilder.Create(setVarStatement.variableRef));
     SetExpression(VElementBuilder.Create(setVarStatement.expression));
     UpdateSize();
 }
예제 #5
0
 public VReturnStatement(IReturnStatement returnStatement) : this()
 {
     SetRetExpression(VElementBuilder.Create(returnStatement.expression));
     UpdateSize();
 }