Top Definition For Syntax

DeleteWhenCooked

This is TOPMIND's working definition for the word "syntax":

{Note that TopMind did not create this topic.}

To me, "syntax" is a string that does not have built-in separators between the "elements". When they are formally separated and the boundaries or isolation is directly encoded, such as put into a tree, it is not "syntax", but a "structure". A structure isolates "atoms" of the expression, while a syntactical expression leaves that to the reader or parser.

Syntax:

  x = a + (b * c)
Structure:

Please don't redefine well-established terminology. What you call syntax is ConcreteSyntax?; what you call structure is AbstractSyntax? (or an AbstractSyntaxTree).

<http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?concrete+syntax> <http://www.cs.dartmouth.edu/~cs68/02w/lecture-01-07a.html>

Aren't they just different manifestations of the same thing? If not, what is the difference?

No, they are not the same things. Concrete syntax requires additional rules to create the tree. Concrete syntax is effectively a string, a syntax tree is a tree. They are not the same thing, and to think they are exposes confusion at a deep level.


No need to create a new topic when SyntaxDefinition is still small.

Oh, but it's very much needed because you deserve your own definitions. Are you afraid of your brand name?

Wiki is not about ArgumentFromAuthority.


Actually, there are numerous definitions of "syntax" both in the literature and in English proper; which one is correct depends on context. The two of you (TopMind and Costin) are being rather unproductive when you argue which definition should apply; 'tis easier to clarify than to invoke LaynesLaw.

{I am not arguing which should be right, I am arguing that the definition is too open-ended to deserve to be in THE definition for types. A definition does not deserve to barge in and shove the other ones to the side unless it is precise and simple. -- top}

Actually, I'd like to see any reference at all to a definition that resembles Top's. I posit that Top just came up with the above in a HumptyDumpty move, and if nobody can produce any definition where "syntax is a string ...", that will just confirm my hypothesis. It's not unproductive to insist that we do not go HumptyDumpty about standard terms in computing science.

What the hell are these "standards", and who decides what gets to be standard? -- top

Standards bodies, for one. The community that adopts de facto standards, for another. Leg snort fungible sand blue clock. Isn't it nice that we all agree on the meanings of words and don't just pick our own? Standards.

Standards bodies generally do not define words, except for specific contexts.

The intellectual marketplace decides for definitions and meaning of terms for another. All the people who followed a formal ComputingScience or SoftwareEngineering curriculum in the past 30 years will have been taught the same or very convergent ideas about basic things related to formal languages, compilers, algorithms, etc. Also, older people or people without formal education but who bought books by reputed authors and studied to improve their knowledge and their value in the marketplace, those people will also have the same ideas about basic notions in computing science.

What's the source where we can trace your definition that "syntax is a string that does not have 'built-in separators' between elements"?. Did you get it from somewhere or did it just pop into your head? In the latter case, you're the HumptyDumpty of this wiki.


Sorry, I'm new here, but I've read the whole back and forth over the word "syntax" and I'm repressing a need to smack Top upside the head. Here's the dictionary definition of "syntax": [http://dictionary.reference.com/search?q=syntax]

    1. The study of the rules whereby words or other elements of sentence structure are combined to form grammatical sentences.
    2. A publication, such as a book, that presents such rules.
    3. The pattern of formation of sentences or phrases in a language.
    4. Such a pattern in a particular sentence or discourse.
  1. Computer Science. The rules governing the formation of statements in a programming language.
  2. A systematic, orderly arrangement.

Your redefining of it is absurd and is getting in the way of what he's trying to say. A syntax is a set of rules. Specifically, it's the set of rules that make up a grammar. What you're calling "syntax" is a specific kind of syntactic expression. Now, I'm not even clear exactly what you're trying to get at with your redefinition, but your definition of syntax has no basis anywhere in either computing or in English. There's no such thing as a string which is "syntax". It's an abstract, separate from any representation of it. As a RelationalWeenie, this should be a familiar concept. -- ChrisMellon?

If you view DataAndCodeAreTheSameThing and believe in SyntaxFollowsSemantics, then something being represented as a string or something else, such as an AbstractSyntaxTree, is a matter of preferred manifestation. Rules alone did not distinguish anything. Lot's of stuff has rules. However, my working definition is really immaterial to Costin's arguments. The real issue being his vague definition, regardless of which manifestation of a grammar is used. I don't care which definition you use as long as it is clear. Depending on a vague global gestalt is not good enough in this biz. -- top

Rules are the definition by which you distinguish something, at least when you're talking about language. A language is defined by its syntax as much as by its semantics.

What is the clear-cut distinction?

[Syntax is the rules that define a valid statement. Semantics is the meaning of that statement.]

Even a meta-language, where you work directly on the syntax elements, still has syntax, and there are other syntaxes involved, such as the syntax used by the query language you use to manipulate the syntax tree. Now, as to human languages, effective communication is based on global consensus of definitions. His definition of "syntax" was not vague - he was arguing for the universal definition, which I've quoted specifically above. What you were claiming was sufficiently out in left field that you might as well have been calling it soccer.

Yes, syntax involves rules, but so do a lot of other things. One needs to find a clear-cut distinction between "syntax rules" (grammar rules?) and other kinds of rules. Having rules might be necessary, but is it sufficient? You are welcome to reject my definition, but we still need a clear alternative to deal with the "type" issue (WhatAreTypes).

[Eh? Now you're confusing me. What rules are you confusing with syntax rules?]

... I've just read SyntaxFollowsSemantics. It's the same problem - you're confusing strings with syntax. Parse trees are syntax. Syntax highlighting in an editor is NOT a new syntax, it's a new textual representation. Looking at rendered HTML rather than HTML source does not change HTML syntax. There's no such thing as a language without syntax - such a thing would be a language without grammar or structure and therefore would be useless for communication. The CLR and IL doesn't have anything to do with removing the need for syntax - IL has its own syntax and you can write directly in it. You can't take IL and generate the original C# code for it, especially if it was actually written in VB.NET. All the languages supported by your hypothetical intermediate form would have to have exactly the same syntactic richness, otherwise you'd lose information going from one to the other. It's a leaky abstraction. Every one of your supported languages would have to have one and only one way of expressing any given concept. Furthermore, much of what makes code usable by humans isn't syntactic - you can auto-generate C from any number of languages using any number of tools, but the resulting code isn't something that's useful for humans to work on. And, of course, it's another 1-way transition - I defy anyone to write a useful C-to-Python compiler.

Re: "Parse trees are syntax"

But are all trees syntax? What is the clear difference between a parse-tree and a non-parse tree? "I know it when I see it" is not good enough for definition issues. I think this was brought up under TopOnTypes IIRC.

[A parse tree is a tree produced by parsing something. I'm not sure why you're confusing them with other types of trees. If you didn't produce it by parsing something, it's not a parse tree. I think you're reading far, far too much into the word "syntax" and want it to take on some sort of existential meta-meaning. Syntax are rules by which you extract meaning (see definition above). A rule that doesn't apply to syntax is obviously not a syntax rule. You don't need extensive navel-gazing here, it's a pretty simple concept.]

But the origin of the tree certainly cannot be part of a useful definition. Such a definition would not say anything about the nature of the thing itself.


There are two issues here:


EditText of this page (last edited January 17, 2006) or FindPage with title or text search