From 233d849c791bc6c935f71ea84f5adb21d65ae889 Mon Sep 17 00:00:00 2001 From: Erez Shinan Date: Sun, 1 Apr 2018 11:34:19 +0300 Subject: [PATCH] Updated How to use Lark (markdown) --- How-to-use-Lark.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/How-to-use-Lark.md b/How-to-use-Lark.md index 3e18b0b..1cc1b98 100644 --- a/How-to-use-Lark.md +++ b/How-to-use-Lark.md @@ -8,10 +8,10 @@ This is the recommended process for working with Lark: 3. Try your grammar in Lark against each input sample. Make sure the resulting parse-trees make sense. - - You can perform steps 1-3 repeatedly, gradually growing your grammar to include more sentences. - 4. Use Lark's grammar features to [[shape the tree|Tree Construction]]: Get rid of superfluous rules by inlining them, and use aliases when specific cases need clarification. + - You can perform steps 1-4 repeatedly, gradually growing your grammar to include more sentences. + 5. Create a transformer to evaluate the parse-tree into a structure you'll be comfortable to work with. This may include evaluate literals, merging branches, or even converting the entire tree into your own set of AST classes. Of course, some specific use-cases may deviate from this process. Feel free to suggest these cases, and I'll add them to this page.