* [PATCH] Modification of lexer and parser, improving dtc portability.
@ 2010-01-29 16:31 Lukasz Wojcik
[not found] ` <1264782711-52086-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Wojcik @ 2010-01-29 16:31 UTC (permalink / raw)
To: Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
This mod allows successful build of dtc using both bison/flex and yacc/lex.
Signed-off-by: Lukasz Wojcik <zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
---
dtc-lexer.l | 1 +
dtc-parser.y | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dtc-lexer.l b/dtc-lexer.l
index 9021231..3c3434c 100644
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -38,6 +38,7 @@ LINECOMMENT "//".*\n
#include "srcpos.h"
#include "dtc-parser.tab.h"
+YYLTYPE yylloc;
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
#define YY_USER_ACTION \
diff --git a/dtc-parser.y b/dtc-parser.y
index b7c7dbd..a2c0925 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -18,14 +18,14 @@
* USA
*/
-%locations
-
%{
#include <stdio.h>
#include "dtc.h"
#include "srcpos.h"
+YYLTYPE yylloc;
+
extern int yylex(void);
extern void yyerror(char const *s);
--
1.6.3.1
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <1264782711-52086-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>]
* Re: [PATCH] Modification of lexer and parser, improving dtc portability. [not found] ` <1264782711-52086-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org> @ 2010-02-01 4:46 ` David Gibson 2010-02-04 9:42 ` Lukasz Wojcik 2010-02-08 8:13 ` David Gibson 1 sibling, 1 reply; 8+ messages in thread From: David Gibson @ 2010-02-01 4:46 UTC (permalink / raw) To: Lukasz Wojcik; +Cc: Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ On Fri, Jan 29, 2010 at 05:31:51PM +0100, Lukasz Wojcik wrote: > This mod allows successful build of dtc using both bison/flex and > yacc/lex. Hrm. This will enable dtc to build with both bison and yacc, however, it will sacrifice the (much) more useful error messages that %locations gives us on bison. So I'm not very happy to do this unconditionally. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Modification of lexer and parser, improving dtc portability. 2010-02-01 4:46 ` David Gibson @ 2010-02-04 9:42 ` Lukasz Wojcik [not found] ` <4B6A9683.300-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Lukasz Wojcik @ 2010-02-04 9:42 UTC (permalink / raw) To: David Gibson; +Cc: Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ On 01.02.2010 05:46, David Gibson wrote: > On Fri, Jan 29, 2010 at 05:31:51PM +0100, Lukasz Wojcik wrote: > >> This mod allows successful build of dtc using both bison/flex and >> yacc/lex. >> > Hrm. This will enable dtc to build with both bison and yacc, however, > it will sacrifice the (much) more useful error messages that > %locations gives us on bison. So I'm not very happy to do this > unconditionally. > > Would you be so kind, and possibly point me out where exactly the differences between error messages before and after applying this patch lies ? I did some testing around dtc being compiled using: yacc - 1.9 20070509 on Fedora, kernel 2.6.31.5-127.fc12.i686.PAE and bison (GNU Bison) 2.4.1, same system. I was not able to notice any difference. Thanks in advance. Lukasz. ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <4B6A9683.300-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>]
* Re: [PATCH] Modification of lexer and parser, improving dtc portability. [not found] ` <4B6A9683.300-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org> @ 2010-02-08 8:13 ` David Gibson 0 siblings, 0 replies; 8+ messages in thread From: David Gibson @ 2010-02-08 8:13 UTC (permalink / raw) To: Lukasz Wojcik; +Cc: Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ On Thu, Feb 04, 2010 at 10:42:27AM +0100, Lukasz Wojcik wrote: > On 01.02.2010 05:46, David Gibson wrote: > >On Fri, Jan 29, 2010 at 05:31:51PM +0100, Lukasz Wojcik wrote: > >>This mod allows successful build of dtc using both bison/flex and > >>yacc/lex. > >Hrm. This will enable dtc to build with both bison and yacc, however, > >it will sacrifice the (much) more useful error messages that > >%locations gives us on bison. So I'm not very happy to do this > >unconditionally. > Would you be so kind, and possibly point me out where exactly the > differences between error messages before and after applying this > patch lies ? I did some > testing around dtc being compiled using: Ah, sorry, I was mistaken. I'd forgotten that we were using our own overridden version of yyerror() which will generate errors including location information, even with %locations. I withdraw my objections to the patch. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Modification of lexer and parser, improving dtc portability. [not found] ` <1264782711-52086-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org> 2010-02-01 4:46 ` David Gibson @ 2010-02-08 8:13 ` David Gibson 2010-02-08 15:31 ` Jon Loeliger 1 sibling, 1 reply; 8+ messages in thread From: David Gibson @ 2010-02-08 8:13 UTC (permalink / raw) To: Lukasz Wojcik; +Cc: Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ On Fri, Jan 29, 2010 at 05:31:51PM +0100, Lukasz Wojcik wrote: > This mod allows successful build of dtc using both bison/flex and yacc/lex. > > Signed-off-by: Lukasz Wojcik <zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org> Acked-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Modification of lexer and parser, improving dtc portability. 2010-02-08 8:13 ` David Gibson @ 2010-02-08 15:31 ` Jon Loeliger 0 siblings, 0 replies; 8+ messages in thread From: Jon Loeliger @ 2010-02-08 15:31 UTC (permalink / raw) To: David Gibson; +Cc: Devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ > On Fri, Jan 29, 2010 at 05:31:51PM +0100, Lukasz Wojcik wrote: > > This mod allows successful build of dtc using both bison/flex and yacc/lex. > > > > Signed-off-by: Lukasz Wojcik <zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org> > > Acked-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> Applied and pushed out! jdl ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] Modification of lexer and parser, improving dtc portability.
@ 2010-01-12 13:57 Lukasz Wojcik
[not found] ` <1263304653-71750-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Wojcik @ 2010-01-12 13:57 UTC (permalink / raw)
To: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A
This mod allows successful build of dtc using both bison/flex and yacc/lex.
---
dtc-lexer.l | 2 ++
dtc-parser.y | 3 ++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dtc-lexer.l b/dtc-lexer.l
index d142de5..96c2fce 100644
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -38,6 +38,8 @@ LINECOMMENT "//".*\n
#include "srcpos.h"
#include "dtc-parser.tab.h"
+YYLTYPE yylloc;
+
#define YY_USER_ACTION \
{ \
yylloc.file = srcpos_file; \
diff --git a/dtc-parser.y b/dtc-parser.y
index 31c14d7..4411aed 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -18,7 +18,6 @@
* USA
*/
-%locations
%{
#include <stdio.h>
@@ -26,6 +25,8 @@
#include "dtc.h"
#include "srcpos.h"
+YYLTYPE yylloc;
+
extern int yylex(void);
extern void yyerror(char const *s);
--
1.6.3.1
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <1263304653-71750-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>]
* Re: [PATCH] Modification of lexer and parser, improving dtc portability. [not found] ` <1263304653-71750-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org> @ 2010-01-26 23:11 ` David Gibson 0 siblings, 0 replies; 8+ messages in thread From: David Gibson @ 2010-01-26 23:11 UTC (permalink / raw) To: Lukasz Wojcik; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A On Tue, Jan 12, 2010 at 02:57:33PM +0100, Lukasz Wojcik wrote: > This mod allows successful build of dtc using both bison/flex and yacc/lex. This patch will need, at least, revision to apply on top of my recent srcpos cleanups. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-02-08 15:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-29 16:31 [PATCH] Modification of lexer and parser, improving dtc portability Lukasz Wojcik
[not found] ` <1264782711-52086-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
2010-02-01 4:46 ` David Gibson
2010-02-04 9:42 ` Lukasz Wojcik
[not found] ` <4B6A9683.300-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
2010-02-08 8:13 ` David Gibson
2010-02-08 8:13 ` David Gibson
2010-02-08 15:31 ` Jon Loeliger
-- strict thread matches above, loose matches on Subject: below --
2010-01-12 13:57 Lukasz Wojcik
[not found] ` <1263304653-71750-1-git-send-email-zbr-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>
2010-01-26 23:11 ` David Gibson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.