arch: clean up isa_parser error handling
authorSteve Reinhardt <steve.reinhardt@amd.com>
Wed, 7 Oct 2015 00:26:50 +0000 (17:26 -0700)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Wed, 7 Oct 2015 00:26:50 +0000 (17:26 -0700)
commit90c279e4b1ddb87780b667ccec6bda64e6a77b96
tree2c107a2b5db1a2764a1e853fd2401f449aaeb163
parent2511490c9cf988797afb613040c256fc06b684e0
arch: clean up isa_parser error handling

Although some decent error messages were getting generated inside
isa_parser.py, they weren't always getting printed because of the
screwy way we were handling exceptions.  (Basically an inner
exception would get hidden by an outer exception, and the more
informative inner error message would not get printed.)

Also line numbers were messed up, since they were taken from the
lexer, which is typically a token (or more) ahead of the grammar
rule that's being matched.  Using the 'lineno' attribute that
PLY associates with the grammar production is more accurate.
The new LineTracker class extends lineno to track filenames as
well as line numbers.
src/arch/isa_parser.py