Presentation is loading. Please wait.

Presentation is loading. Please wait.

ISBN 0-321-19362-8 Chapter 3 Describing Syntax and Semantics.

Similar presentations


Presentation on theme: "ISBN 0-321-19362-8 Chapter 3 Describing Syntax and Semantics."— Presentation transcript:

1 ISBN 0-321-19362-8 Chapter 3 Describing Syntax and Semantics

2 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-2 Figure 3.1 A parse tree for the simple statement A = B * (A + C)

3 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-3 Figure 3.2 Two distinct parse trees for the same sentence, A = B + (A * C)

4 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-4 Figure 3.3 The unique parse tree for A = B + (A * C) using an unambiguous grammar

5 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-5 Figure 3.4 A parse tree for A = B + (A + C) illustrating the associativity of addition

6 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-6 Figure 3.5 Two distinct parse trees for the same sentenial form

7 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-7 Figure 3.6 A parse tree for A = A + B

8 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-8 Figure 3.7 The flow of attributes in the tree

9 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-9 Figure 3.8 A fully attributed parse tree

10 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-10 Figure 3.9 A parse tree of the binary number 110

11 Copyright © 2004 Pearson Addison-Wesley. All rights reserved.3-11 Figure 3.10 A parse tree with denoted objects for 110


Download ppt "ISBN 0-321-19362-8 Chapter 3 Describing Syntax and Semantics."

Similar presentations


Ads by Google