Syntax comments

Jayakumar Muthukumarasamy ([email protected])
Fri, 6 Jan 1995 16:55:13 -0500 (EST)

Hi,

I am still uneasy with the keyword/value syntax. While it is true
that keyword/value syntax is easy to parse and learn, I don't think that
special syntax is necessarily difficult. On the contrary, if we can design
the syntax carefully, I feel the readability/understand-ability of a model
written using a special syntax will be much more than one written using
keyword/value syntax. e.g. consider the example that Pedro mentioned. I think
the following syntax is more visible/readable than a keyword/value syntax. The
disadvantages are this has more keywords, and requires changes to the parser
when attributes are added or removed. Also, a parser written for this syntax
will need more work and will probably be bigger too. But, I think the
syntax below is more readable than keyword/value syntax. Ofcourse, I don't
know what the consensus opinion on this one is. (My guess is there are
three opinions corresponding to three groups of people, one group which
likes c/c++, another group which likes lisp, and a third group which hates
both :-)).

Template My_Template {

Guides {
Guide g1 {
direction equals VERTICAL,
position equals 50,
margin_1 equals 4,
margin_2 equals 3,
}

Guide g2 {
direction equals VERTICAL,
position equals 290,
margin_1 equals 0,
margin_2 equals 6,
}
}

Grids {
Grid {
direction equals HORIZONTAL,
stretchable equals FALSE,
distance equals 50,
start equals g1,
end equals g2,
}
}

Parts {
Template {
}

Template {
}

Button is_a building_blocks/button {
}
}
}

It is probably going to take sometime for us to design a special
syntax. But I think it is worth it, since this is something we will have
to live with for the rest of the time. Also, what I see as a potential
advantage of special syntax is that, the different models need not
conform to one syntax. This could be seen as a disadvantage too. But,
I think it is not, since the different models will probably be modelled
by different people.

-jk