Ejemplo n.º 1
0
        private void BuildBtn_Click(object sender, EventArgs e)
        {
            if (Filename == "")
            {
                MessageBox.Show("You must save your source file before you can compile your program", "JasC Compiler Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
            }
            else
            {
                SourceEdit.SaveFile(Filename, RichTextBoxStreamType.PlainText);

                PicCompiler = new CCompiler(Filename, "keywords.xml",
                                            "SpecialRegisters.xml",
                                                PIC_PROCESSOR.PIC16F84);

                try
                {
                    StatusEdit.AppendText("Building Application ...\n");
                    if (PicCompiler.Build() == true)
                        StatusEdit.AppendText("Build complete 0 Error(s)\n");

                    StatusEdit.AppendText("\n\n");
                    PicCompiler.OuputGeneratedFiles(true);
                }
                catch (CCompilerException Ex)
                {
                    StatusEdit.AppendText("Build Failed!!\n");
                    StatusEdit.AppendText(Ex.Message + " on line " + Ex.LineNumber);
                    StatusEdit.AppendText("\n========================================\n\n");
                }
            }
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            var tokens   = TokenTest.GetTestTokens();
            var compiler = new CCompiler(tokens);

            compiler.Compile();

            var compTokens = compiler.GetCompilerTokens();
            var ding       = true;
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            CCompiler Compiler = new CCompiler("Example.jasc", "keywords.xml", "SpecialRegisters.xml", PIC_PROCESSOR.PIC16F84);

             try
             {
                 if (Compiler.Build() == true)
                 {
                     Console.WriteLine("0 Error(s)");
                     Compiler.OuputGeneratedFiles(true);
                 }
             }
             catch (CCompilerException Error)
             {
                 Console.WriteLine(Error.Message + " on line " + Error.LineNumber);
             }
        }