{- Copyright 2010 Dominique Devriese This file is part of the grammar-combinators library. The grammar-combinators library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Foobar. If not, see . -} {-# LANGUAGE TemplateHaskell #-} module Text.GrammarCombinators.Test.RealLL1 where import Text.GrammarCombinators.Base import Text.GrammarCombinators.Parser.RealLL1 import Text.GrammarCombinators.Transform.FoldLoops import Text.GrammarCombinators.TH.RealLL1 import Text.GrammarCombinators.TH.FoldLoops import Text.GrammarCombinators.Test.Lexer import Language.Haskell.TH.Syntax import Data.Maybe table = prepareLL1Parser lg precomputedTable = $(liftRealLL1Table $ prepareLL1Parser lg) res = parseRealLL1 plg table (FLBase CalcTokenList) "123()))++81-//9" pres = parseRealLL1 plg precomputedTable (FLBase CalcTokenList) "123()))++81-//9" test result = case fromJust result of FLBV (CTVL v) -> v