コード例 #1
0
 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);
     }
 }
コード例 #2
0
        private List <HRMCode> Assembly(HRMProgram pro)
        {
            List <HRMCode> codes = pro.Emit();

            return(codes);
        }