changeset 49:0d6b50b31ce3

gen/parse: More comments on parsing bridges
author Lewin Bormann <lbo@spheniscida.de>
date Thu, 22 Aug 2019 11:07:52 +0200
parents 4e4e38310ab1
children fd6eb7b5966c
files gen/y.lex gen/y.yy
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gen/y.lex	Thu Aug 22 11:04:13 2019 +0200
+++ b/gen/y.lex	Thu Aug 22 11:07:52 2019 +0200
@@ -1,5 +1,7 @@
 
 %pointer
+%{ // bison-bridge results in `yllval` not being a global variable but being accepted by yylex().
+%}
 %option reentrant noyywrap bison-bridge
 
 %top {
--- a/gen/y.yy	Thu Aug 22 11:04:13 2019 +0200
+++ b/gen/y.yy	Thu Aug 22 11:07:52 2019 +0200
@@ -33,7 +33,10 @@
 %}
 %parse-param {yvec_t* output_yexprs}
 
+%{ // Supply yylval argument to yylex().
+%}
 %define api.pure full
+
 %define lr.type ielr
 
 %union yvalue {
@@ -51,6 +54,8 @@
 const char* atom;
 }
 
+%{ // Type of yylval.
+%}
 %token <number> TOK_NUMBER_LITERAL
 %token <string> TOK_STRING_LITERAL
 %token <atom> TOK_ATOM