예제 #1
0
        private NPathSelectQuery ParseSelectQuery()
        {
            NPathSelectQuery query = new NPathSelectQuery();

            queries.Push(query);

            tokenizer.GetCurrentToken("select", "Select");

            NPathSelectClause selectClause = new NPathSelectClause();

            ParseSelectClause(selectClause);
            query.Select = selectClause;

            tokenizer.GetCurrentToken("from", "From");
            NPathFromClause fromClause = new NPathFromClause();

            ParseFromClause(fromClause);
            query.From = fromClause;

            if (tokenizer.GetCurrentToken().IsType("where"))
            {
                NPathWhereClause whereClause = new NPathWhereClause();
                query.Where = whereClause;
                ParseWhereClause(whereClause);
            }

            if (tokenizer.GetCurrentToken().IsType("order by"))             // do not localize
            {
                NPathOrderByClause orderByClause = new NPathOrderByClause();
                ParseOrderByClause(orderByClause);
                query.OrderBy = orderByClause;
            }

            return(query);
        }
예제 #2
0
 private void ParseWhereClause(NPathWhereClause whereClause)
 {
     tokenizer.MoveNext();
     whereClause.Expression = ParseBooleanExpression();
 }