dtc: Cleanup line number tracking, add column number tracking

Our YYLTYPE current carries around first and last line and first and
last column information.  However, of these, on the first line
information is actually filled in properly.

Furthermore, filling in the line number information from yylineno is
kind of clunky: we have to copy its value to the srcfile stack and
back to handle include file positioning correctly.

This patch cleans this up.  We turn off flex's yylineno option and
instead track the line and column number ourselves from
YY_USER_ACTION.  The line and column number are stored directly inside
the srcfile_state structure, so it's automatically a per-file
quantity.  We now also fill in all the yylloc from YY_USER_ACTION.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 files changed