Exemple #1
0
        public void TestApplacation()
        {
            RakunNodeBase rakun1 = new RakunNodeBase();
            RakunNodeBase rakun2 = new RakunNodeBase();

            foreach (RakunNodeBase node in ReaderList)
            {
                if (node.ModuleName == "JoystickX")
                {
                    rakun1 = node;
                }
                if (node.ModuleName == "JoystickY")
                {
                    rakun2 = node;
                }
            }

            RakunNodeBase rakun = rakun1 + rakun2;

            string ccodewriten = AppDomain.CurrentDomain.BaseDirectory
                                 + @"\obj\"
                                 + "testapp"
                                 + ".c";

            string ccode = rakun.Gen_C_Code();

            System.IO.StreamWriter ccodeWrittingfile = new System.IO.StreamWriter(ccodewriten);
            ccodeWrittingfile.WriteLine(ccode);
            ccodeWrittingfile.Close();
        }
Exemple #2
0
        public object Clone()
        {
            RakunNodeBase obj = this.MemberwiseClone() as RakunNodeBase;

            if (xml == null)
            {
                return(obj);
            }

            obj.readXML(this.xml.InnerXml);

            return(obj);
        }
Exemple #3
0
        public virtual RakunNodeBase Append(RakunNodeBase c1original, RakunNodeBase c2original)
        {
            RakunNodeBase c2 = c2original.Clone() as RakunNodeBase;

            RakunNodeBase c1 = (RakunNodeBase)c1original.Clone();

            if (c1._rootNode == null)
            {
                return(c2.Clone() as RakunNodeBase);
            }
            if (c2._rootNode == null)
            {
                return(c2.Clone() as RakunNodeBase);
            }


            if (c1._rootNode.setupfunction == c2._rootNode.setupfunction)
            {
                return(c2.Clone() as RakunNodeBase);
            }

            int value = c1.GenRakunValue(0);

            c2.GenRakunValue(value);

            foreach (RakunNode RNode in c2._rootNode.Rakunlist)
            {
                RakunNode.addFunctionDcelear(ref c1._rootNode.declaration_list, RNode.ValueDeclear, true, true);
                //break;
            }

            RakunNode.addFunctionDcelear(ref c1._rootNode.setupfunction, c2._rootNode.setupfunction);
            RakunNode.addFunctionDcelear(ref c1._rootNode.loopfunction, c2._rootNode.loopfunction);


            return(c1);
        }