コード例 #1
0
        public void testCtoXML()
        {
            ClanguageCompiler casa = new ClanguageCompiler();

            // SETUP
            string[] expectedRes = { "", "<macro> mama 5 </macro>" };

            // OPERATIONS
            casa.toXML();

            // ASSERT
            Assert.Equal(expectedRes, myResult);
        }
コード例 #2
0
        public string Compile(IOrangeLanguage lang, string code)
        {
            ClanguageCompiler cl = new ClanguageCompiler();


            // PARSING

            // CALLING IOrangeLanguage METHODS IN ORDER TO PROCESS THE CODE
            string str     = " °°";
            string pattern = @"[^\n\}].*\((([^()]+)|)\)";
            string input   = code;

            RegexOptions options = RegexOptions.Multiline;

            //str = Regex.Matches(input, pattern, options).ToString();
            foreach (Match m in Regex.Matches(input, pattern, options))
            {
                str = str + m.Value + " °° ";
            }



            bool cazzivari = false;

            while (cazzivari)
            {
                // lang.processInstruction("in a = 6;");
            }

            cl.originalCode = code;
            cl.toXML();



            return("Blue Orange Compiler at Work " + (new Random().Next(0, 100)).ToString() + "\n\n" + cl.xmlCode);
        }