1
0
forked from GitHub/gf-core

Use strict parser and GHC-specific lexer for source grammars.

This commit is contained in:
bringert
2004-12-06 17:44:59 +00:00
parent 798cb37002
commit 0098d5e943
3 changed files with 71 additions and 54 deletions

View File

@@ -1,7 +1,7 @@
{-# OPTIONS -fglasgow-exts -cpp #-} {-# OPTIONS -fglasgow-exts -cpp #-}
{-# LINE 3 "LexGFC.x" #-} {-# LINE 4 "LexGFC.x" #-}
module LexGFC where module LexGFC where
import SharedString import SharedString -- H
import ErrM import ErrM
#if __GLASGOW_HASKELL__ >= 503 #if __GLASGOW_HASKELL__ >= 503
@@ -30,15 +30,15 @@ alex_deflt :: AlexAddr
alex_deflt = AlexA# "\x08\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0c\x00\x0c\x00\xff\xff\xff\xff"# alex_deflt = AlexA# "\x08\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0c\x00\x0c\x00\xff\xff\xff\xff"#
alex_accept = listArray (0::Int,14) [[],[],[(AlexAccSkip)],[(AlexAcc (alex_action_1))],[(AlexAcc (alex_action_1))],[(AlexAcc (alex_action_1))],[],[],[(AlexAcc (alex_action_2))],[(AlexAcc (alex_action_2))],[(AlexAcc (alex_action_3))],[],[],[],[(AlexAcc (alex_action_4))]] alex_accept = listArray (0::Int,14) [[],[],[(AlexAccSkip)],[(AlexAcc (alex_action_1))],[(AlexAcc (alex_action_1))],[(AlexAcc (alex_action_1))],[],[],[(AlexAcc (alex_action_2))],[(AlexAcc (alex_action_2))],[(AlexAcc (alex_action_3))],[],[],[],[(AlexAcc (alex_action_4))]]
{-# LINE 31 "LexGFC.x" #-} {-# LINE 32 "LexGFC.x" #-}
tok f p s = f p s tok f p s = f p s
data Tok = data Tok =
TS !String -- reserved words TS !String -- reserved words -- H
| TL !String -- string literals | TL !String -- string literals -- H
| TI String -- integer literals | TI String -- integer literals
| TV !String -- identifiers -- H | TV !String -- identifiers -- H
| TD String -- double precision float literals | TD String -- double precision float literals
| TC String -- character literals | TC String -- character literals
@@ -132,7 +132,7 @@ alexInputPrevChar (p, c, s) = c
alex_action_1 = tok (\p s -> PT p (TS (shareString s))) alex_action_1 = tok (\p s -> PT p (TS (shareString s)))
alex_action_2 = tok (\p s -> PT p (eitherResIdent (TV . shareString) s)) alex_action_2 = tok (\p s -> PT p (eitherResIdent (TV . shareString) s))
alex_action_3 = tok (\p s -> PT p (TL $ shareString $ unescapeInitTail s)) alex_action_3 = tok (\p s -> PT p (TL $ unescapeInitTail $ shareString s))
alex_action_4 = tok (\p s -> PT p (TI s)) alex_action_4 = tok (\p s -> PT p (TI s))
{-# LINE 1 "GenericTemplate.hs" #-} {-# LINE 1 "GenericTemplate.hs" #-}
{-# LINE 1 "<built-in>" #-} {-# LINE 1 "<built-in>" #-}

File diff suppressed because one or more lines are too long

View File

@@ -2861,7 +2861,7 @@ pOldGrammar tks = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut82 x
pExp tks = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut56 x)) pExp tks = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut56 x))
happySeq = happyDontSeq happySeq = happyDoSeq
returnM :: a -> Err a returnM :: a -> Err a
returnM = return returnM = return
@@ -2875,7 +2875,7 @@ happyError ts =
myLexer = tokens myLexer = tokens
{-# LINE 1 "GenericTemplate.hs" #-} {-# LINE 1 "GenericTemplate.hs" #-}
-- $Id: ParGF.hs,v 1.4 2004/09/14 18:05:47 aarne Exp $ -- $Id: ParGF.hs,v 1.5 2004/12/06 18:44:59 bringert Exp $