Linear syntax
Appearance
An editor has nominated this article for deletion. You are welcome to participate in the deletion discussion, which will decide whether or not to retain it. |
Linear syntax is a computer-programming term for an expression that can be parsed from left to right. Linear syntax implies the ability to write code without the use of line-feed or carriage-return characters. Although the use of such characters is recommended for code readability, they are optional, as compilers do not rely on them to parse and compile the code. HTML, C, and SQL code are examples of languages that employ linear syntax; they all rely on commas, semicolons, and parentheses to separate code blocks.
Example
C
Linear example in C:
void main() { printf("Hello world!"); }
Non-linear example in C:
void main() {
printf("Hello world!");
}
HTML
Linear example in HTML:
<ul><li>Foo</li><li>Bar</li><li>Baz</li></ul>
Non-linear example in HTML:
<ul>
<li>Foo</li>
<li>Bar</li>
<li>Baz</li>
</ul>
SQL
Linear example in SQL:
SELECT name FROM users WHERE lvl > 10 ORDER BY firstname;
Non-linear example in SQL:
SELECT name
FROM users
WHERE lvl > 10
ORDER BY firstname