[PATCH] Modification of lexer and parser, improving dtc portability.

Lukasz Wojcik zbr at semihalf.com
Wed Jan 13 00:57:33 EST 2010


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



More information about the devicetree-discuss mailing list