classdef LetStatments < handle
    %LETSTATMENTS Summary of this class goes here
    %   Detailed explanation goes here
    
    properties(Access = private)
        statements = {}
    end
    
    methods
        function object = LetStatments()
        end
        
        function count = size(object)
            count = size(object.statements, 2);
        end
        
        function [name, assignment] = get_statement(object, index)
            name = object.statements{index}.name;
            assignment = object.statements{index}.assignment;
        end
        
        function insert_space(object)
            p = struct();
            p.name = '';
            p.assignment = '';
            object.statements(size(object.statements, 2)+1) = {p};
            
            notify(object, 'StructureChanged');
        end
        
        function delete_end(object)
            object.statements(size(object.statements, 2)) = [];
            
            notify(object, 'StructureChanged');
        end
        
        function set_statement_name(object, index, name)
            object.statements{index}.name = name;
        end
        
        function set_statement_assignment(object, index, assignment)
            object.statements{index}.assignment = assignment;
        end
    end
    
    events
        StructureChanged
    end
    
end

