From 400669726b375271d80f3fb2cb85519809ce40b1 Mon Sep 17 00:00:00 2001 From: Chris O'Brien Date: Mon, 16 Jul 2012 08:34:45 -0400 Subject: [PATCH 1/3] Changed # in headers so they have they cascade according to its subtype --- textbook/05-semantic-analysis.md | 52 ++++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/textbook/05-semantic-analysis.md b/textbook/05-semantic-analysis.md index 06fa44e..fbe940d 100644 --- a/textbook/05-semantic-analysis.md +++ b/textbook/05-semantic-analysis.md @@ -51,7 +51,7 @@ TOPICS: Semantic Analysis ================= -### What is semantics? +### What are semantics? @@ -61,7 +61,7 @@ It does so by evaluating the meaning of syntactically legal strings defined by a In such a case that the evaluation would be of syntactically illegal strings, the result would be non-computation. Semantics describes the processes a computer follows when executing a program in that specific language. -### +#### How does this work with the Parse Tree? @@ -69,19 +69,19 @@ Semantics describes the processes a computer follows when executing a program in The Parse Tree is the means by which multi stage compilers check the semantics of a program in a nonlinear fashion. Additional a symbol table is added to the Parse Tree during the semantic analysis. -### +##### What Input is recieved from the parser? -### What are static semantics? +##### What are static semantics? -### + --> +#### @@ -91,102 +91,102 @@ Additional a symbol table is added to the Parse Tree during the semantic analysi 4.2 Process --> -### +#### -### +##### -### +##### -### +###### -### +###### -### +###### -### +####### -### +####### -### +####### -### +##### -### +##### -### +#### -### +##### -### +##### -### +#### -### +##### -### +##### -### +###### -### +###### -### +#### From afdfadc22d7dda33f6d960e337fc41c7da3a4600 Mon Sep 17 00:00:00 2001 From: Chris O'Brien Date: Fri, 10 Aug 2012 12:55:06 -0400 Subject: [PATCH 2/3] added stuff to chapter 3 --- textbook/03-parsing.md | 4 ++++ textbook/05-semantic-analysis.md | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/textbook/03-parsing.md b/textbook/03-parsing.md index 78b10e6..b2644bc 100644 --- a/textbook/03-parsing.md +++ b/textbook/03-parsing.md @@ -97,15 +97,19 @@ Thus, it is impossible to construct a regular expression (but possible to constr Give examples. ### What is a leftmost derivation? +The leftmost derivation is the always the leftmost nonterminal. ### What is a rightmost derivation? +The rightmost derivation is always the rightmost nonterminal. ### What is an ambiguous grammar? ### What is a LL(k) grammar? +LL(k) grammar allows parsing by direct construction of a leftmost derivation, and describe even fewer languages. ### What is a LR(k) grammar? + ### What is Backus-Naur Form? A BNF specification is a set of derivation rules, written as diff --git a/textbook/05-semantic-analysis.md b/textbook/05-semantic-analysis.md index fbe940d..ec6aa51 100644 --- a/textbook/05-semantic-analysis.md +++ b/textbook/05-semantic-analysis.md @@ -67,7 +67,7 @@ Semantics describes the processes a computer follows when executing a program in --> The Parse Tree is the means by which multi stage compilers check the semantics of a program in a nonlinear fashion. -Additional a symbol table is added to the Parse Tree during the semantic analysis. +Additionally a symbol table is added to the Parse Tree during the semantic analysis. ##### What Input is recieved from the parser? + + ####