コード例 #1
0
        internal FdoDistanceCondition(ParseTreeNode node)
        {
            this.Identifier = new FdoIdentifier(node.ChildNodes[0]);
            var opName = node.ChildNodes[1].ChildNodes[0].Token.ValueString;

            switch (opName.ToUpper())
            {
            case "WITHINDISTANCE":
                this.Operator = DistanceOperations.WithinDistance;
                break;

            case "BEYOND":
                this.Operator = DistanceOperations.Beyond;
                break;

            default:
                throw new FdoParseException(string.Format(Strings.UnknownOperator, opName));
            }
            this.Expression = FdoExpression.ParseNode(node.ChildNodes[2]);
            this.Distance   = FdoDataValue.ParseDataNode(node.ChildNodes[3].ChildNodes[0]);
        }
コード例 #2
0
        internal static FdoLiteralValue ParseLiteralNode(ParseTreeNode node)
        {
            if (node.Term.Name == FdoTerminalNames.LiteralValue)
            {
                return(ParseLiteralNode(node.ChildNodes[0]));
            }
            else
            {
                switch (node.Term.Name)
                {
                case FdoTerminalNames.DataValue:
                    return(FdoDataValue.ParseDataNode(node));

                case FdoTerminalNames.GeometryValue:
                    return(new FdoGeometryValue(node));

                default:
                    throw new FdoParseException("Unknown terminal: " + node.Term.Name);
                }
            }
        }