You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will create the Futhark source file `paper_grammar.fut` which contains the actual parser which is a function `parse`. This function takes as input an array of indexes assigned to terminals and maps this to an array of indexes assigned to the productions. The indexes are assigned in the order they are defined. For this example the indexes for the terminals would be `0` is `a`, `1` is `b`, `2` is `c` and `3` is `$`. For the productions `0` is `T' -> T $`, `1` is `T -> R`, `2` is `T -> a T c`, `3` is `R -> `, `4` is `R -> b R`.
24
24
25
-
A leftmost derivable string from this grammar is `aabbbcc$` which corresponds to the indexes `[0, 0, 1, 1, 1, 2, 2, 3]`. When parsing this array the resulting productions sequence is `[0, 2, 2, 1, 4, 4, 4, 3]`.
25
+
A leftmost derivable string from this grammar is `aabbbcc$` which corresponds to the indexes `[0, 0, 1, 1, 1, 2, 2, 3]`. When parsing this array the resulting production sequence is `[0, 2, 2, 1, 4, 4, 4, 3]`.
26
26
27
27
If an input is given that cannot be parsed then the empty array is returned.
Copy file name to clipboardExpand all lines: app/Main.hs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ grammarError grammar
100
100
|not$null p_dups =Just [i|The given grammar contains duplicate productions because of #{p_dups_str}.|]
101
101
| isLeftRecursive grammar =Just [i|The given grammar contains left recursion.|]
102
102
|not$null left_factors =Just [i|The given grammar contains productions that has common left factors due to the following nonterminals #{left_factors_str}.|]
103
-
| rightNullableDoubleNT grammar =Just [i|The given grammar is able to derive two consecutive nonterminals that are the same and nullable.|]
103
+
| rightNullableDoubleNT grammar =Just [i|The given grammar should not be able to derive two consecutive nullable nonterminals that are the same where the tail is nullable.|]
104
104
|not$null nonproductive =Just [i|The given grammar contains nonproductive productions due to the following nonterminals #{nonproductive_str}.|]
0 commit comments