Esempio n. 1
0
		internal object Parse( System.Xml.XmlNode node )
		{
            string name = node.Name;
            IParse o    = null;

            if (GetVariable("COMPILER_TOOL").ToUpper() == "RVDS" || GetVariable("COMPILER_TOOL").ToUpper() == "MDK")
            {
                if (name == "ScatterFile")          o = new Group();
                else if (name == "Set")             o = new Variable();
                else if (name == "Conditional")     o = new Conditional();
                else if (name == "If")              o = new Filter(false, true);
                else if (name == "IfDefined")       o = new Filter(true, true);
                else if (name == "IfNot")           o = new Filter(false, false);
                else if (name == "IfNotDefined")    o = new Filter(true, false);
                else if (name == "Match")           o = new MatchCondition();
                else if (name == "Or")              o = new OrCondition();
                else if (name == "And")             o = new AndCondition();
                else if (name == "Not")             o = new NotCondition();
                else if (name == "Positive")        o = new Group();
                else if (name == "Negative")        o = new Group();
                else if (name == "NamedGroup")      o = new NamedGroupRVDS();
                else if (name == "LoadRegion")      o = new LoadRegionRVDS();
                else if (name == "ExecRegion")      o = new ExecRegionRVDS();
                else if (name == "FileMapping")     o = new FileMappingRVDS();
                else if (name == "EntryPoint")      o = new EntryPointRVDS();
                else if (name == "GlobalVariable")  o = new GlobalVariableRVDS();
                else if (name == "Provide")         o = new ProvideRVDS();
                else if (name == "Include")         o = new Include();
                else if (name == "Error")           o = new Error();
            }
            else if (GetVariable("COMPILER_TOOL").ToUpper() == "GCC")
            {
                if (name == "ScatterFile") o = new Group();
                else if (name == "Set") o = new Variable();
                else if (name == "Conditional") o = new Conditional();
                else if (name == "If") o = new Filter(false, true);
                else if (name == "IfDefined") o = new Filter(true, true);
                else if (name == "IfNot") o = new Filter(false, false);
                else if (name == "IfNotDefined") o = new Filter(true, false);
                else if (name == "Match") o = new MatchCondition();
                else if (name == "Or") o = new OrCondition();
                else if (name == "And") o = new AndCondition();
                else if (name == "Not") o = new NotCondition();
                else if (name == "Positive") o = new Group();
                else if (name == "Negative") o = new Group();
                else if (name == "NamedGroup") o = new NamedGroupGCC();
                else if (name == "LoadRegion") o = new LoadRegionGCC();
                else if (name == "ExecRegion") o = new ExecRegionGCC();
                else if (name == "FileMapping") o = new FileMappingGCC();
                else if (name == "EntryPoint") o = new EntryPointGCC();
                else if (name == "GlobalVariable") o = new GlobalVariableGCC();
                else if (name == "Provide") o = new ProvideGCC();
                else if (name == "Include") o = new Include();
                else if (name == "Error") o = new Error();
            }
            else
            {
                throw new Exception("Environment Variable COMPILER_TOOL not set to a proper value. Supported compilers are ARM and GCC");
            }

            if(o != null)
            {
                o.Parse( this, node );
            }

			return o;
		}
        internal object Parse(System.Xml.XmlNode node)
        {
            string name = node.Name;
            IParse o    = null;

            if (GetVariable("COMPILER_TOOL").ToUpper() == "RVDS" || GetVariable("COMPILER_TOOL").ToUpper() == "MDK")
            {
                if (name == "ScatterFile")
                {
                    o = new Group();
                }
                else if (name == "Set")
                {
                    o = new Variable();
                }
                else if (name == "Conditional")
                {
                    o = new Conditional();
                }
                else if (name == "If")
                {
                    o = new Filter(false, true);
                }
                else if (name == "IfDefined")
                {
                    o = new Filter(true, true);
                }
                else if (name == "IfNot")
                {
                    o = new Filter(false, false);
                }
                else if (name == "IfNotDefined")
                {
                    o = new Filter(true, false);
                }
                else if (name == "Match")
                {
                    o = new MatchCondition();
                }
                else if (name == "Or")
                {
                    o = new OrCondition();
                }
                else if (name == "And")
                {
                    o = new AndCondition();
                }
                else if (name == "Not")
                {
                    o = new NotCondition();
                }
                else if (name == "Positive")
                {
                    o = new Group();
                }
                else if (name == "Negative")
                {
                    o = new Group();
                }
                else if (name == "NamedGroup")
                {
                    o = new NamedGroupRVDS();
                }
                else if (name == "LoadRegion")
                {
                    o = new LoadRegionRVDS();
                }
                else if (name == "ExecRegion")
                {
                    o = new ExecRegionRVDS();
                }
                else if (name == "FileMapping")
                {
                    o = new FileMappingRVDS();
                }
                else if (name == "EntryPoint")
                {
                    o = new EntryPointRVDS();
                }
                else if (name == "GlobalVariable")
                {
                    o = new GlobalVariableRVDS();
                }
                else if (name == "Provide")
                {
                    o = new ProvideRVDS();
                }
                else if (name == "Include")
                {
                    o = new Include();
                }
                else if (name == "Error")
                {
                    o = new Error();
                }
            }
            else if (GetVariable("COMPILER_TOOL").ToUpper() == "GCC")
            {
                if (name == "ScatterFile")
                {
                    o = new Group();
                }
                else if (name == "Set")
                {
                    o = new Variable();
                }
                else if (name == "Conditional")
                {
                    o = new Conditional();
                }
                else if (name == "If")
                {
                    o = new Filter(false, true);
                }
                else if (name == "IfDefined")
                {
                    o = new Filter(true, true);
                }
                else if (name == "IfNot")
                {
                    o = new Filter(false, false);
                }
                else if (name == "IfNotDefined")
                {
                    o = new Filter(true, false);
                }
                else if (name == "Match")
                {
                    o = new MatchCondition();
                }
                else if (name == "Or")
                {
                    o = new OrCondition();
                }
                else if (name == "And")
                {
                    o = new AndCondition();
                }
                else if (name == "Not")
                {
                    o = new NotCondition();
                }
                else if (name == "Positive")
                {
                    o = new Group();
                }
                else if (name == "Negative")
                {
                    o = new Group();
                }
                else if (name == "NamedGroup")
                {
                    o = new NamedGroupGCC();
                }
                else if (name == "LoadRegion")
                {
                    o = new LoadRegionGCC();
                }
                else if (name == "ExecRegion")
                {
                    o = new ExecRegionGCC();
                }
                else if (name == "FileMapping")
                {
                    o = new FileMappingGCC();
                }
                else if (name == "EntryPoint")
                {
                    o = new EntryPointGCC();
                }
                else if (name == "GlobalVariable")
                {
                    o = new GlobalVariableGCC();
                }
                else if (name == "Provide")
                {
                    o = new ProvideGCC();
                }
                else if (name == "Include")
                {
                    o = new Include();
                }
                else if (name == "Error")
                {
                    o = new Error();
                }
            }
            else
            {
                throw new Exception("Environment Variable COMPILER_TOOL not set to a proper value. Supported compilers are ARM and GCC");
            }

            if (o != null)
            {
                o.Parse(this, node);
            }

            return(o);
        }