Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Reserved word
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
==Distinction== When using an Interactive Development Environment (IDE) to develop a program, the IDE will generally highlight reserved words by displaying them in a different colour. In some IDEs, comments may also be highlighted (in yet another colour). This makes it easy for a programmer to notice unexpected use of a reserved word and/or failure to terminate a comment correctly. There may be reserved words which are not keywords. For example, in Java, <code>true</code> and <code>false</code> are reserved words used as Boolean (logical) literals. As another example, in Pascal, <code>div</code> and <code>mod</code> are reserved words used as operators (integer division and remainder). There may also be reserved words which have no defined meaning. For example, in Java, <code>goto</code> and <code>const</code> are listed as reserved words, but are not otherwise mentioned in the Java syntax rules. A keyword such as '''if''' or '''while''' is used during [[parser|syntax analysis]] to determine what sort of statement is being considered. Such analysis is much simpler if keywords are either reserved or stropped. Consider the complexity of using contextual analysis in Fortran 77 to distinguish: IF (B) l1,l2 ! two-way branch, where B is a boolean/logical expression IF (N) l1,l2,l3 ! three-way branch, where N is a numeric expression IF (B) THEN ! start conditional block IF (B) THEN = 3.1 ! conditional assignment to variable THEN IF (B) X = 10 ! single conditional statement IF (B) GOTO l4 ! conditional jump IF (N) = 2 ! assignment to a subscripted variable named IF PL/I can also allow some apparently confusing constructions: IF IF = THEN THEN ... /* (the second <code>IF</code> and the first <code>THEN</code> are variables */
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Reserved word
(section)
Add topic