emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/parser-generator a18a23d 172/434: Updated info about SD


From: ELPA Syncer
Subject: [elpa] externals/parser-generator a18a23d 172/434: Updated info about SDT and SA
Date: Mon, 29 Nov 2021 15:59:34 -0500 (EST)

branch: externals/parser-generator
commit a18a23df4f51c083ff6628baee7ab3c06badcedc
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Updated info about SDT and SA
---
 docs/Syntax-Analysis.md | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/docs/Syntax-Analysis.md b/docs/Syntax-Analysis.md
index fc1b0f1a..f609665 100644
--- a/docs/Syntax-Analysis.md
+++ b/docs/Syntax-Analysis.md
@@ -78,11 +78,23 @@ Is a simple integer above zero. You set it like this: 
`(parser-generator-set-loo
 
 ### Syntax-directed-translation (SDT)
 
-*WIP* Where should this be defined?
+A optional translation is defined as a lambda function as the last element of 
a production right-hand-side, example:
+
+```
+(parser-generator-set-grammar '((Sp S) ("a" "b") ((Sp S) (S (S "a" S "b" 
(lambda(args) (nreverse args)))) (S e)) Sp))
+```
+
+You cannot have a SDT+SA on the same production right-hand side, just one or 
the other.
 
 ### Semantic-actions (SA)
 
-*WIP* Where should this be defined?
+A optional semantic-action is defined as a lambda function as the last element 
of a production right-hand-side, example:
+
+```
+(parser-generator-set-grammar '((Sp S) ("a" "b") ((Sp S) (S (S "a" S "b" 
(lambda(args) (nreverse args)))) (S e)) Sp))
+```
+
+You cannot have a SDT+SA on the same production right-hand side, just one or 
the other.
 
 ## Functions
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]