Beispiel #1
0
        string Gen(ExprNode ex)
        {
            if (ex.GetType() == typeof(BinOpNode))
            {
                var    bin       = (BinOpNode)ex;
                string argument1 = Gen(bin.Left);
                string argument2 = Gen(bin.Right);
                string result    = ThreeAddressCodeTmp.GenTmpName();
                GenCommand("", bin.Op.ToString(), argument1, argument2, result);
                return(result);
            }
            else if (ex.GetType() == typeof(IdNode))
            {
                var id = (IdNode)ex;
                return(id.Name);
            }
            else if (ex.GetType() == typeof(IntNumNode))
            {
                var id = (IntNumNode)ex;
                return(id.Num.ToString());
            }
            else if (ex.GetType() == typeof(BoolValNode))
            {
                var bl = (BoolValNode)ex;
                return(bl.Val.ToString());
            }

            return(null);
        }
Beispiel #2
0
        public static Object NewInstance(String engineURI, String statementName, ExprNode exprNode)
        {
            var generator  = new ProxyGenerator();
            var interfaces = exprNode.GetType()
                             .GetInterfaces()
                             .Where(inf => inf.Assembly != CastleAssembly)
                             .ToArray();

            return(generator.CreateInterfaceProxyWithoutTarget(
                       typeof(ExprNode), interfaces,
                       new ExprNodeProxy(engineURI, statementName, exprNode)));
        }
Beispiel #3
0
        public static object NewInstance(ExprNode exprNode)
        {
            if (exprNode is IProxyTargetAccessor) {
                return exprNode;
            }
            
            var interfaces = exprNode.GetType()
                .GetInterfaces()
                .Where(t => t != typeof(ExprNode))
                .ToArray();

            return generator.CreateInterfaceProxyWithTarget(
                typeof(ExprNode), interfaces, exprNode, new ExprNodeProxy(exprNode));
        }
Beispiel #4
0
        public override bool EqualsNode(ExprNode node)
        {
            if (this == node)
            {
                return(true);
            }
            if (node == null || GetType() != node.GetType())
            {
                return(false);
            }

            var that = (ExprContextPropertyNode)node;

            return(_propertyName.Equals(that._propertyName));
        }
Beispiel #5
0
        public override bool EqualsNode(
            ExprNode node,
            bool ignoreStreamPrefix)
        {
            if (this == node) {
                return true;
            }

            if (node == null || GetType() != node.GetType()) {
                return false;
            }

            var that = (ExprContextPropertyNodeImpl) node;
            return PropertyName.Equals(that.PropertyName);
        }
Beispiel #6
0
        public override bool EqualsNode(
            ExprNode other,
            bool ignoreStreamPrefix)
        {
            if (this == other) {
                return true;
            }

            if (other == null || GetType() != other.GetType()) {
                return false;
            }

            var that = (ExprEvalSystemProperty) other;

            return systemPropertyName.Equals(that.systemPropertyName);
        }
Beispiel #7
0
        public override bool EqualsNode(
            ExprNode node,
            bool ignoreStreamPrefix)
        {
            if (node == null || GetType() != node.GetType()) {
                return false;
            }

            var that = (ExprPreviousNode) node;

            if (PreviousType != that.PreviousType) {
                return false;
            }

            return true;
        }
Beispiel #8
0
        public override bool EqualsNode(ExprNode node)
        {
            if (this == node)
            {
                return(true);
            }
            if (node == null || GetType() != node.GetType())
            {
                return(false);
            }

            var that = (ExprNodeScript)node;

            if (Script != null ? !Script.Equals(that.Script) : that.Script != null)
            {
                return(false);
            }
            return(ExprNodeUtility.DeepEquals(Parameters, that.Parameters));
        }
Beispiel #9
0
        public override bool EqualsNode(
            ExprNode o,
            bool ignoreStreamPrefix)
        {
            if (this == o) {
                return true;
            }

            if (o == null || GetType() != o.GetType()) {
                return false;
            }

            var that = (ExprTableAccessNode) o;
            if (!TableName.Equals(that.TableName)) {
                return false;
            }

            return EqualsNodeInternal(that);
        }
Beispiel #10
0
        public override bool EqualsNode(
            ExprNode node,
            bool ignoreStreamPrefix)
        {
            if (this == node) {
                return true;
            }

            if (node == null || GetType() != node.GetType()) {
                return false;
            }

            var that = (ExprNodeScript) node;

            if (!Script?.Equals(that.Script) ?? that.Script != null) {
                return false;
            }

            return ExprNodeUtilityCompare.DeepEquals(Parameters, that.Parameters);
        }
        public override bool EqualsNode(ExprNode o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || GetType() != o.GetType())
            {
                return(false);
            }

            var that = (ExprTableAccessNode)o;

            if (!_tableName.Equals(that._tableName))
            {
                return(false);
            }

            return(EqualsNodeInternal(that));
        }