Doesn't successfully parse grammartest.code, yet, it errors out with a
syntax error on whitespace. But at least it compiles and starts.
Signed-off-by: Jan Lindemann <jan@janware.com>
Arguments to --irrelevant-symbols are not meant to be represented in the
AST resulting from parsing.
Also, add pad() to misc.py.
Signed-off-by: Jan Lindemann <jan@janware.com>
More code is removed from the special parser directories and centralized
into grammar.py, Cmd.py, and generate-flex-bison.mk.
Signed-off-by: Jan Lindemann <jan@janware.com>
grammar.py is meant as a compiler compiler compiler, taking in a grammar
structure and returning flex and bison files. It can also parse EBNF.
Currently there are still remnants of VHDL-specific stuff in the code,
because parsing VHDL was what it was initially about.
Signed-off-by: Jan Lindemann <jan@janware.com>
Quoted arguments were not grouped into one token, firstly, because the
parser didn't pay any attention to them, and secondly, because the data
structure carrying the postfixed string converted it back to being a
string, not a list, in column 2 of the result table.
Signed-off-by: Jan Lindemann <jan@janware.com>
This was a namedtuple before, but I couldn't figure out how to ex-/import it
over module boundaries, so I've made it a class.
Signed-off-by: Jan Lindemann <jan@janware.com>