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(); }
public VCondStatement(string condType, ICondStatement condStatement) : this(condType) { foreach (var statement in condStatement.statements) { AddExpression(VElementBuilder.Create(statement)); } SetCondElement(VElementBuilder.Create(condStatement.condition)); UpdateSize(); }
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); } }
public VSetVariable(ISetVariableStatement setVarStatement) : this() { SetVariableRef(VElementBuilder.Create(setVarStatement.variableRef)); SetExpression(VElementBuilder.Create(setVarStatement.expression)); UpdateSize(); }
public VReturnStatement(IReturnStatement returnStatement) : this() { SetRetExpression(VElementBuilder.Create(returnStatement.expression)); UpdateSize(); }