From 94fcce501ec79a13bcfd5071c0fc3812462ee6f7 Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Tue, 7 Jul 2015 16:17:01 +0200 Subject: [PATCH] Cql3.g: handle token in grammar --- cql3/Cql.g | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cql3/Cql.g b/cql3/Cql.g index 59ae03c9ee..ae75456e89 100644 --- a/cql3/Cql.g +++ b/cql3/Cql.g @@ -50,6 +50,7 @@ options { #include "cql3/operation_impl.hh" #include "cql3/error_listener.hh" #include "cql3/single_column_relation.hh" +#include "cql3/token_relation.hh" #include "cql3/cql3_type.hh" #include "cql3/cf_name.hh" #include "cql3/maps.hh" @@ -1215,10 +1216,10 @@ relationType returns [const cql3::operator_type* op = nullptr] relation[std::vector& clauses] : name=cident type=relationType t=term { $clauses.emplace_back(::make_shared(std::move(name), *type, std::move(t))); } -#if 0 + | K_TOKEN l=tupleOfIdentifiers type=relationType t=term - { $clauses.add(new TokenRelation(l, type, t)); } -#endif + { $clauses.emplace_back(::make_shared(std::move(l), *type, std::move(t))); } + | name=cident K_IN marker=inMarker { $clauses.emplace_back(make_shared(std::move(name), cql3::operator_type::IN, std::move(marker))); } | name=cident K_IN in_values=singleColumnInValues @@ -1256,12 +1257,9 @@ inMarker returns [shared_ptr marker] | ':' name=ident { $marker = new_in_bind_variables(name); } ; -#if 0 -tupleOfIdentifiers returns [List ids] - @init { $ids = new ArrayList(); } - : '(' n1=cident { $ids.add(n1); } (',' ni=cident { $ids.add(ni); })* ')' +tupleOfIdentifiers returns [std::vector<::shared_ptr> ids] + : '(' n1=cident { $ids.push_back(n1); } (',' ni=cident { $ids.push_back(ni); })* ')' ; -#endif singleColumnInValues returns [std::vector<::shared_ptr> terms] : '(' ( t1 = term { $terms.push_back(t1); } (',' ti=term { $terms.push_back(ti); })* )? ')'