[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
For example, the calculator calculates properly because the value associated with each expression is the proper number; it adds properly because the action for the grouping ‘x + y’ is to add the numbers associated with x and y.
3.4.1 Data Types of Semantic Values | Specifying one data type for all semantic values. | |
3.4.2 More Than One Value Type | Specifying several alternative data types. | |
3.4.3 Generating the Semantic Value Type | Generating the semantic value type. | |
3.4.4 The Union Declaration | Declaring the set of all semantic value types. | |
3.4.5 Providing a Structured Semantic Value Type | Providing a structured semantic value type. | |
3.4.6 Actions | An action is the semantic definition of a grammar rule. | |
3.4.7 Data Types of Values in Actions | Specifying data types for actions to operate on. | |
3.4.8 Actions in Mid-Rule | Most actions go at the end of a rule. This says when, why and how to use the exceptional action in the middle of a rule. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 1, 2013 using texi2html 5.0.