@@ -7,9 +7,6 @@ import Alpacc.Encode
77import Alpacc.Generator.Analyzer
88import Alpacc.Generator.Futhark.Futharkify
99import Alpacc.HashTable
10- import Alpacc.LLP
11- ( Bracket (.. ),
12- )
1310import Alpacc.Types
1411import Data.FileEmbed
1512import Data.String.Interpolate (i )
@@ -19,10 +16,6 @@ import Data.Text qualified as Text
1916futharkParser :: Text
2017futharkParser = $ (embedStringFile " futhark/parser.fut" )
2118
22- futharkifyBracket :: (Futharkify a ) => Bracket a -> RawString
23- futharkifyBracket (LBracket a) = RawString . (" left " <> ) $ futharkify a
24- futharkifyBracket (RBracket a) = RawString . (" right " <> ) $ futharkify a
25-
2619-- | Creates Futhark source code which contains a parallel parser that can
2720-- create the productions list for a input which is indexes of terminals.
2821generateParser :: UInt -> Parser -> Text
@@ -40,12 +33,6 @@ type terminal = terminal_module.t
4033type production = production_module.t
4134type bracket = bracket_module.t
4235
43- def left (s : bracket) : bracket =
44- bracket_module.set_bit (bracket_module.num_bits - 1) s 1
45-
46- def right (s : bracket) : bracket =
47- bracket_module.set_bit (bracket_module.num_bits - 1) s 0
48-
4936def number_of_productions: i64 = #{number_of_productions}
5037def q: i64 = #{q}
5138def k: i64 = #{k}
@@ -81,7 +68,7 @@ def productions: [productions_size]production =
8168 empty_terminal = emptyTerminal parser
8269 hash_table = llpTable parser
8370 number_of_productions = numberOfProductions parser
84- stacks = futharkifyBracket <$> llpStacks hash_table
71+ stacks = llpStacks hash_table
8572 productions = llpProductions hash_table
8673 stacks_size = length $ llpStacks hash_table
8774 productions_size = length $ llpProductions hash_table
0 commit comments