From bf21b4768c70e710ff0d4509ae9165c3480dc048 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 21 Aug 2020 13:25:16 +0200 Subject: (Tutorial) Fix to make calculator example compile In abstract: startcat needs to be defined to run the commands that are shown later in the doc. In concrete: ss and SS are defined in Prelude. --- doc/tutorial/gf-tutorial.t2t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/tutorial') diff --git a/doc/tutorial/gf-tutorial.t2t b/doc/tutorial/gf-tutorial.t2t index 525749822..a27af74a0 100644 --- a/doc/tutorial/gf-tutorial.t2t +++ b/doc/tutorial/gf-tutorial.t2t @@ -4200,7 +4200,8 @@ We construct a calculator with addition, subtraction, multiplication, and division of integers. ``` abstract Calculator = { - + flags startcat = Exp ; + cat Exp ; fun @@ -4226,7 +4227,7 @@ We begin with a concrete syntax that always uses parentheses around binary operator applications: ``` - concrete CalculatorP of Calculator = { + concrete CalculatorP of Calculator = open Prelude in { lincat Exp = SS ; -- cgit v1.2.3 From bca0691cb028fe33ae1b77e71752d4e937490ff1 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 31 Aug 2020 15:54:33 +0200 Subject: (Tutorial) Minor typofixes + current error message --- doc/tutorial/gf-tutorial.t2t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/tutorial') diff --git a/doc/tutorial/gf-tutorial.t2t b/doc/tutorial/gf-tutorial.t2t index a27af74a0..469166090 100644 --- a/doc/tutorial/gf-tutorial.t2t +++ b/doc/tutorial/gf-tutorial.t2t @@ -898,7 +898,7 @@ Parentheses are only needed for grouping. Parsing something that is not in grammar will fail: ``` > parse "hello dad" - Unknown words: dad + The parser failed at token 2: "dad" > parse "world hello" no tree found @@ -2948,7 +2948,7 @@ We need the following combinations: ``` We also need **lexical insertion**, to form phrases from single words: ``` - mkCN : N -> NP ; + mkCN : N -> CN ; mkAP : A -> AP ; ``` Naming convention: to construct a //C//, use a function ``mk``//C//. @@ -2969,7 +2969,7 @@ can be built as follows: ``` mkCl (mkNP these_Det - (mkCN (mkAP very_AdA (mkAP warm_A)) (mkCN pizza_CN))) + (mkCN (mkAP very_AdA (mkAP warm_A)) (mkCN pizza_N))) (mkAP italian_AP) ``` The task now: to define the concrete syntax of ``Foods`` so that -- cgit v1.2.3