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
ALGOL W
(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!
== Syntax and semantics == ALGOL W's [[Syntax (programming languages)|syntax]] is built on a subset of the [[EBCDIC]] [[character encoding]] set. In [[ALGOL 60]], reserved words are distinct lexical items, but in ALGOL W they are only sequences of characters, and do not need to be [[Stropping (syntax)|stropped]]. Reserved words and identifiers are separated by spaces.<ref name="Stanford"/> In these ways ALGOL W's syntax resembles that of [[Pascal (programming language)|Pascal]] and later languages. The ''ALGOL W Language Description''<ref name="description">{{cite report |last1=Bauer |first1=Henry R. |last2=Becker |first2=Sheldon I. |last3=Graham |first3=Susan L. |last4=Satterthwaite |first4=Edwin H. |last5=Sites |first5=Richard L. |date=June 1972 |title=ALGOL W Language Description |url=https://www.algol60.org/docsW/algolw.pdf}}</ref> defines ALGOL W in an [[affix grammar]] that resembles [[Backus–Naur form]] (BNF). This [[formal grammar]] was a precursor of the [[Van Wijngaarden grammar]].<ref name="Wirth"/><ref>{{cite report |last=van Wijngaarden |first=Adriaan |author1-link=Adriaan van Wijngaarden |date=22 October 1965 |title=Orthogonal Design and Description of a Formal Language: MR76 |url=http://web.eah-jena.de/~kleine/history/languages/VanWijngaarden-MR76.pdf |publisher=Mathematical Centre |place=[[Amsterdam]], Netherlands |via=Ernst-Abbe-Hochschule [[Jena]], University of Applied Sciences, Germany |access-date=2020-10-07 |archive-date=29 October 2019 |archive-url=https://web.archive.org/web/20191029151436/http://web.eah-jena.de/%7Ekleine/history/languages/VanWijngaarden-MR76.pdf |url-status=dead }}</ref> Much of ALGOL W's semantics is defined grammatically:<ref name="description"/> * Identifiers are distinguished by their definition within the current [[Scope (programming)|scope]]. For example, a <code>⟨procedure identifier⟩</code> is an identifier that has been defined by a procedure declaration, a <code>⟨label identifier⟩</code> is an identifier that is being used as a [[goto]] label. * The [[Type system|types]] of [[Variable (computer science)|variables]] and [[Expression (computer science)|expressions]] are represented by affixes. For example <code>⟨τ function identifier⟩</code> is the syntactic entity for a function that returns a value of type <code>τ</code>, if an identifier has been declared as an integer function in the current scope then that is expanded to <code>⟨integer function identifier⟩</code>. * Type errors are grammatical errors. For example, <code>⟨integer expression⟩ / ⟨integer expression⟩</code> and <code>⟨real expression⟩ / ⟨real expression⟩</code> are valid but distinct syntactic entities that represent expressions, but <code>⟨real expression⟩ DIV ⟨integer expression⟩</code> (i.e., integer division performed on a floating-point value) is an invalid syntactic entity.
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)