private void Generate() { try { HRMProgram pro = ConstructSyntaxTree(codeBox.Text); List <HRMCode> ass = Assembly(pro); List <HRMCode> opt = Optimize(ass); genBox.Text = WriteCode(opt); } catch (CompileException ce) { MessageBox.Show(ce.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception e) { MessageBox.Show(e.Message, "System Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private List <HRMCode> Assembly(HRMProgram pro) { List <HRMCode> codes = pro.Emit(); return(codes); }