Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Statement (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Statements and keywords=== Some programming language grammars [[reserved word|reserve keywords]] or [[Stropping (syntax)|mark them specially]], and do not allow them to be used as [[Identifier (computer languages)|identifiers]]. This often leads to [[Formal grammar|grammars]] which are easier to [[parsing|parse]], requiring less [[Parsing#Lookahead|lookahead]]. ====No distinguished keywords==== Fortran and PL/1 do not have reserved keywords, allowing statements like: * in PL/1: **<code>IF IF = THEN THEN ...</code> (the second <code>IF</code> and the first <code>THEN</code> are variables). * in Fortran: **<code>IF (A) X = 10... </code> conditional statement (with other variants) **<code>IF (A) = 2 </code> assignment to a subscripted variable named <code>IF</code> ::As spaces were optional up to Fortran 95, a typo could completely change the meaning of a statement: :*<code>DO 10 I = 1,5 </code> start of a loop with I running from 1 to 5 :*<code>DO 10 I = 1.5 </code> assignment of the value 1.5 to the variable <code>DO10I</code> ====Flagged words==== {{main|Stropping (syntax)}} In Algol 60 and Algol 68, special tokens were distinguished explicitly: for publication, in boldface e.g. <code>'''begin'''</code>; for programming, with some special marking, e.g., a flag (<code>'begin</code>), quotation marks (<code>'begin'</code>), or underlined (<code><u>begin</u></code> on the [[Elliott 503]]). This is called "stropping". Tokens that are part of the language syntax thus do not conflict with programmer-defined names. ====Reserved keywords==== {{main|Reserved word}} Certain names are reserved as part of the programming language and can not be used as programmer-defined names. The majority of the most popular programming languages use reserved keywords. Early examples include [[FLOW-MATIC]] (1953) and [[COBOL]] (1959). Since 1970 other examples include Ada, C, C++, Java, and Pascal. The number of reserved words depends on the language: C has about 30 while COBOL has about 400.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)