Skip to content

Commit

Permalink
feat(csql_grammar.y): can create vector table with arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
vimkim committed Dec 9, 2024
1 parent 5d23c87 commit 3c5d295
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/parser/csql_grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,7 @@ static char *g_plcsql_text;
%type <c2> class_name_with_server_name
%type <c2> opt_index_with_clause
%type <c2> index_with_item_list
%type <c2> opt_vector_args


/*}}}*/
Expand Down Expand Up @@ -21890,7 +21891,7 @@ primitive_type

$$ = ctn;
DBG_PRINT}}
| VECTOR
| VECTOR opt_vector_args
{{ DBG_TRACE_GRAMMAR(data_type, | vector_type);

container_2 ctn;
Expand All @@ -21900,6 +21901,37 @@ primitive_type
DBG_PRINT}}
;

opt_vector_args
: /* empty */
{{ DBG_TRACE_GRAMMAR(opt_vector_args, : );

container_2 ctn;
SET_CONTAINER_2 (ctn, NULL, NULL);
$$ = ctn;

DBG_PRINT}}
| '(' unsigned_integer ')'
{{ DBG_TRACE_GRAMMAR(opt_vector_args, | '(' unsigned_integer ')' );

container_2 ctn;
SET_CONTAINER_2 (ctn, $2, NULL);
$$ = ctn;

DBG_PRINT}}
| '(' unsigned_integer ',' primitive_type ')'
{{ DBG_TRACE_GRAMMAR(opt_vector_args, | '(' unsigned_integer ',' primitive_type ')' );

container_2 ctn;
// TODO: primitive_type not yet handled.
container_2 primitive_type_container = $4;

SET_CONTAINER_2 (ctn, $2, NULL);
$$ = ctn;

DBG_PRINT}}
;


opt_internal_external
: /* empty */
{{ DBG_TRACE_GRAMMAR(opt_internal_external, : );
Expand Down

0 comments on commit 3c5d295

Please sign in to comment.