summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-09-11 18:02:10 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-09-11 18:02:10 +0000
commit3dc5e96b85a7145b8c0d12f1fd0ab9222f59621d (patch)
tree5371e4c3a4ea2c2558f3e9cd04e270b12327ea7c
parentb2a0b7ca70f9490693d517d10c9c4a64c9fc1af0 (diff)
downloadbison-3dc5e96b85a7145b8c0d12f1fd0ab9222f59621d.tar.gz
* doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
Sander Brandenburg in <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>. Also, fix minor white space and comment issues.
-rw-r--r--ChangeLog7
-rw-r--r--doc/bison.texinfo14
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index dfa5420a..dde03052 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
+ Sander Brandenburg in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
+ Also, fix minor white space and comment issues.
+
2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
Finish implementation of per-type %destructor/%printer. Discussed
diff --git a/doc/bison.texinfo b/doc/bison.texinfo
index 94a384e0..cf95066a 100644
--- a/doc/bison.texinfo
+++ b/doc/bison.texinfo
@@ -7423,8 +7423,8 @@ factor both as follows.
@comment file: calc++-driver.hh
@example
-// Announce to Flex the prototype we want for lexing function, ...
-# define YY_DECL \
+// Tell Flex the lexer's prototype ...
+# define YY_DECL \
yy::calcxx_parser::token_type \
yylex (yy::calcxx_parser::semantic_type* yylval, \
yy::calcxx_parser::location_type* yylloc, \
@@ -7675,7 +7675,9 @@ unit: assignments exp @{ driver.result = $2; @};
assignments: assignments assignment @{@}
| /* Nothing. */ @{@};
-assignment: "identifier" ":=" exp @{ driver.variables[*$1] = $3; @};
+assignment:
+ "identifier" ":=" exp
+ @{ driver.variables[*$1] = $3; delete $1; @};
%left '+' '-';
%left '*' '/';
@@ -7683,7 +7685,7 @@ exp: exp '+' exp @{ $$ = $1 + $3; @}
| exp '-' exp @{ $$ = $1 - $3; @}
| exp '*' exp @{ $$ = $1 * $3; @}
| exp '/' exp @{ $$ = $1 / $3; @}
- | "identifier" @{ $$ = driver.variables[*$1]; @}
+ | "identifier" @{ $$ = driver.variables[*$1]; delete $1; @}
| "number" @{ $$ = $1; @};
%%
@end example
@@ -7844,8 +7846,8 @@ main (int argc, char *argv[])
driver.trace_scanning = true;
else
@{
- driver.parse (*argv);
- std::cout << driver.result << std::endl;
+ driver.parse (*argv);
+ std::cout << driver.result << std::endl;
@}
@}
@end example