%type opt_setup opt_teardown
%type setup
%type
step_list session_list permutation_list opt_permutation_list
+%type
string_literal_list
%type session
%type step
-%token sqlblock string
+%token sqlblock string_literal
%token PERMUTATION SESSION SETUP STEP TEARDOWN TEST
%%
;
session:
- SESSION string opt_setup step_list opt_teardown
+ SESSION string_literal opt_setup step_list opt_teardown
{
$$ = malloc(sizeof(Session));
$$->name = $2;
step:
- STEP string sqlblock
+ STEP string_literal sqlblock
{
$$ = malloc(sizeof(Step));
$$->name = $2;
permutation:
- PERMUTATION string_list
+ PERMUTATION string_literal_list
{
$$ = malloc(sizeof(Permutation));
$$->stepnames = (char **) $2.elements;
}
;
-string_list:
- string_list string
+string_literal_list:
+ string_literal_list string_literal
{
$$.elements = realloc($1.elements,
($1.nelements + 1) * sizeof(void *));
$$.elements[$1.nelements] = $2;
$$.nelements = $1.nelements + 1;
}
- | string
+ | string_literal
{
$$.nelements = 1;
$$.elements = malloc(sizeof(void *));
litbuf[litbufpos] = '\0';
yylval.str = strdup(litbuf);
BEGIN(INITIAL);
- return(string);
+ return(string_literal);
}
. { addlitchar(yytext[0]); }
\n { yyerror("unexpected newline in quoted string"); }