コード例 #1
0
 /// <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)
                ));
 }
コード例 #2
0
ファイル: LlGenerator.cs プロジェクト: cloudRoutine/GMac
        /// <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);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public TreeNode Visit(CommandAssign command)
        {
            var node = new TreeNode("<ASSIGN> " + command.LhsValueAccess.GetName())
            {
                Tag = command
            };

            node.Nodes.Add(command.RhsExpression.AcceptVisitor(this));

            return(node);
        }
コード例 #6
0
        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();
        }
コード例 #7
0
ファイル: AstCommandLet.cs プロジェクト: phreed/GMac
 internal AstCommandLet(CommandAssign command)
 {
     AssociatedCommandLet = command;
 }
コード例 #8
0
 public HlCommandInfo(int statementId, CommandAssign command)
 {
     CommandInfoId     = statementId;
     AssociatedCommand = command;
 }
コード例 #9
0
 /// <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);
コード例 #10
0
 internal static AstCommandLet ToAstCommandLet(this CommandAssign command)
 {
     return(new AstCommandLet(command));
 }