/// <summary> /// Create a copy of an assignment command including its LHS value access and its RHS expression /// </summary> /// <param name="command"></param> /// <returns></returns> public static CommandAssign Duplicate(this CommandAssign command) { return(new CommandAssign( command.ParentScope, command.LhsValueAccess.Duplicate(), Duplicate(command.RhsExpression) )); }
/// <summary> /// Visit a high-level assignment command to convert into one or more low-level assignment commands /// </summary> /// <param name="command">Th high-level assignment command to be processed</param> /// <returns>Null</returns> public override ILanguageValue Visit(CommandAssign command) { //Process the RHS expression into a suitable language value var rhsValue = command.RhsExpression.AcceptVisitor(this); //Update all low-level variables related to the LHS of the assignment using the processed RHS value WriteToLhsVariables(command.LhsValueAccess, rhsValue); return(null); }
/// <summary> /// Execute an assignment command /// </summary> /// <param name="command"></param> /// <returns></returns> public override ILanguageValue Visit(CommandAssign command) { var rhsValue = command.RhsExpression.AcceptVisitor(this); //TODO: Is it necessary to make a copy of the RHS value in all cases? UpdateSymbolValue(command.LhsValueAccess, rhsValue.DuplicateValue(true)); return(null); }
public void Visit(CommandAssign command) { //_CompiledBlock.AddCommand_Comment(command.ToString()); var compiledLhsValue = CompileLhsValueAccess(command.LhsValueAccess); var compiledRhsExpr = CompileExpression(command.RhsExpression); _compiledBlock.AddCommand_Assign(compiledLhsValue, compiledRhsExpr); }
public TreeNode Visit(CommandAssign command) { var node = new TreeNode("<ASSIGN> " + command.LhsValueAccess.GetName()) { Tag = command }; node.Nodes.Add(command.RhsExpression.AcceptVisitor(this)); return(node); }
public void Visit(CommandAssign command) { Log.AppendAtNewLine("let "); command.LhsValueAccess.AcceptVisitor(this); Log.Append(" : "); Log.Append(command.LhsValueAccess.ExpressionType.TypeSignature); Log.Append(" = "); command.RhsExpression.AcceptVisitor(this); Log.AppendAtNewLine(); }
internal AstCommandLet(CommandAssign command) { AssociatedCommandLet = command; }
public HlCommandInfo(int statementId, CommandAssign command) { CommandInfoId = statementId; AssociatedCommand = command; }
/// <summary> /// Execute the given command without returning any value /// </summary> /// <param name="command"></param> /// <returns>Should return null</returns> public abstract ILanguageValue Visit(CommandAssign command);
internal static AstCommandLet ToAstCommandLet(this CommandAssign command) { return(new AstCommandLet(command)); }