Question:
Syntax and semantics of a programming language?
Shaun J
2009-09-09 08:47:32 UTC
I am currently taking Introduction to Java at my community college and I switched my major from Computer Info Systems to Computer Science not realizing CS in for programming majors and I'm on the hardware side which means I need to be in CIS. So I have NO clue what-so-ever Java is about and I need to get a "C" to pass this class. So can someone help me out with this please.

What is the syntax and semantics of a programming language?
Three answers:
2009-09-09 09:30:04 UTC
A language is a set of valid sentences. What makes a sentence valid? You can break validity down into two things: syntax and semantics. The term syntax refers to grammatical structure whereas the term semantics refers to the meaning of the vocabulary symbols arranged with that structure. Grammatical (syntactically valid) does not imply sensible (semantically valid), however. For example, the grammatical sentence "cows flow supremely" is grammatically ok (subject verb adverb) in English, but makes no sense. Similarly, in a programming language, your grammar (syntax rules) may allow ID EQUALS ID but the language may only allow the sentence if the text matched for ID does not represent a type name (a semantic rule).
Mechanic
2009-09-09 09:00:57 UTC
Syntax refers to the order of keywords and operators used by a programming language. There are several possible semantics to a programming language, but in general it refers to the meaning of a syntactically correct statement in the language.
?
2016-12-02 07:52:36 UTC
The Leetcoders programming dialogue board might have the respond you're finding for. The contributors are very helpful, so which you may make a clean thread or use the seek function for a rapid answer. They do all styles of stuff on the topic remember of technologies so its actual a sturdy guess. desire this helped.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...