Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Roger L Costello Newsgroups: comp.compilers Subject: What is the semantics of a language? Date: Sat, 22 Jan 2022 00:08:35 +0000 Organization: Compilers Central Lines: 32 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-01-081@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="12654"; mail-complaints-to="abuse@iecc.com" Keywords: semantics, comment Posted-Date: 21 Jan 2022 22:24:08 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Content-Language: en-US authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mitre.org; Xref: csiph.com comp.compilers:2851 Hello Compiler Experts! Ah! I found the answer to the question: What is the semantics of a language? Section 3.4 of the Bison specification [1] has the answer: 3.4 Defining Language Semantics The grammar rules for a language determine only the syntax. The semantics are determined by the semantic values associated with various tokens and groupings, and by the actions taken when various groupings are recognized. Niklaus Wirth agrees with the Bison specification. In the introduction of his book, Compiler Construction, he says [2]: The translation process is now guided by the structure of the analysed text. The text is decomposed, parsed into its components according to the given syntax. For the most elementary components, their semantics is recognized, and the meaning (semantics) of the composite parts is the result of the semantics of their components. Naturally, the meaning of the source text must be preserved by the translation. Do you agree that that is the definition of the semantics of a language? /Roger [1] Section 3.4 of the Bison specification: https://www.gnu.org/software/bison/manual/bison.html#Semantics [2] See page 6, fourth paragraph in Compiler Construction by Niklaus Wirth: https://people.inf.ethz.ch/wirth/CompilerConstruction/CompilerConstruction1.pdf [That's one definition. But I suspect we will hear it's far from the only one. -John]