From 81eaf5e789cf3637c3e785d060ec690a5bd0a7a4 Mon Sep 17 00:00:00 2001 From: nishi Date: Tue, 4 Jun 2024 03:21:27 +0000 Subject: [PATCH] will fix soon git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@142 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Grammar/dw.l | 3 +++ Grammar/dw.y | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Grammar/dw.l b/Grammar/dw.l index fb8cebd..c8f22c2 100644 --- a/Grammar/dw.l +++ b/Grammar/dw.l @@ -38,15 +38,18 @@ extern YYSTYPE yylval; ["][^"]*["] { yylval.node.string = strdup(yytext + 1); yylval.node.string[strlen(yylval.node.string) - 1] = 0; + yylval.node.nodes = NULL; return (STRING); } ['][^']*['] { yylval.node.string = strdup(yytext + 1); yylval.node.string[strlen(yylval.node.string) - 1] = 0; + yylval.node.nodes = NULL; return (STRING); } [a-zA-Z0-9_\-]+ { yylval.node.ident = strdup(yytext); + yylval.node.nodes = NULL; return (IDENTIFIER); } [\(\),] { diff --git a/Grammar/dw.y b/Grammar/dw.y index 7f48ad5..16785fe 100644 --- a/Grammar/dw.y +++ b/Grammar/dw.y @@ -38,6 +38,7 @@ struct Node { char* string; char* ident; + struct Node* nodes; } node; } @@ -50,10 +51,18 @@ argument ; single_argument - : SPACE argument SPACE - | SPACE argument - | argument SPACE - | argument + : SPACE argument SPACE { + $$ = $2; + } + | SPACE argument { + $$ = $2; + } + | argument SPACE { + $$ = $1; + } + | argument { + $$ = $1; + } ; arguments -- 2.43.0