• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

Revision9d8882fe02d41d135048ea7fda74ae663512296f (tree)
Time2022-01-22 23:32:41
AuthorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

Stored Ideas/TypeHintedPEG/

Change Summary

Incremental Difference

diff -r 96cdb355f5dc -r 9d8882fe02d4 Ideas/TypeHintedPEG/readme.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Ideas/TypeHintedPEG/readme.rst Sat Jan 22 15:32:41 2022 +0100
@@ -0,0 +1,40 @@
1+.. (C) ALbert Mietus, 2022, Part of CCastel(2).
2+
3+Type-Hinted PEGs (or other grammar)
4+===================================
5+
6+The transitional (PEG-)syntax is like:
7+
8+.. code-block:: peg
9+
10+ single_expr <- ( rule_crossref
11+ | term
12+ | group
13+ | predicate
14+ ) ( '?' | '*' | '+' | '#' )? ;
15+
16+The question is: *“Can we use *TypeHits* (similar as in python)”*?
17+
18+Surely, that is possible. Then we get something like below, where (only) the result//lhs has a type hint
19+
20+.. code-block:: peg
21+
22+ single_expr:SingleExpr <- ( rule_crossref
23+ | term
24+ | group
25+ | predicate
26+ ) ( '?' | '*' | '+' | '#' )? ;
27+
28+Or even
29+.. code-block:: peg
30+
31+ single_expr <- ( rule_crossref : ID
32+ | term:Term
33+ | group: Sequence
34+ | predicate:Predicate
35+ ) ( '?' | '*' | '+' | '#' )? ;
36+
37+The idea is to make it more readable, but also *TypeHints* may be useful for
38+* ?*Vistors*?
39+* Type Checking
40+* to be discovered