Hi, does anyone know where I can get a formal Backus-Naur style syntax
and/or grammar definition for any of the various SPICEs out there?
I doubt that you can. I had a look some time ago, and one stumbling block is the
fact that tokens can mean different things depending on where they occur. While
it is possible to describe grammers with this property in some scanner/parser
generator systems, I doubt that BFN or its ilks will do.
Consider
R R 0 R
which describes a resistor (line starts with 'R') from node R to node 0 with the
value R. This is legal in hspice input language and other extensions of the
Berkeley Spice input language (expecting a defintion of the value of the
parameter 'R,' of course) but makes scanning/parsing a challenge.
I would love to see such a grammar, but didn't find one when I was looking for
it.
That said, the original Berkely Spice 2 accepted such a simple input language
that a formal description should be possible.
Best Regards
Jens