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?
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.
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]
I learned addition in /elementary/ school - so is addition elementary?
Or is it composite? The reader has to know - or be told - that in the
context of compiling "2" should be considered elementary but "1 + 1"
should be considered composite.
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]
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 491 |
Nodes: | 16 (2 / 14) |
Uptime: | 86:37:30 |
Calls: | 9,679 |
Files: | 13,722 |
Messages: | 6,173,652 |