diff options
author | David Gibson <dgibson@sneetch.(none)> | 2005-10-19 16:00:31 +1000 |
---|---|---|
committer | David Gibson <dgibson@sneetch.(none)> | 2005-10-19 16:00:31 +1000 |
commit | 86dbcbd1e421700feeae2fc83db9e464f7964262 (patch) | |
tree | f9cfdffed86b3a3eb297964a5cd423aa76085431 /dtc-parser.y | |
parent | b4ac04952a2d8489cb28c5d0a3872d4a35dc58d2 (diff) | |
download | dtc-86dbcbd1e421700feeae2fc83db9e464f7964262.tar.gz |
Rudimentary support for reporting the line number of syntax errors.
Diffstat (limited to 'dtc-parser.y')
-rw-r--r-- | dtc-parser.y | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dtc-parser.y b/dtc-parser.y index 66e243d..1bfbfa3 100644 --- a/dtc-parser.y +++ b/dtc-parser.y @@ -18,6 +18,9 @@ * USA */ +%glr-parser +%locations + %{ #include "dtc.h" @@ -69,8 +72,6 @@ extern struct boot_info *the_boot_info; %type <str> label %type <str> nodename -%glr-parser - %% sourcefile: memreserves devicetree { @@ -160,5 +161,5 @@ label: DT_LABEL { $$ = $1; } void yyerror (char const *s) { - fprintf (stderr, "%s\n", s); + fprintf (stderr, "%s at line %d\n", s, yylloc.first_line); } |