Esempio n. 1
0
 public bool Match(IXMLLuaSearchExpression req, IExpression real)
 {
     Logger.Debug($"Match expression {req} -> {real}");
     if (req is XMLLuaSearchVariable && real is Variable)
     {
         return(Match((XMLLuaSearchVariable)req, (Variable)real));
     }
     if (req is XMLLuaSearchStringLiteral && real is StringLiteral)
     {
         return(Match((XMLLuaSearchStringLiteral)req, (StringLiteral)real));
     }
     if (req is XMLLuaSearchNumberLiteral && real is NumberLiteral)
     {
         return(Match((XMLLuaSearchNumberLiteral)req, (NumberLiteral)real));
     }
     if (req is XMLLuaSearchNilLiteral && real is NilLiteral)
     {
         return(Match((XMLLuaSearchNilLiteral)req, (NilLiteral)real));
     }
     if (req is XMLLuaSearchBoolLiteral && real is BoolLiteral)
     {
         return(Match((XMLLuaSearchBoolLiteral)req, (BoolLiteral)real));
     }
     if (req is XMLLuaSearchVarargsLiteral && real is VarargsLiteral)
     {
         return(Match((XMLLuaSearchVarargsLiteral)req, (VarargsLiteral)real));
     }
     if (req is XMLLuaSearchFunctionCall && real is FunctionCall)
     {
         return(Match((XMLLuaSearchFunctionCall)req, (FunctionCall)real));
     }
     if (req is XMLLuaSearchTableAccess && real is TableAccess)
     {
         return(Match((XMLLuaSearchTableAccess)req, (TableAccess)real));
     }
     if (req is XMLLuaSearchFunctionDefinition && real is FunctionDefinition)
     {
         return(Match((XMLLuaSearchFunctionDefinition)req, (FunctionDefinition)real));
     }
     if (req is XMLLuaSearchBinaryExpression && real is BinaryExpression)
     {
         return(Match((XMLLuaSearchBinaryExpression)req, (BinaryExpression)real));
     }
     if (req is XMLLuaSearchUnaryExpression && real is UnaryExpression)
     {
         return(Match((XMLLuaSearchUnaryExpression)req, (UnaryExpression)real));
     }
     if (req is XMLLuaSearchTableConstructor && real is TableConstructor)
     {
         return(Match((XMLLuaSearchTableConstructor)req, (TableConstructor)real));
     }
     return(false);
 }
Esempio n. 2
0
        public override void FillIn(XmlElement elem)
        {
            base.FillIn(elem);
            Name = elem.GetAttribute("name");

            for (var i = 0; i < elem.ChildNodes.Count; i++)
            {
                var child = elem.ChildNodes[i];

                if (child.Name == "Prefix" && child.ChildNodes.Count > 0)
                {
                    var expr = child.ChildNodes[0];
                    Prefix = LuaSearchXMLTypes.GetExpression(expr.Name, expr as XmlElement);
                }
            }
        }
Esempio n. 3
0
        public void FillIn(XmlElement elem)
        {
            for (var i = 0; i < elem.ChildNodes.Count; i++)
            {
                var child = elem.ChildNodes[i];

                if (child.Name == "Key" && child.ChildNodes.Count > 0)
                {
                    var key = child.ChildNodes[0];
                    Key = LuaSearchXMLTypes.GetExpression(key.Name, key as XmlElement);
                }
                else if (child.Name == "Value" && child.ChildNodes.Count > 0)
                {
                    var value = child.ChildNodes[0];
                    Value = LuaSearchXMLTypes.GetExpression(value.Name, value as XmlElement);
                }
            }
        }
Esempio n. 4
0
        public override void FillIn(XmlElement elem)
        {
            base.FillIn(elem);
            for (var i = 0; i < elem.ChildNodes.Count; i++)
            {
                var child = elem.ChildNodes[i];

                if (child.Name == "Table" && child.ChildNodes.Count > 0)
                {
                    var tab = child.ChildNodes[0];
                    Table = LuaSearchXMLTypes.GetExpression(tab.Name, tab as XmlElement);
                }
                else if (child.Name == "Index" && child.ChildNodes.Count > 0)
                {
                    var idx = child.ChildNodes[0];
                    Index = LuaSearchXMLTypes.GetExpression(idx.Name, idx as XmlElement);
                }
            }
        }