From 199758d97ded61b80a67f997b823c4d0d87deb43 Mon Sep 17 00:00:00 2001 From: Veit Heller Date: Sun, 17 Apr 2022 19:48:45 +0200 Subject: [PATCH] Multiple changes: - Add the book and a few first pages - Add the code generator --- lepiter/98eic2d1mangtosf26n3aq420.bak | 374 +++++++++++++ lepiter/98eic2d1mangtosf26n3aq420.lepiter | 411 ++++++++++++++ lepiter/98eic2dxfcnj2jji36yacsexj.bak | 113 ++++ lepiter/98eic2dxfcnj2jji36yacsexj.lepiter | 113 ++++ lepiter/98eic2dywhmaij4eonyqv7aqu.bak | 480 ++++++++++++++++ lepiter/98eic2dywhmaij4eonyqv7aqu.lepiter | 480 ++++++++++++++++ lepiter/98eic2g8xrl1zoo0c1rpxqe78.lepiter | 76 +++ lepiter/98eic2h47lmzysuasji9ltxfp.bak | 150 +++++ lepiter/98eic2h47lmzysuasji9ltxfp.lepiter | 150 +++++ lepiter/98eic2i3mg2eo2ztuqewzxrbf.bak | 520 ++++++++++++++++++ lepiter/98eic2i3mg2eo2ztuqewzxrbf.lepiter | 520 ++++++++++++++++++ lepiter/98eic2i50ocb0va6cfou37q6u.bak | 187 +++++++ lepiter/98eic2i50ocb0va6cfou37q6u.lepiter | 187 +++++++ lepiter/98eic2j16rr2u9v6h3elxhsll.lepiter | 76 +++ lepiter/98eic2k4l24gaj65et7lust0g.bak | 76 +++ lepiter/98eic2k4l24gaj65et7lust0g.lepiter | 76 +++ lepiter/98eic2k973nz738qf6nsxvl1o.bak | 295 ++++++++++ lepiter/98eic2k973nz738qf6nsxvl1o.lepiter | 295 ++++++++++ lepiter/98eic2kfnift3stsvtbef41qj.lepiter | 76 +++ lepiter/lepiter.properties | 6 + src/Carp-AST/CarpExpressionNode.class.st | 6 + src/Carp-AST/CarpModuleOrTypeNode.class.st | 34 -- src/Carp-Parser/CarpModuleOrTypeNode.class.st | 53 ++ src/Carp-Parser/CarpParser.class.st | 13 +- src/Carp/ByteString.extension.st | 11 + src/Carp/CarpBinding.class.st | 23 + src/Carp/CarpCall.class.st | 43 ++ src/Carp/CarpDouble.class.st | 5 + src/Carp/CarpDynamicFunction.class.st | 10 + src/Carp/CarpDynamicVariable.class.st | 10 + src/Carp/CarpExpression.class.st | 10 + src/{Carp-Parser => Carp}/CarpFile.class.st | 2 +- src/Carp/CarpFloat.class.st | 10 + src/Carp/CarpInteger.class.st | 10 + src/Carp/CarpLiteral.class.st | 5 + src/Carp/CarpLong.class.st | 10 + src/Carp/CarpMacro.class.st | 10 + src/Carp/CarpModule.class.st | 55 ++ src/Carp/CarpNamedFunction.class.st | 53 ++ src/Carp/CarpNumber.class.st | 28 + src/Carp/CarpStaticFunction.class.st | 10 + src/Carp/CarpStaticVariable.class.st | 10 + src/Carp/CarpStringExpression.class.st | 23 + src/Carp/CarpSymbol.class.st | 23 + src/Carp/CarpVariable.class.st | 34 ++ src/Carp/Float.extension.st | 11 + src/Carp/Integer.extension.st | 11 + 47 files changed, 5143 insertions(+), 41 deletions(-) create mode 100644 lepiter/98eic2d1mangtosf26n3aq420.bak create mode 100644 lepiter/98eic2d1mangtosf26n3aq420.lepiter create mode 100644 lepiter/98eic2dxfcnj2jji36yacsexj.bak create mode 100644 lepiter/98eic2dxfcnj2jji36yacsexj.lepiter create mode 100644 lepiter/98eic2dywhmaij4eonyqv7aqu.bak create mode 100644 lepiter/98eic2dywhmaij4eonyqv7aqu.lepiter create mode 100644 lepiter/98eic2g8xrl1zoo0c1rpxqe78.lepiter create mode 100644 lepiter/98eic2h47lmzysuasji9ltxfp.bak create mode 100644 lepiter/98eic2h47lmzysuasji9ltxfp.lepiter create mode 100644 lepiter/98eic2i3mg2eo2ztuqewzxrbf.bak create mode 100644 lepiter/98eic2i3mg2eo2ztuqewzxrbf.lepiter create mode 100644 lepiter/98eic2i50ocb0va6cfou37q6u.bak create mode 100644 lepiter/98eic2i50ocb0va6cfou37q6u.lepiter create mode 100644 lepiter/98eic2j16rr2u9v6h3elxhsll.lepiter create mode 100644 lepiter/98eic2k4l24gaj65et7lust0g.bak create mode 100644 lepiter/98eic2k4l24gaj65et7lust0g.lepiter create mode 100644 lepiter/98eic2k973nz738qf6nsxvl1o.bak create mode 100644 lepiter/98eic2k973nz738qf6nsxvl1o.lepiter create mode 100644 lepiter/98eic2kfnift3stsvtbef41qj.lepiter create mode 100644 lepiter/lepiter.properties delete mode 100644 src/Carp-AST/CarpModuleOrTypeNode.class.st create mode 100644 src/Carp-Parser/CarpModuleOrTypeNode.class.st create mode 100644 src/Carp/ByteString.extension.st create mode 100644 src/Carp/CarpBinding.class.st create mode 100644 src/Carp/CarpCall.class.st create mode 100644 src/Carp/CarpDouble.class.st create mode 100644 src/Carp/CarpDynamicFunction.class.st create mode 100644 src/Carp/CarpDynamicVariable.class.st create mode 100644 src/Carp/CarpExpression.class.st rename src/{Carp-Parser => Carp}/CarpFile.class.st (95%) create mode 100644 src/Carp/CarpFloat.class.st create mode 100644 src/Carp/CarpInteger.class.st create mode 100644 src/Carp/CarpLiteral.class.st create mode 100644 src/Carp/CarpLong.class.st create mode 100644 src/Carp/CarpMacro.class.st create mode 100644 src/Carp/CarpModule.class.st create mode 100644 src/Carp/CarpNamedFunction.class.st create mode 100644 src/Carp/CarpNumber.class.st create mode 100644 src/Carp/CarpStaticFunction.class.st create mode 100644 src/Carp/CarpStaticVariable.class.st create mode 100644 src/Carp/CarpStringExpression.class.st create mode 100644 src/Carp/CarpSymbol.class.st create mode 100644 src/Carp/CarpVariable.class.st create mode 100644 src/Carp/Float.extension.st create mode 100644 src/Carp/Integer.extension.st diff --git a/lepiter/98eic2d1mangtosf26n3aq420.bak b/lepiter/98eic2d1mangtosf26n3aq420.bak new file mode 100644 index 0000000..701c39a --- /dev/null +++ b/lepiter/98eic2d1mangtosf26n3aq420.bak @@ -0,0 +1,374 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:08:55.227716+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:08:58.770803+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "hGWhaTyZDQCZm9rLDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Introduction]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:58:52.686844+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:09.214408+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "eOLsdD2ZDQCaaOjnDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Building a parser from an ANTLR grammar]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:12.91302+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:20.076198+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "W9ofdj2ZDQCaaui2Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Building a parser from scratch]]" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:08.179356+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:12.805761+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "Ixa9wjyZDQCZtj5BDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Building a parser]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:30.450484+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:41.185917+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "XeVhxDyZDQCZvXkcDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Styling your AST]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:24.51834+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:43.326487+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "XcsixTyZDQCZv9vLDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Executing code]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:01.231596+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:23.491416+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "ZJFVpz2ZDQCcsHXHDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Visualizing code using our AST]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:27.008599+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:47.417385+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "vR59wzyZDQCZuPj0Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[A coder of one’s own]]" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:41.148364+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:50.042337+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "5DT6yDyZDQCZxA+pDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Bonus Chapters]]" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:44:06.467983+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:44:55.638299+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Adding a Language to the Glamorous Toolkit" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "08bda069-3c99-0d00-999a-9b060ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2d1mangtosf26n3aq420.lepiter b/lepiter/98eic2d1mangtosf26n3aq420.lepiter new file mode 100644 index 0000000..91eae4e --- /dev/null +++ b/lepiter/98eic2d1mangtosf26n3aq420.lepiter @@ -0,0 +1,411 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:08:55.227716+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:08:58.770803+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "hGWhaTyZDQCZm9rLDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Introduction]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:58:52.686844+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:09.214408+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "eOLsdD2ZDQCaaOjnDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Building a parser from an ANTLR grammar]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:12.91302+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:20.076198+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "W9ofdj2ZDQCaaui2Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Building a parser from scratch]]" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:08.179356+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:12.805761+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "Ixa9wjyZDQCZtj5BDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Building a parser]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:30.450484+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:41.185917+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "XeVhxDyZDQCZvXkcDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Styling your AST]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:24.51834+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:43.326487+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "XcsixTyZDQCZv9vLDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Executing code]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:01.231596+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:23.491416+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "ZJFVpz2ZDQCcsHXHDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Visualizing code using our AST]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:12.409264+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:16.722303+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "CL7byT6ZDQCdyqowDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Generating Code]]" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:27.008599+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:47.417385+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "vR59wzyZDQCZuPj0Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[A coder of one’s own]]" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:41.148364+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:50.042337+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "5DT6yDyZDQCZxA+pDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "[[Bonus Chapters]]" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:44:06.467983+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:44:55.638299+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Adding a Language to the Glamorous Toolkit" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "08bda069-3c99-0d00-999a-9b060ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2dxfcnj2jji36yacsexj.bak b/lepiter/98eic2dxfcnj2jji36yacsexj.bak new file mode 100644 index 0000000..72084df --- /dev/null +++ b/lepiter/98eic2dxfcnj2jji36yacsexj.bak @@ -0,0 +1,113 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:58.161912+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:03.52646+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "AYAjzTyZDQCZy+OaDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "These following chapters are not required to make your language a first-class citizen inside the Glamorous Toolkit, but they will help make writing code in your language a truly fun activity in GT." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:07.337839+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:11.053139+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "/ZhW0TyZDQCZzZjMDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Buckle up, we’re i" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:55.936502+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:55.936502+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Bonus Chapters" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "97ce22cd-3c99-0d00-99ca-0d240ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2dxfcnj2jji36yacsexj.lepiter b/lepiter/98eic2dxfcnj2jji36yacsexj.lepiter new file mode 100644 index 0000000..7efe396 --- /dev/null +++ b/lepiter/98eic2dxfcnj2jji36yacsexj.lepiter @@ -0,0 +1,113 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:58.161912+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:03.52646+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "AYAjzTyZDQCZy+OaDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "These following chapters are not required to make your language a first-class citizen inside the Glamorous Toolkit, but they will help make writing code in your language a truly fun activity in GT." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:07.337839+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:12.98318+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "/ZhW0TyZDQCZzZjMDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Buckle up, we’re in for a ride!" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:55.936502+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:11:55.936502+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Bonus Chapters" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "97ce22cd-3c99-0d00-99ca-0d240ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2dywhmaij4eonyqv7aqu.bak b/lepiter/98eic2dywhmaij4eonyqv7aqu.bak new file mode 100644 index 0000000..c197b40 --- /dev/null +++ b/lepiter/98eic2dywhmaij4eonyqv7aqu.bak @@ -0,0 +1,480 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:45:14.801608+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:46:57.999944+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "lNc8bTyZDQCZnYokDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "This database is a booklet about my journey of adding support for [Carp](https://github.com/carp-lang/carp) to the Glamorous Toolkit. It may also serve as an instructional text for others who may wish to add language support for a language of their choice to the Glamorous Toolkit." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:06.977343+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:10.770322+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "i6aBezyZDQCZo8ldDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "### My why" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:46:59.7649+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:48:57.270379+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "CvfjczyZDQCZnkdvDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "When I set out on this adventure, I wanted to build an IDE for Carp. I thought that building an IDE for a language that has **syntactic macros**, **type inference**, and **borrow checking** might be an interesting undertaking. Helping a user navigate the process of writing macros and helping them debug them, showing types and lifetimes at every point in their program, seemed like an interesting idea worth exploring." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:48:58.594533+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:05.117045+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "UC7/ejyZDQCZovUTDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "It also seemed like a daunting idea." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:19.287082+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:50:16.779304+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "yNw0fDyZDQCZpDnKDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "I have never built an IDE. True, at the point of writing this document, I have been involved in building and maintaining the Glamorous Toolkit for over half a year. But before that, I mostly worked on language internals." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:50:19.582232+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:16.178212+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "zXPVfzyZDQCZpT4hDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Maybe that blend of knowing the internals of Carp and the Glamorous Toolkit helped, but I found that with the help of the Toolkit, I was able to build something resembling an IDE in a few afternoons. It is not nearly done yet, but it can already do some of the things I was hoping it would do." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:18.544965+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:22.163297+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "hFxOgzyZDQCZpvYADqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "### Our Journey" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:28.559246+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:53:37.769503+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "W1+ogzyZDQCZp7heDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In this book, I will go through the process of adding language support step by step. We will build a parser and play around with it for a bit. We will add a highlighter and marvel at how prettily it renders our code. We will add snippets, so we can look at Carp code from directly within Lepiter, and later Coder. We will add a LanguageLink interface, both the server and the client, so that we can execute Carp code. Finally, as a bonus, we will add a custom Coder element, such that we have something resembling an IDE in the end." + }, + { + "__type" : "carpSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:56:34.436805+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:07:38.104346+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "Ddc1ljyZDQCZq2mSDqn2mw==" + }, + "code" : "; this is what we will be able to do\r(IO.defn hello-world []\r (IO.println \"Hello world!\"))" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:53:42.906873+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:20.656267+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "77jzizyZDQCZqDh5Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "I hope you enjoy working through this as much as I did when I first went on this journey, and I hope that it is educational enough for you to set out and build whatever tooling you want for your language." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:23.246616+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:26.766687+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "RkRPjjyZDQCZqbtkDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "### The Code" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:27.908058+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:56:20.163201+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "x2GgjjyZDQCZqqlSDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Finally, you might every once in a while be tempted to not look at my prose, and just go off into the cavernous depths of code without guidance. Noone is hindering you. All the code is found within the `Carp` package. I suggest starting with {{gtClass:CarpParser}}, which is where I started." + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:45:06.989429+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:45:12.647664+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Introduction" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "26393c6d-3c99-0d00-999c-6b250ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2dywhmaij4eonyqv7aqu.lepiter b/lepiter/98eic2dywhmaij4eonyqv7aqu.lepiter new file mode 100644 index 0000000..dacd65c --- /dev/null +++ b/lepiter/98eic2dywhmaij4eonyqv7aqu.lepiter @@ -0,0 +1,480 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:45:14.801608+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:46:57.999944+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "lNc8bTyZDQCZnYokDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "This database is a booklet about my journey of adding support for [Carp](https://github.com/carp-lang/carp) to the Glamorous Toolkit. It may also serve as an instructional text for others who may wish to add language support for a language of their choice to the Glamorous Toolkit." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:06.977343+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:10.770322+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "i6aBezyZDQCZo8ldDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "### My why" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:46:59.7649+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:48:57.270379+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "CvfjczyZDQCZnkdvDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "When I set out on this adventure, I wanted to build an IDE for Carp. I thought that building an IDE for a language that has **syntactic macros**, **type inference**, and **borrow checking** might be an interesting undertaking. Helping a user navigate the process of writing macros and helping them debug them, showing types and lifetimes at every point in their program, seemed like an interesting idea worth exploring." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:48:58.594533+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:05.117045+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "UC7/ejyZDQCZovUTDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "It also seemed like a daunting idea." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:49:19.287082+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:50:16.779304+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "yNw0fDyZDQCZpDnKDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "I have never built an IDE. True, at the point of writing this document, I have been involved in building and maintaining the Glamorous Toolkit for over half a year. But before that, I mostly worked on language internals." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:50:19.582232+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:16.178212+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "zXPVfzyZDQCZpT4hDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Maybe that blend of knowing the internals of Carp and the Glamorous Toolkit helped, but I found that with the help of the Toolkit, I was able to build something resembling an IDE in a few afternoons. It is not nearly done yet, but it can already do some of the things I was hoping it would do." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:18.544965+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:22.163297+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "hFxOgzyZDQCZpvYADqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "### Our Journey" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:51:28.559246+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:53:37.769503+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "W1+ogzyZDQCZp7heDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In this book, I will go through the process of adding language support step by step. We will build a parser and play around with it for a bit. We will add a highlighter and marvel at how prettily it renders our code. We will add snippets, so we can look at Carp code from directly within Lepiter, and later Coder. We will add a LanguageLink interface, both the server and the client, so that we can execute Carp code. Finally, as a bonus, we will add a custom Coder element, such that we have something resembling an IDE in the end." + }, + { + "__type" : "carpSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:56:34.436805+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:08:04.346367+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "Ddc1ljyZDQCZq2mSDqn2mw==" + }, + "code" : "; this is what we will be able to do\r(defn hello-world []\r (IO.println \"Hello world!\"))" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:53:42.906873+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:20.656267+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "77jzizyZDQCZqDh5Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "I hope you enjoy working through this as much as I did when I first went on this journey, and I hope that it is educational enough for you to set out and build whatever tooling you want for your language." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:23.246616+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:26.766687+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "RkRPjjyZDQCZqbtkDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "### The Code" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:54:27.908058+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:56:20.163201+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "x2GgjjyZDQCZqqlSDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Finally, you might every once in a while be tempted to not look at my prose, and just go off into the cavernous depths of code without guidance. Noone is hindering you. All the code is found within the `Carp` package. I suggest starting with {{gtClass:CarpParser}}, which is where I started." + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:45:06.989429+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T16:45:12.647664+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Introduction" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "26393c6d-3c99-0d00-999c-6b250ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2g8xrl1zoo0c1rpxqe78.lepiter b/lepiter/98eic2g8xrl1zoo0c1rpxqe78.lepiter new file mode 100644 index 0000000..1a3f638 --- /dev/null +++ b/lepiter/98eic2g8xrl1zoo0c1rpxqe78.lepiter @@ -0,0 +1,76 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:53.313378+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:53.833743+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "JUkMyTyZDQCZxrrZDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "TODO" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:47.300048+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:10:47.300048+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Executing code" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "647f0bc9-3c99-0d00-99c5-5d710ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2h47lmzysuasji9ltxfp.bak b/lepiter/98eic2h47lmzysuasji9ltxfp.bak new file mode 100644 index 0000000..110c96c --- /dev/null +++ b/lepiter/98eic2h47lmzysuasji9ltxfp.bak @@ -0,0 +1,150 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:45.218163+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:00:37.477041+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "p8Dxdz2ZDQCabX95Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "If you already have an ANTLR grammar for your language lying around or know how to get to one—and many popular languages already have such a grammar—, you can get to a simple parser in a matter of minutes." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:00:38.97911+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:03:21.19204+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "ardNez2ZDQCab0qKDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "For Carp, this route was not viable. But for you it might be. In that case I refer you to {{gtPage:How to translate an ANTLr parser into SmaCC|db=2j9m7db2i4oz116bexd7wbdxo}} in the Glamorous Toolkit book and [this livecoding session on YouTube](https://www.youtube.com/watch?v=ClxwPg_L54g) where Pharo and GT open source power house Sean DeNigris and the creator of SmaCC John Brant polish a TOML parser that was generated from an ANTLR grammar." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:03:23.459881+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:42.132554+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "5skjhT2ZDQCbeQtxDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Apart from that, I fear, I cannot help you much if things don’t go as planned. But maybe some of the things we will discuss in the next section, [[Building a parser from scratch]], will help you get from something that generates a raw parse tree to something that generates a real usable AST for your language. Take a " + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:41.586372+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:41.586372+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Building a parser from an ANTLR grammar" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "8527f177-3d99-0d00-9a6c-518e0ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2h47lmzysuasji9ltxfp.lepiter b/lepiter/98eic2h47lmzysuasji9ltxfp.lepiter new file mode 100644 index 0000000..7d9330b --- /dev/null +++ b/lepiter/98eic2h47lmzysuasji9ltxfp.lepiter @@ -0,0 +1,150 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:45.218163+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:00:37.477041+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "p8Dxdz2ZDQCabX95Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "If you already have an ANTLR grammar for your language lying around or know how to get to one—and many popular languages already have such a grammar—, you can get to a simple parser in a matter of minutes." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:00:38.97911+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:03:21.19204+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "ardNez2ZDQCab0qKDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "For Carp, this route was not viable. But for you it might be. In that case I refer you to {{gtPage:How to translate an ANTLr parser into SmaCC|db=2j9m7db2i4oz116bexd7wbdxo}} in the Glamorous Toolkit book and [this livecoding session on YouTube](https://www.youtube.com/watch?v=ClxwPg_L54g) where Pharo and GT open source power house Sean DeNigris and the creator of SmaCC John Brant polish a TOML parser that was generated from an ANTLR grammar." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:03:23.459881+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:44.753707+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "5skjhT2ZDQCbeQtxDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Apart from that, I fear, I cannot help you much if things don’t go as planned. But maybe some of the things we will discuss in the next section, [[Building a parser from scratch]], will help you get from something that generates a raw parse tree to something that generates a real usable AST for your language. Take a peek!" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:41.586372+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:59:41.586372+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Building a parser from an ANTLR grammar" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "8527f177-3d99-0d00-9a6c-518e0ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2i3mg2eo2ztuqewzxrbf.bak b/lepiter/98eic2i3mg2eo2ztuqewzxrbf.bak new file mode 100644 index 0000000..9eb568b --- /dev/null +++ b/lepiter/98eic2i3mg2eo2ztuqewzxrbf.bak @@ -0,0 +1,520 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:52.926306+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:05:09.50221+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "GJFVij2ZDQCcDd1tDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In this section, we will go through the process of building a parser “from scratch” together." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:05:12.833745+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:06:10.030858+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "xbeQiz2ZDQCcD88QDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In practice, SmaCC comes with so many amenities already that “from scratch” means “from an already made bed” more than anything else. You will see what I mean as we go through this together." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:06:13.583081+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:39.026231+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "J3E/jz2ZDQCcETMJDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "The code for this section largely resides inside {{gtClass:CarpParser}} and the subclasses of {{gtClass:CarpExpressionNode}}. You can take a look at them below." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:07:30.484217+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:08:55.160826+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "lon3kT2ZDQCcE768Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "{{gtExample:CarpExpressionNode class >> #itself | noCode=true | previewExpanded=true | previewShow=#gtSubclassesFor:}}" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:13.686592+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:55.020248+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "jDDBmT2ZDQCcGKn5Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "If this seems like a dizzying amount of classes to write, don’t worry—they’re autogenerated. The only class we will have to touch is the parser, and the rest will follow." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:58.500922+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:32.016153+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "cEqknD2ZDQCcGminDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "If you want to have a non-Carp-centric explanation of how to work with parsers in SmaCC, the Glamorous Toolkit book has a section on that as well, {{gtPage:Playing with Parsers in SmaCC - Show|db=2j9m7db2i4oz116bexd7wbdxo}}. It doesn’t cover all of the ground we will, but it should give you enough of an introduction to feel less lost." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:36.888183+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:46.504487+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "xvVdoj2ZDQCcpQCVDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "## Step I: Generating a parse tree" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:48.803566+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:49.328916+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "9FI7oz2ZDQCcp4WzDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "TODO" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:51.714664+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:12:08.856107+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "twRZoz2ZDQCcqex7Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "## Step II: Generating an AST" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:12:10.773142+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:12:47.439878+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "pVmLpD2ZDQCcq9tADqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "TODO" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:18:53.161795+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:19:02.231751+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "RbB6vD2ZDQCctg5pDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "## Step III: Playing with your AST" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:19:03.612588+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:20:04.139943+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "NDAnvT2ZDQCcuJ7fDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "While this step isn’t strictly necessary, I encourage you to take this moment to take a break, relax, and play a little with your new toy." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:20:10.650719+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:21:44.411232+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "i+YTwT2ZDQCcupQKDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Over in the bonus section, there is a chapter on [[Visualizing code using our AST]]. It’s just a suggestion, but maybe there are some questions you’ve been asking yourself about your code bases lately that you can now finally answer using the AST? If you do, be sure to tell me about " + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:50.114519+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:50.114519+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Building a parser from scratch" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "8beb548a-3d99-0d00-9c0c-1aaf0ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2i3mg2eo2ztuqewzxrbf.lepiter b/lepiter/98eic2i3mg2eo2ztuqewzxrbf.lepiter new file mode 100644 index 0000000..0160cde --- /dev/null +++ b/lepiter/98eic2i3mg2eo2ztuqewzxrbf.lepiter @@ -0,0 +1,520 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:52.926306+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:05:09.50221+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "GJFVij2ZDQCcDd1tDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In this section, we will go through the process of building a parser “from scratch” together." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:05:12.833745+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:06:10.030858+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "xbeQiz2ZDQCcD88QDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In practice, SmaCC comes with so many amenities already that “from scratch” means “from an already made bed” more than anything else. You will see what I mean as we go through this together." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:06:13.583081+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:39.026231+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "J3E/jz2ZDQCcETMJDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "The code for this section largely resides inside {{gtClass:CarpParser}} and the subclasses of {{gtClass:CarpExpressionNode}}. You can take a look at them below." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:07:30.484217+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:08:55.160826+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "lon3kT2ZDQCcE768Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "{{gtExample:CarpExpressionNode class >> #itself | noCode=true | previewExpanded=true | previewShow=#gtSubclassesFor:}}" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:13.686592+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:55.020248+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "jDDBmT2ZDQCcGKn5Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "If this seems like a dizzying amount of classes to write, don’t worry—they’re autogenerated. The only class we will have to touch is the parser, and the rest will follow." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:09:58.500922+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:32.016153+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "cEqknD2ZDQCcGminDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "If you want to have a non-Carp-centric explanation of how to work with parsers in SmaCC, the Glamorous Toolkit book has a section on that as well, {{gtPage:Playing with Parsers in SmaCC - Show|db=2j9m7db2i4oz116bexd7wbdxo}}. It doesn’t cover all of the ground we will, but it should give you enough of an introduction to feel less lost." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:36.888183+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:46.504487+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "xvVdoj2ZDQCcpQCVDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "## Step I: Generating a parse tree" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:48.803566+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:49.328916+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "9FI7oz2ZDQCcp4WzDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "TODO" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:11:51.714664+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:12:08.856107+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "twRZoz2ZDQCcqex7Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "## Step II: Generating an AST" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:12:10.773142+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:12:47.439878+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "pVmLpD2ZDQCcq9tADqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "TODO" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:18:53.161795+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:19:02.231751+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "RbB6vD2ZDQCctg5pDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "## Step III: Playing with your AST" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:19:03.612588+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:20:04.139943+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "NDAnvT2ZDQCcuJ7fDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "While this step isn’t strictly necessary, I encourage you to take this moment to take a break, relax, and play a little with your new toy." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:20:10.650719+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:21:45.318245+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "i+YTwT2ZDQCcupQKDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Over in the bonus section, there is a chapter on [[Visualizing code using our AST]]. It’s just a suggestion, but maybe there are some questions you’ve been asking yourself about your code bases lately that you can now finally answer using the AST? If you do, be sure to tell me about it!" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:50.114519+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:04:50.114519+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Building a parser from scratch" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "8beb548a-3d99-0d00-9c0c-1aaf0ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2i50ocb0va6cfou37q6u.bak b/lepiter/98eic2i50ocb0va6cfou37q6u.bak new file mode 100644 index 0000000..fab3e2f --- /dev/null +++ b/lepiter/98eic2i50ocb0va6cfou37q6u.bak @@ -0,0 +1,187 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:43:49.615762+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:50:20.524028+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "sISlwzyZDQCZunK6Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "We’re going to start the process of integrating our language by making GT understand its syntax. To do that, we are going to write a parser." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:50:22.703511+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:52:10.981298+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "mZWIVj2ZDQCZ5a/iDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "The prospect of riting a parser manually most likely elicits two responses from you: “this is going to be fun” or “what a nightmare”. Usually I fall into the first category, but depending on the complexity of the language’s grammar, I might also feel a little bit of the second option." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:52:13.23472+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:57:02.826968+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "gxItXT2ZDQCZ5wrNDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Luckily, we don’t have to bother with any of the manual labor required in writing a parser by hand. We have [SmaCC](http://www.refactoryworkers.com/SmaCC.html), a powerful version of the YACC trope of parser generators. With it, we can generate a parser for our language with relative ease, whether we have a grammar at hand or not." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:57:08.353695+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:57:41.124314+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "fDmIbj2ZDQCZ6ou1Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "You might also want to take a look at the esecti{{gtPage:How to parse sources in different languages|db=2j9m7db2i4oz116bexd7wbdxo}}" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:16.687265+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:16.687265+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Building a parser" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "56dba4c3-3c99-0d00-99b9-64b00ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2i50ocb0va6cfou37q6u.lepiter b/lepiter/98eic2i50ocb0va6cfou37q6u.lepiter new file mode 100644 index 0000000..48f8b14 --- /dev/null +++ b/lepiter/98eic2i50ocb0va6cfou37q6u.lepiter @@ -0,0 +1,187 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:43:49.615762+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:50:20.524028+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "sISlwzyZDQCZunK6Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "We’re going to start the process of integrating our language by making GT understand its syntax. To do that, we are going to write a parser." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:50:22.703511+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:52:10.981298+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "mZWIVj2ZDQCZ5a/iDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "The prospect of riting a parser manually most likely elicits two responses from you: “this is going to be fun” or “what a nightmare”. Usually I fall into the first category, but depending on the complexity of the language’s grammar, I might also feel a little bit of the second option." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:52:13.23472+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:57:02.826968+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "gxItXT2ZDQCZ5wrNDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Luckily, we don’t have to bother with any of the manual labor required in writing a parser by hand. We have [SmaCC](http://www.refactoryworkers.com/SmaCC.html), a powerful version of the YACC trope of parser generators. With it, we can generate a parser for our language with relative ease, whether we have a grammar at hand or not." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:57:08.353695+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:58:06.623815+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "fDmIbj2ZDQCZ6ou1Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "You might also want to take a look at the section {{gtPage:How to parse sources in different languages|db=2j9m7db2i4oz116bexd7wbdxo}} in the Glamorous Toolkit book to get an overview. Maybe the language you want to add is already there!" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:16.687265+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:16.687265+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Building a parser" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "56dba4c3-3c99-0d00-99b9-64b00ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2j16rr2u9v6h3elxhsll.lepiter b/lepiter/98eic2j16rr2u9v6h3elxhsll.lepiter new file mode 100644 index 0000000..284f6fb --- /dev/null +++ b/lepiter/98eic2j16rr2u9v6h3elxhsll.lepiter @@ -0,0 +1,76 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:48.939646+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:49.381266+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "+EdxxTyZDQCZwZeADqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "TODO" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:46.810502+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:09:46.810502+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Styling your AST" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "098070c5-3c99-0d00-99c0-2cce0ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2k4l24gaj65et7lust0g.bak b/lepiter/98eic2k4l24gaj65et7lust0g.bak new file mode 100644 index 0000000..8ce5bbe --- /dev/null +++ b/lepiter/98eic2k4l24gaj65et7lust0g.bak @@ -0,0 +1,76 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:34.71835+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:18:43.697823+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "ZjeOsD2ZDQCcs7yADqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In this bonus chapter, we are going to learn how to visualize code using just the AST. While you cannot expect the highest level of semantic insight from analyses that purely focus on the AST, it can be a fun and interesting challenge, and give you some ideas on how to work with ASTs." + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:31.357765+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:31.357765+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Visualizing code using our AST" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "e0838db0-3d99-0d00-9cb2-a5f20ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2k4l24gaj65et7lust0g.lepiter b/lepiter/98eic2k4l24gaj65et7lust0g.lepiter new file mode 100644 index 0000000..d93db72 --- /dev/null +++ b/lepiter/98eic2k4l24gaj65et7lust0g.lepiter @@ -0,0 +1,76 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:34.71835+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:18:44.200231+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "ZjeOsD2ZDQCcs7yADqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In this bonus chapter, we are going to learn how to visualize code using just the AST. While you cannot expect the highest level of semantic insight from analyses that purely focus on the AST, it can be a fun and interesting challenge, and give you some ideas on how to work with ASTs." + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:31.357765+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T18:15:31.357765+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Visualizing code using our AST" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "e0838db0-3d99-0d00-9cb2-a5f20ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2k973nz738qf6nsxvl1o.bak b/lepiter/98eic2k973nz738qf6nsxvl1o.bak new file mode 100644 index 0000000..88bd036 --- /dev/null +++ b/lepiter/98eic2k973nz738qf6nsxvl1o.bak @@ -0,0 +1,295 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:23.127464+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:50.494585+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "Hs5lyj6ZDQCdzfQlDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Generating code is, in this case, the inverse of parsing: we have a tree, and we want to generate code matching our specification." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:51.781408+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:01.841086+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "001CzD6ZDQCdz6J+Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In the case of Carp, I built a specific, new AST that matches the semantics of Carp rather than just the syntax. The example below should make this a little clearer." + }, + { + "__type" : "pharoSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:07.105942+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:14.725535+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "yC3J0D6ZDQCd0ZgmDqn2mw==" + }, + "code" : "'Example' asCarpModule\r\taddExpression: (CarpStaticFunction\r\t\t\t named: 'example' asCarpSymbol\r\t\t\t withArguments: { \r\t\t\t\t\t 'x' asCarpSymbol.\r\t\t\t\t\t 'y' asCarpSymbol }\r\t\t\t andBody: (CarpCall function: '+' asCarpSymbol arguments: { \r\t\t\t\t\t\t\t 'x' asCarpSymbol.\r\t\t\t\t\t\t\t 'y' asCarpSymbol }));\r\taddExpression: (CarpDynamicVariable\r\t\t\t named: 'dyn-example' asCarpSymbol\r\t\t\t binding: 1 asCarpInteger);\r\ttoCarp" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:24.187977+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:37:20.312486+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "bUdd0T6ZDQCd0+EWDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "The AST we use here knows about modules, calls, and bindings. The AST we parse into does not, because it doesn’t have to. But once we wander forth into generating code, a new representation might be more appropriate." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:38:27.85143+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:38:27.85143+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "48Ms2T6ZDQCd14cbDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "This is an example of having multiple representation of the same code in an environment. Many compilers have multiple intermediate representations, gradually lowering the abstraction level between phases, until finally generating code." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:37:23.024062+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:39:27.969082+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "vYVC1T6ZDQCd1YgnDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "We do something similar: by increasing the abstraction level, our toolkit becomes more expressive, capturing our use case better." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:39:55.39115+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:40:10.759445+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "BCUP3j6ZDQCd2e0LDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In the next chapter, we will use this code generator in our newly created coder" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:19.88496+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:19.88496+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Generating Code" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "4c1d65ca-3e99-0d00-9dcc-eaf60ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2k973nz738qf6nsxvl1o.lepiter b/lepiter/98eic2k973nz738qf6nsxvl1o.lepiter new file mode 100644 index 0000000..b9063eb --- /dev/null +++ b/lepiter/98eic2k973nz738qf6nsxvl1o.lepiter @@ -0,0 +1,295 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:23.127464+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:50.494585+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "Hs5lyj6ZDQCdzfQlDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "Generating code is, in this case, the inverse of parsing: we have a tree, and we want to generate code matching our specification." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:51.781408+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:01.841086+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "001CzD6ZDQCdz6J+Dqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In the case of Carp, I built a specific, new AST that matches the semantics of Carp rather than just the syntax. The example below should make this a little clearer." + }, + { + "__type" : "pharoSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:07.105942+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:14.725535+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "yC3J0D6ZDQCd0ZgmDqn2mw==" + }, + "code" : "'Example' asCarpModule\r\taddExpression: (CarpStaticFunction\r\t\t\t named: 'example' asCarpSymbol\r\t\t\t withArguments: { \r\t\t\t\t\t 'x' asCarpSymbol.\r\t\t\t\t\t 'y' asCarpSymbol }\r\t\t\t andBody: (CarpCall function: '+' asCarpSymbol arguments: { \r\t\t\t\t\t\t\t 'x' asCarpSymbol.\r\t\t\t\t\t\t\t 'y' asCarpSymbol }));\r\taddExpression: (CarpDynamicVariable\r\t\t\t named: 'dyn-example' asCarpSymbol\r\t\t\t binding: 1 asCarpInteger);\r\ttoCarp" + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:36:24.187977+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:37:20.312486+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "bUdd0T6ZDQCd0+EWDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "The AST we use here knows about modules, calls, and bindings. The AST we parse into does not, because it doesn’t have to. But once we wander forth into generating code, a new representation might be more appropriate." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:38:27.85143+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:38:27.85143+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "48Ms2T6ZDQCd14cbDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "This is an example of having multiple representation of the same code in an environment. Many compilers have multiple intermediate representations, gradually lowering the abstraction level between phases, until finally generating code." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:37:23.024062+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:39:27.969082+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "vYVC1T6ZDQCd1YgnDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "We do something similar: by increasing the abstraction level, our toolkit becomes more expressive, capturing our use case better." + }, + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:39:55.39115+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:40:21.249005+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "BCUP3j6ZDQCd2e0LDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "In the next chapter named [[A coder of one’s own]], we will use this code generator in our newly created coder." + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:19.88496+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T19:34:19.88496+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "Generating Code" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "4c1d65ca-3e99-0d00-9dcc-eaf60ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/98eic2kfnift3stsvtbef41qj.lepiter b/lepiter/98eic2kfnift3stsvtbef41qj.lepiter new file mode 100644 index 0000000..f993b66 --- /dev/null +++ b/lepiter/98eic2kfnift3stsvtbef41qj.lepiter @@ -0,0 +1,76 @@ +{ + "__schema" : "4.1", + "__type" : "page", + "children" : { + "__type" : "snippets", + "items" : [ + { + "__type" : "textSnippet", + "children" : { + "__type" : "snippets", + "items" : [ ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:52.19432+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:52.757701+02:00" + } + }, + "uid" : { + "__type" : "uid", + "uidString" : "uOr60zyZDQCZ0YDZDqn2mw==" + }, + "paragraphStyle" : { + "__type" : "textStyle" + }, + "string" : "TODO" + } + ] + }, + "createEmail" : { + "__type" : "email", + "emailString" : "" + }, + "createTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:50.717236+02:00" + } + }, + "editEmail" : { + "__type" : "email", + "emailString" : "" + }, + "editTime" : { + "__type" : "time", + "time" : { + "__type" : "dateAndTime", + "dateAndTimeString" : "2022-04-17T17:13:50.717236+02:00" + } + }, + "pageType" : { + "__type" : "namedPage", + "title" : "A coder of one’s own" + }, + "uid" : { + "__type" : "uuid", + "uuid" : "cb38fad3-3c99-0d00-99d0-e4fc0ea9f69b" + } +} \ No newline at end of file diff --git a/lepiter/lepiter.properties b/lepiter/lepiter.properties new file mode 100644 index 0000000..c73c0cd --- /dev/null +++ b/lepiter/lepiter.properties @@ -0,0 +1,6 @@ +{ + "uuid" : "de53e067-3c99-0d00-9999-34310ea9f69b", + "tableOfContents" : "98eic2dywhmaij4eonyqv7aqu", + "schema" : "4.1", + "databaseName" : "Adding a Language to the Glamorous Toolkit" +} \ No newline at end of file diff --git a/src/Carp-AST/CarpExpressionNode.class.st b/src/Carp-AST/CarpExpressionNode.class.st index 3b712d5..a9fbabc 100644 --- a/src/Carp-AST/CarpExpressionNode.class.st +++ b/src/Carp-AST/CarpExpressionNode.class.st @@ -4,6 +4,12 @@ Class { #category : #'Carp-AST' } +{ #category : #accessing } +CarpExpressionNode class >> itself [ + + ^ self +] + { #category : #generated } CarpExpressionNode >> acceptVisitor: anExpressionVisitor [ diff --git a/src/Carp-AST/CarpModuleOrTypeNode.class.st b/src/Carp-AST/CarpModuleOrTypeNode.class.st deleted file mode 100644 index 42ffd0d..0000000 --- a/src/Carp-AST/CarpModuleOrTypeNode.class.st +++ /dev/null @@ -1,34 +0,0 @@ -Class { - #name : #CarpModuleOrTypeNode, - #superclass : #CarpExpressionNode, - #instVars : [ - 'value' - ], - #category : #'Carp-AST' -} - -{ #category : #generated } -CarpModuleOrTypeNode >> acceptVisitor: anExpressionVisitor [ - - ^ anExpressionVisitor visitModuleOrType: self -] - -{ #category : #generated } -CarpModuleOrTypeNode >> otherVariables [ - - ^ #( #value ) -] - -{ #category : #generated } -CarpModuleOrTypeNode >> value [ - - ^ value -] - -{ #category : #generated } -CarpModuleOrTypeNode >> value: anObject [ - - self setParent: self value to: nil. - value := anObject. - self setParent: self value to: self -] diff --git a/src/Carp-Parser/CarpModuleOrTypeNode.class.st b/src/Carp-Parser/CarpModuleOrTypeNode.class.st new file mode 100644 index 0000000..424425c --- /dev/null +++ b/src/Carp-Parser/CarpModuleOrTypeNode.class.st @@ -0,0 +1,53 @@ +Class { + #name : #CarpModuleOrTypeNode, + #superclass : #CarpExpressionNode, + #instVars : [ + 'module', + 'value' + ], + #category : #'Carp-Parser' +} + +{ #category : #generated } +CarpModuleOrTypeNode >> acceptVisitor: anExpressionVisitor [ + + ^ anExpressionVisitor visitModuleOrType: self +] + +{ #category : #generated } +CarpModuleOrTypeNode >> module [ + + ^ module +] + +{ #category : #generated } +CarpModuleOrTypeNode >> module: aSmaCCToken [ + + module := aSmaCCToken +] + +{ #category : #generated } +CarpModuleOrTypeNode >> nodeVariables [ + + ^ #( #value ) +] + +{ #category : #generated } +CarpModuleOrTypeNode >> tokenVariables [ + + ^ #( #module ) +] + +{ #category : #generated } +CarpModuleOrTypeNode >> value [ + + ^ value +] + +{ #category : #generated } +CarpModuleOrTypeNode >> value: aCarpExpressionNode [ + + self value notNil ifTrue: [ self value parent: nil ]. + value := aCarpExpressionNode. + self value notNil ifTrue: [ self value parent: self ] +] diff --git a/src/Carp-Parser/CarpParser.class.st b/src/Carp-Parser/CarpParser.class.st index 31584d1..28d24ac 100644 --- a/src/Carp-Parser/CarpParser.class.st +++ b/src/Carp-Parser/CarpParser.class.st @@ -6,7 +6,7 @@ Class { { #category : #'generated-accessing' } CarpParser class >> cacheId [ - ^'2022-04-16T18:21:43.028213+02:00' + ^'2022-04-17T17:01:25.369965+02:00' ] { #category : #generated } @@ -141,8 +141,8 @@ Variable : 'value' {{}} ; ModuleOrType - : Symbol 'value' {{}} - | 'value' {{}} + : 'module' Symbol 'value' {{}} + | 'module' {{}} ; List : 'leftParen' Expressions 'rightParen' {{}} @@ -158,7 +158,7 @@ CarpParser class >> reduceTable [ #(24 0 #reduceActionForExpressions1: 1289217 false) #(23 1 #reduceActionForStart1: 1258497 false) #(32 0 #reduceActionForExpressions1: 1803265 false) - #(43 1 #reduceActionForString1: 2436097 false) + #(43 1 #reduceActionForString1: 2446337 false) #(40 1 #reduceActionForVariable1: 2233345 false) #(41 1 #reduceActionForModuleOrType2: 2273282 false) #(36 1 #reduceActionForNumber1: 2013185 false) @@ -189,7 +189,7 @@ CarpParser class >> reduceTable [ #(38 2 #reduceActionForQuote1: 2150401 false) #(31 3 #reduceActionForMap1: 1744897 false) #(32 2 #reduceActionForExpressions2: 1803266 false) - #(42 3 #reduceActionForList1: 2354177 false) + #(42 3 #reduceActionForList1: 2364417 false) #(41 3 #reduceActionForModuleOrType1: 2273281 false) #(37 3 #reduceActionForArray1: 2059265 false) #(33 2 #reduceActionForMapPair1: 1846273 false) @@ -379,6 +379,7 @@ CarpParser >> reduceActionForModuleOrType1: nodes [ | result | result := CarpModuleOrTypeNode new. + result module: (nodes at: 1). result value: (nodes at: 3). ^ result ] @@ -388,7 +389,7 @@ CarpParser >> reduceActionForModuleOrType2: nodes [ | result | result := CarpModuleOrTypeNode new. - result value: (nodes at: 1). + result module: (nodes at: 1). ^ result ] diff --git a/src/Carp/ByteString.extension.st b/src/Carp/ByteString.extension.st new file mode 100644 index 0000000..79c61dd --- /dev/null +++ b/src/Carp/ByteString.extension.st @@ -0,0 +1,11 @@ +Extension { #name : #ByteString } + +{ #category : #'*Carp' } +ByteString >> asCarpModule [ + ^ CarpModule named: self +] + +{ #category : #'*Carp' } +ByteString >> asCarpSymbol [ + ^ CarpSymbol named: self +] diff --git a/src/Carp/CarpBinding.class.st b/src/Carp/CarpBinding.class.st new file mode 100644 index 0000000..98a5131 --- /dev/null +++ b/src/Carp/CarpBinding.class.st @@ -0,0 +1,23 @@ +Class { + #name : #CarpBinding, + #superclass : #CarpExpression, + #instVars : [ + 'name' + ], + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpBinding >> bindingName [ + ^ self subclassResponsibility +] + +{ #category : #accessing } +CarpBinding >> name [ + ^ name +] + +{ #category : #accessing } +CarpBinding >> name: aString [ + name := aString +] diff --git a/src/Carp/CarpCall.class.st b/src/Carp/CarpCall.class.st new file mode 100644 index 0000000..9e38c5b --- /dev/null +++ b/src/Carp/CarpCall.class.st @@ -0,0 +1,43 @@ +Class { + #name : #CarpCall, + #superclass : #CarpExpression, + #instVars : [ + 'function', + 'arguments' + ], + #category : #'Carp-IDE' +} + +{ #category : #'instance creation' } +CarpCall class >> function: aSymbol arguments: aCollection [ + ^ self new name: aSymbol; arguments: aCollection +] + +{ #category : #accessing } +CarpCall >> addArgument: anArgument [ + arguments add: anArgument +] + +{ #category : #accessing } +CarpCall >> arguments: aCollection [ + arguments := aCollection +] + +{ #category : #initialization } +CarpCall >> initialize [ + arguments := OrderedCollection new +] + +{ #category : #accessing } +CarpCall >> name: aSymbol [ + function := aSymbol +] + +{ #category : #accessing } +CarpCall >> toCarp [ + + ^ String streamContents: [ :aStream | + aStream << '(' << function toCarp. + arguments do: [ :anArgument | aStream << ' ' << anArgument toCarp ]. + aStream << ')' ] +] diff --git a/src/Carp/CarpDouble.class.st b/src/Carp/CarpDouble.class.st new file mode 100644 index 0000000..2c43a20 --- /dev/null +++ b/src/Carp/CarpDouble.class.st @@ -0,0 +1,5 @@ +Class { + #name : #CarpDouble, + #superclass : #CarpNumber, + #category : #'Carp-IDE' +} diff --git a/src/Carp/CarpDynamicFunction.class.st b/src/Carp/CarpDynamicFunction.class.st new file mode 100644 index 0000000..dba36b6 --- /dev/null +++ b/src/Carp/CarpDynamicFunction.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpDynamicFunction, + #superclass : #CarpNamedFunction, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpDynamicFunction >> bindingName [ + ^ 'defndynamic' +] diff --git a/src/Carp/CarpDynamicVariable.class.st b/src/Carp/CarpDynamicVariable.class.st new file mode 100644 index 0000000..38a397e --- /dev/null +++ b/src/Carp/CarpDynamicVariable.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpDynamicVariable, + #superclass : #CarpVariable, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpDynamicVariable >> bindingName [ + ^ 'defdynamic' +] diff --git a/src/Carp/CarpExpression.class.st b/src/Carp/CarpExpression.class.st new file mode 100644 index 0000000..9f4eb74 --- /dev/null +++ b/src/Carp/CarpExpression.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpExpression, + #superclass : #Object, + #category : #'Carp-IDE' +} + +{ #category : #converting } +CarpExpression >> toCarp [ + ^ self subclassResponsibility +] diff --git a/src/Carp-Parser/CarpFile.class.st b/src/Carp/CarpFile.class.st similarity index 95% rename from src/Carp-Parser/CarpFile.class.st rename to src/Carp/CarpFile.class.st index 2a0783c..e35c706 100644 --- a/src/Carp-Parser/CarpFile.class.st +++ b/src/Carp/CarpFile.class.st @@ -5,7 +5,7 @@ Class { 'fileName', 'contents' ], - #category : #'Carp-Parser' + #category : #'Carp-IDE' } { #category : #'instance creation' } diff --git a/src/Carp/CarpFloat.class.st b/src/Carp/CarpFloat.class.st new file mode 100644 index 0000000..72f76f6 --- /dev/null +++ b/src/Carp/CarpFloat.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpFloat, + #superclass : #CarpNumber, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpFloat >> suffix [ + ^ 'f' +] diff --git a/src/Carp/CarpInteger.class.st b/src/Carp/CarpInteger.class.st new file mode 100644 index 0000000..d9cccff --- /dev/null +++ b/src/Carp/CarpInteger.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpInteger, + #superclass : #CarpNumber, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpInteger >> suffix [ + ^ '' +] diff --git a/src/Carp/CarpLiteral.class.st b/src/Carp/CarpLiteral.class.st new file mode 100644 index 0000000..f5383d0 --- /dev/null +++ b/src/Carp/CarpLiteral.class.st @@ -0,0 +1,5 @@ +Class { + #name : #CarpLiteral, + #superclass : #CarpExpression, + #category : #'Carp-IDE' +} diff --git a/src/Carp/CarpLong.class.st b/src/Carp/CarpLong.class.st new file mode 100644 index 0000000..92e0e48 --- /dev/null +++ b/src/Carp/CarpLong.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpLong, + #superclass : #CarpNumber, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpLong >> suffix [ + ^ 'l' +] diff --git a/src/Carp/CarpMacro.class.st b/src/Carp/CarpMacro.class.st new file mode 100644 index 0000000..2ed5ae6 --- /dev/null +++ b/src/Carp/CarpMacro.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpMacro, + #superclass : #CarpNamedFunction, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpMacro >> bindingName [ + ^ 'defmacro' +] diff --git a/src/Carp/CarpModule.class.st b/src/Carp/CarpModule.class.st new file mode 100644 index 0000000..6b010a5 --- /dev/null +++ b/src/Carp/CarpModule.class.st @@ -0,0 +1,55 @@ +Class { + #name : #CarpModule, + #superclass : #CarpExpression, + #instVars : [ + 'uses', + 'expressions', + 'name' + ], + #category : #'Carp-IDE' +} + +{ #category : #'instance creation' } +CarpModule class >> named: aString [ + ^ self new name: aString +] + +{ #category : #accessing } +CarpModule >> addExpression: anExpression [ + expressions add: anExpression +] + +{ #category : #accessing } +CarpModule >> addUse: aString [ + uses add: aString +] + +{ #category : #initialization } +CarpModule >> initialize [ + uses := Set new. + expressions := OrderedCollection new. +] + +{ #category : #converting } +CarpModule >> name [ + ^ name +] + +{ #category : #accessing } +CarpModule >> name: aString [ + name := aString +] + +{ #category : #converting } +CarpModule >> toCarp [ + + ^ String streamContents: [ :aStream | + aStream << '(defmodule ' << self name << ' ' + << (uses ifEmpty: [ '' ] ifNotEmpty: [ + Character lf , Character tab , '(use-all ' + , (' ' join: uses) , ')' ]). + expressions do: [ :expression | + aStream << Character lf << Character tab + << expression toCarp ]. + aStream << ')' ] +] diff --git a/src/Carp/CarpNamedFunction.class.st b/src/Carp/CarpNamedFunction.class.st new file mode 100644 index 0000000..b7ab2b0 --- /dev/null +++ b/src/Carp/CarpNamedFunction.class.st @@ -0,0 +1,53 @@ +Class { + #name : #CarpNamedFunction, + #superclass : #CarpBinding, + #instVars : [ + 'arguments', + 'body' + ], + #category : #'Carp-IDE' +} + +{ #category : #'instance creation' } +CarpNamedFunction class >> named: aString withArguments: aCollection andBody: anExpression [ + ^ self new + name: aString; + arguments: aCollection; + body: anExpression +] + +{ #category : #accessing } +CarpNamedFunction >> addArgument: anArgument [ + arguments add: anArgument +] + +{ #category : #accessing } +CarpNamedFunction >> arguments: aCollection [ + arguments := aCollection +] + +{ #category : #accessing } +CarpNamedFunction >> body [ + + ^ body +] + +{ #category : #accessing } +CarpNamedFunction >> body: anExpression [ + body := anExpression +] + +{ #category : #initialization } +CarpNamedFunction >> initialize [ + arguments := OrderedCollection new +] + +{ #category : #converting } +CarpNamedFunction >> toCarp [ + + ^ String streamContents: [ :aStream | + aStream << '(' << self bindingName << ' ' << self name toCarp + << ' ['. + arguments do: [ :anArgument | aStream << anArgument toCarp << ' ' ]. + aStream << '] ' << self body toCarp << ')' ] +] diff --git a/src/Carp/CarpNumber.class.st b/src/Carp/CarpNumber.class.st new file mode 100644 index 0000000..6cf6881 --- /dev/null +++ b/src/Carp/CarpNumber.class.st @@ -0,0 +1,28 @@ +Class { + #name : #CarpNumber, + #superclass : #CarpLiteral, + #instVars : [ + 'number' + ], + #category : #'Carp-IDE' +} + +{ #category : #'instance creation' } +CarpNumber class >> number: aNumber [ + ^ self new number: aNumber +] + +{ #category : #acccessing } +CarpNumber >> number: aNumber [ + number := aNumber +] + +{ #category : #accessing } +CarpNumber >> suffix [ + ^ self subclassResponsibility +] + +{ #category : #converting } +CarpNumber >> toCarp [ + ^ number asString, self suffix +] diff --git a/src/Carp/CarpStaticFunction.class.st b/src/Carp/CarpStaticFunction.class.st new file mode 100644 index 0000000..37dad98 --- /dev/null +++ b/src/Carp/CarpStaticFunction.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpStaticFunction, + #superclass : #CarpNamedFunction, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpStaticFunction >> bindingName [ + ^ 'defn' +] diff --git a/src/Carp/CarpStaticVariable.class.st b/src/Carp/CarpStaticVariable.class.st new file mode 100644 index 0000000..3f27b64 --- /dev/null +++ b/src/Carp/CarpStaticVariable.class.st @@ -0,0 +1,10 @@ +Class { + #name : #CarpStaticVariable, + #superclass : #CarpVariable, + #category : #'Carp-IDE' +} + +{ #category : #accessing } +CarpStaticVariable >> bindingName [ + ^ 'def' +] diff --git a/src/Carp/CarpStringExpression.class.st b/src/Carp/CarpStringExpression.class.st new file mode 100644 index 0000000..1633721 --- /dev/null +++ b/src/Carp/CarpStringExpression.class.st @@ -0,0 +1,23 @@ +Class { + #name : #CarpStringExpression, + #superclass : #CarpExpression, + #instVars : [ + 'contents' + ], + #category : #'Carp-IDE' +} + +{ #category : #'instance creation' } +CarpStringExpression class >> contents: aString [ + ^ self new contents: aString +] + +{ #category : #'instance creation' } +CarpStringExpression >> contents: aString [ + contents := aString +] + +{ #category : #accessing } +CarpStringExpression >> toCarp [ + ^ contents asString +] diff --git a/src/Carp/CarpSymbol.class.st b/src/Carp/CarpSymbol.class.st new file mode 100644 index 0000000..fbd04c6 --- /dev/null +++ b/src/Carp/CarpSymbol.class.st @@ -0,0 +1,23 @@ +Class { + #name : #CarpSymbol, + #superclass : #CarpLiteral, + #instVars : [ + 'name' + ], + #category : #'Carp-IDE' +} + +{ #category : #'instance creation' } +CarpSymbol class >> named: aString [ + ^ self new name: aString +] + +{ #category : #accessing } +CarpSymbol >> name: aString [ + name := aString +] + +{ #category : #accessing } +CarpSymbol >> toCarp [ + ^ name +] diff --git a/src/Carp/CarpVariable.class.st b/src/Carp/CarpVariable.class.st new file mode 100644 index 0000000..1c45329 --- /dev/null +++ b/src/Carp/CarpVariable.class.st @@ -0,0 +1,34 @@ +Class { + #name : #CarpVariable, + #superclass : #CarpBinding, + #instVars : [ + 'binding' + ], + #category : #'Carp-IDE' +} + +{ #category : #'instance creation' } +CarpVariable class >> named: aString binding: anExpression [ + + ^ self new + name: aString; + binding: anExpression +] + +{ #category : #accessing } +CarpVariable >> binding [ + ^ binding +] + +{ #category : #accessing } +CarpVariable >> binding: anExpression [ + binding := anExpression +] + +{ #category : #converting } +CarpVariable >> toCarp [ + + ^ String streamContents: [ :aStream | + aStream << '(' << self bindingName << ' ' << self name toCarp + << ' ' << self binding toCarp << ')' ] +] diff --git a/src/Carp/Float.extension.st b/src/Carp/Float.extension.st new file mode 100644 index 0000000..2fa41db --- /dev/null +++ b/src/Carp/Float.extension.st @@ -0,0 +1,11 @@ +Extension { #name : #Float } + +{ #category : #'*Carp' } +Float >> asCarpDouble [ + ^ CarpDouble number: self +] + +{ #category : #'*Carp' } +Float >> asCarpFloat [ + ^ CarpFloat number: self +] diff --git a/src/Carp/Integer.extension.st b/src/Carp/Integer.extension.st new file mode 100644 index 0000000..cbcaff5 --- /dev/null +++ b/src/Carp/Integer.extension.st @@ -0,0 +1,11 @@ +Extension { #name : #Integer } + +{ #category : #'*Carp' } +Integer >> asCarpInteger [ + ^ CarpInteger number: self +] + +{ #category : #'*Carp' } +Integer >> asCarpLong [ + ^ CarpLong number: self +]