[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Minor changes to lex.am and yacc.am
From: |
Magnus Fromreide |
Subject: |
Minor changes to lex.am and yacc.am |
Date: |
Fri, 8 Feb 2002 08:07:59 +0100 (MET) |
In the rules from lex.am and yacc.am, if the item %OBJ% or the variable
LEX_OUTPUT_ROOT in lex.am contains a / then the sed expression fails.
A patch proposal is available below but I have no problems with changing
the separator character so something other than #, : do come to mind.
Another approach could be to scan the known input string and chose a
character that is known not to clash, this would solve the problem for the
yacc case but possibly not for the lex case.
*** lib/am/lex.am 14 Dec 2001 16:25:37 -0000 1.6
--- lib/am/lex.am 8 Feb 2002 07:04:04 -0000
***************
*** 28,33 ****
else !%?MORE-THAN-ONE%
%COMPILE% %SOURCE%
## Edit out `#line' or `#' directives.
! sed '/^#/ s/$(LEX_OUTPUT_ROOT)\.c/%OBJ%/' $(LEX_OUTPUT_ROOT).c
>%OBJ%
rm -f $(LEX_OUTPUT_ROOT).c
endif !%?MORE-THAN-ONE%
--- 28,33 ----
else !%?MORE-THAN-ONE%
%COMPILE% %SOURCE%
## Edit out `#line' or `#' directives.
! sed '/^#/ s;$(LEX_OUTPUT_ROOT)\.c;%OBJ%;' $(LEX_OUTPUT_ROOT).c
>%OBJ%
rm -f $(LEX_OUTPUT_ROOT).c
endif !%?MORE-THAN-ONE%
*** lib/am/yacc.am 28 Jan 2002 00:40:10 -0000 1.11
--- lib/am/yacc.am 8 Feb 2002 07:04:04 -0000
***************
*** 23,29 ****
else !%?MORE-THAN-ONE%
%COMPILE% %SOURCE%
## Edit out `#line' or `#' directives.
! sed '/^#/ s/y\.tab\.c/%OBJ%/' y.tab.c >%OBJ%
rm -f y.tab.c
## Edit out Bison multiple inclusion guards. It may be BISON_Y_TAB_H,
## or Y_TAB_H depending upon the version, that's why the regexp is
--- 23,29 ----
else !%?MORE-THAN-ONE%
%COMPILE% %SOURCE%
## Edit out `#line' or `#' directives.
! sed '/^#/ s;y\.tab\.c;%OBJ%;' y.tab.c >%OBJ%
rm -f y.tab.c
## Edit out Bison multiple inclusion guards. It may be BISON_Y_TAB_H,
## or Y_TAB_H depending upon the version, that's why the regexp is
- Minor changes to lex.am and yacc.am,
Magnus Fromreide <=