- Hi guys,
I get the feeling I'm the only one parsing *binary* files... I've got a
couple of suggestions which
would make debugging easier:
(1) tracking the character number, rather than just the line and/or
column number, is essential
to finding where input is not being matched.
(2) when input is mismatched it's not very useful to display a binary
character on a terminal
without also giving it's code (in hexadecimal say). Ideally both the
character and it's code are
displayed. A simple test along the lines of the standard C library's
isprint function can be used
to determine if a code is printable and '.' could be displayed for
Also I came across a problem using multiple dot ('.' excluding quotes)
chars in the grammar to
match sequences of 'anything'. I had to put spaces between all the dots
to avoid a mismatch
with the range operator '..'. Getting a little bit picky I know, but I
thought I'd mention it just in case
you hadn't intended this behaviour.
I must say ANTLR is nice to use though... keep up the great work guys!
Pharos Systems Ltd