OpenDDS  Snapshot(2023/04/28-20:55)
TopicExpressionGrammar.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TOPIC_EXPRESSION_GRAMMAR_H
9 #define OPENDDS_DCPS_TOPIC_EXPRESSION_GRAMMAR_H
10 
11 #ifndef OPENDDS_NO_MULTI_TOPIC
12 
14 
16 
17 namespace OpenDDS {
18 namespace DCPS {
19 
20 namespace TopicExpressionGrammar {
21  using namespace yard;
22  using namespace text_grammar;
23  using namespace GrammarUtils;
25 
26  struct SELECT : Keyword<CharSeqIgnoreCase<'s', 'e', 'l', 'e', 'c', 't'> > {};
27  struct FROM : Keyword<CharSeqIgnoreCase<'f', 'r', 'o', 'm'> > {};
28  struct WHERE : Keyword<CharSeqIgnoreCase<'w', 'h', 'e', 'r', 'e'> > {};
29  struct INNER : Keyword<CharSeqIgnoreCase<'i', 'n', 'n', 'e', 'r'> > {};
30  struct NATURAL
31  : Keyword<CharSeqIgnoreCase<'n', 'a', 't', 'u', 'r', 'a', 'l'> > {};
32  struct JOIN : Keyword<CharSeqIgnoreCase<'j', 'o', 'i', 'n'> > {};
33  struct AS : Keyword<CharSeqIgnoreCase<'a', 's'> > {};
34 
35  struct TopicName : Ident {};
36  struct NaturalJoin : Or<Seq<INNER, NATURAL, JOIN>,
37  Seq<NATURAL, Opt<INNER>, JOIN> > {};
38  struct JoinItem : Or<Seq<ST<TopicName>, Opt<Seq<NaturalJoin, JoinItem> > >,
39  Seq<LPAREN, ST<TopicName>, NaturalJoin, JoinItem, RPAREN> > {};
40  struct Selection : Seq<ST<TopicName>, Opt<Seq<NaturalJoin, JoinItem> > > {};
41 
42  struct FieldAlias : Or<Seq<AS, ST<FieldName> >,
43  Seq<NotAt<FROM>, ST<FieldName> > > {};
44  struct SubjectFieldSpec : Seq<ST<FieldName>, Opt<FieldAlias> > {};
45  struct Aggregation : Or<Tok<Char<'*'> >,
46  DelimitedList<ST<SubjectFieldSpec>, Tok<Char<','> > > > {};
47 
48  struct SelectFrom : Seq<SELECT, Aggregation, FROM, Selection> {};
49  struct WhereClause : Seq<WHERE, Store<FilterExpressionGrammar::Cond> > {};
50  struct TopicExpr : Seq<SelectFrom, Opt<WhereClause> > {};
51 
52  struct TopicCompleteInput : Seq<TopicExpr, Opt<Tok<Char<';'> > >,
53  EndOfInput> {};
54 }
55 }
56 }
57 
59 
60 #endif
61 #endif
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28