Difference between revisions of "Syntax"

From Mario Fan Games Galaxy Wiki
m (Created page with 'The '''syntax''' of a programming language is the set of rules that defines what combination of identifiers and other symbols are allowed. It is one of the factors that different…')
 
m
 
Line 1: Line 1:
 
The '''syntax''' of a programming language is the set of rules that defines what combination of identifiers and other symbols are allowed. It is one of the factors that differentiates between languages, at least visually.  
 
The '''syntax''' of a programming language is the set of rules that defines what combination of identifiers and other symbols are allowed. It is one of the factors that differentiates between languages, at least visually.  
  
Complexity of syntax varies across languages, with some having very rules and others having extensive rules allowing for a lot of [[syntactic sugar]]. [[Syntax highlighting]] is a method of making source code more readable (by using different colors, font weights or sizes, etc.) by applying these styles to certain elements such as [[keywords]] and [[operators]].
+
Complexity of syntax varies across languages, with some having very rules and others having extensive rules allowing for a lot of [[syntactic sugar]]. Syntax highlighting is a method of making source code more readable (by using different colors, font weights or sizes, etc.) by applying these styles to certain elements such as keywords and [[operators]].
  
Many languages share similar syntax for various reasons, often familiarity. This is apparent in "curly-brace" languages like [[C]] and [[C++]], Java, and Javascript, and among the different Lisp dialects. Otherwise, differences may be due to aesthetic preference, ease of parsing, convenience, or many other reasons.
+
Many languages share similar syntax for various reasons, often familiarity. This is apparent in "curly-brace" languages like C and [[C++]], Java, and Javascript, and among the different Lisp dialects. Otherwise, differences may be due to aesthetic preference, ease of parsing, convenience, or many other reasons.
  
 
Special notations such as BNF are often used to define the syntax of a language, though it can't represent semantic limitations that may otherwise appear as valid syntax.
 
Special notations such as BNF are often used to define the syntax of a language, though it can't represent semantic limitations that may otherwise appear as valid syntax.
  
 
[[Category:Languages]]
 
[[Category:Languages]]

Latest revision as of 20:30, 27 August 2013

The syntax of a programming language is the set of rules that defines what combination of identifiers and other symbols are allowed. It is one of the factors that differentiates between languages, at least visually.

Complexity of syntax varies across languages, with some having very rules and others having extensive rules allowing for a lot of syntactic sugar. Syntax highlighting is a method of making source code more readable (by using different colors, font weights or sizes, etc.) by applying these styles to certain elements such as keywords and operators.

Many languages share similar syntax for various reasons, often familiarity. This is apparent in "curly-brace" languages like C and C++, Java, and Javascript, and among the different Lisp dialects. Otherwise, differences may be due to aesthetic preference, ease of parsing, convenience, or many other reasons.

Special notations such as BNF are often used to define the syntax of a language, though it can't represent semantic limitations that may otherwise appear as valid syntax.