Example #1
0
        private void GetFunctionsButtonClickHandler(object sender, EventArgs e)
        {
            string code = txtBox_code.Text;

            CodePreprocessor.removeComments(ref code);
            string[]     words = CodePreprocessor.splitToWords(code);
            CodeAnalyzer ca    = new CodeAnalyzer(ref words);

            ca.getFunctions();
            ca.drawFunctions(flp_metodsList);
        }
        public void drawSchematic(object sender, EventArgs e)
        {
            SchemaBlock  start = new SchemaBlock("Begin", BlockTypes.Start);
            CodeAnalyzer ca    = new CodeAnalyzer(ref words);
            Dictionary <ExitTypes, List <SchemaBlock> > dic = ca.AnalyzeBlock(0, words.Length - 1, new List <SchemaBlock> {
                start
            });
            SchemaBlock end = new SchemaBlock("End", BlockTypes.Start);

            foreach (var item in dic[ExitTypes.EndofBlock])
            {
                item.links.Add(end);
            }
            foreach (var item in dic[ExitTypes.Return])
            {
                item.links.Add(end);
            }

            frm_Schema form = new frm_Schema(start);

            form.Show();
        }