473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

modeling language for xml

I've discovered that the C preprocessor is powerful enough to create a cheap
object modeling language for XML (or any structured data format). Check
out http://world.std.com/~jhallen/sdu.html The library is not very
complete, but I wanted to get something out there.

A schema looks like this:

STRUCT(root,
STRING(title)
INTEGER(size)
LIST(items,item)
)

STRUCT(item,
STRING(name)
INTEGER(price)
)

This gets fed into two sets of C preprocessor macros. One drives the XML
parser. The other converts the schema into C structures, so that after
parsing you end up with a tree of these data structures:

struct root
{
/* Standard header (base class) */
struct root *next; /* Next in list */
struct meta *_meta; /* Definition of this for parser/printer */

/* User members */
char *title;
int size;
struct item *items;
};

struct item
{
struct root *next;
struct meta *_meta;

char *name;
int price;
};

It's nice because the modeling language names appear as first class member
names in C.
--
/* jh*****@world.std.com (192.74.137.5) */ /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
Jul 20 '05 #1
0 1094

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bishara Gabriel | last post by:
I encourage feedback from all parties and especially those which would like to be directly involved (I may include you in the grant proposal and budget). Send me your comments! -------> ...
0
by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have...
9
by: Dean Ware | last post by:
I am trying to construct a model for use in a video game Basically I have boiled things down to the following situation that needs to be modelled:
1
by: Markus Seibold | last post by:
Hi, I am looking for an open source (free) data modeling tool for PostgreSQL. It should - if possible - support: - E-R-Modelling - relational data model / modeling - (GUI SQL interface to...
1
by: Mike | last post by:
I'm starting up on big project that will take much of my time in next year or two. Until now I was mostly self-employed on small projects so I didn't spent so much time modeling system before...
4
by: shalafi | last post by:
Looking for a good, cheap (preferrably free) UML modeling tool. Used Jumli in the past, has everything i want but it isnt terribly stable and doesnt look as if they will have a new version anytime...
1
by: Ronald S. Cook | last post by:
I'm learning DeKlarit, a RAD modeling tool that creates business and data logic to speed development. It seems pretty cool, but I'm just so used to writing these layers myself. I can understand...
25
by: Thomas R. Hummel | last post by:
I'm going to try to describe this situation as best as I can, but if anything is unclear please let me know. Some of this database was already in place before I arrived on the scene, and I don't...
1
by: emekadavid | last post by:
am newbie to xml. can one do modeling in xml and if yes, how? tanx
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.