On Mon, 2008-02-18 at 15:08 -0500, Stuart Brorson wrote:
> Dare I suggest that some type of XML or XML-like tree structured
> format might be a good thing? I don't necessarily like XML, but I do
> appreciate the advantages of having a file format which is extensible,
> i.e. we can add new tags while not breaking older parsers. Maybe
> there's a way to do that using a line-oriented file format?
This is the biggest plus point for XML in my opinion.
We could also achieve name-spacing of directives with a line-based
format too, and assuming each directive line defines how many more lines
to "skip" if you don't understand this tag, then we could be on a
winner.
PCB:Element 5 "DIP14" "X3/U1" "unknown" 741000 409000 5000 -17000 0 100
PCB:Pin 0 0 0 6000 3000 6600 2800 "A" "1" "square,edge2"
PCB:Pin 0 10000 0 6000 3000 6600 2800 "B" "2" "edge2"
PCB-3D:Encoded-model 2
fhjklafhjklashfhfjksbsfbnasbfnbjhfbanmsbfnmbanmfbnmfbnm,asfafjdfjkjf
fajdfljdfkljklfjfjklfjlafjkldfkldfklsdfjkdfjkldfjkldfjkdfjkldfsjkldf
PCB:Element 5 "DIP14" "X3/U2" "unknown" 741000 409000 5000 -17000 0 100
PCB:Pin 0 0 0 6000 3000 6600 2800 "A" "1" "square,edge2"
PCB:Pin 0 10000 0 6000 3000 6600 2800 "B" "2" "edge2"
PCB-3D:Encoded-model 2
fhjklafhjklashfhfjksbsfbnasbfnbjhfbanmsbfnmbanmfbnmfbnm,asfafjdfjkjf
fajdfljdfkljklfjfjklfjlafjkldfkldfklsdfjkdfjkldfjkldfjkdfjkldfsjkldf
This is semi-borrowed from gschem, where text objects list a number of
lines. Semi XML (namespacing), and semi-PCB (indenting, and formatting
of the Element / Pin lines after the
"Namespace:Tag Num_lines_contained_after ...."
The idea here is of course, if I don't understand the "PCB-3D"
namespace, or the "Encoded-model" tag, I would know to skip the next two
lines of input.
I guess it would have to be up to the parser at each stage to decide if
the tag's "contained" lines should be further run through the main
parser, or (say in the 3D model case above), fed to a different process,
such as a base64 decoder.
The downside I see with this format is that manual editing would require
updates of line-counts, which could cause grief.
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev