1
0
forked from GitHub/gf-core

move the FCFG lexer to FCFG.Active where it should have been. It was a hack anyway

This commit is contained in:
kr.angelov
2007-09-24 08:56:37 +00:00
parent 61503477f0
commit 26b1efe8b7
3 changed files with 12 additions and 14 deletions

View File

@@ -148,7 +148,15 @@ xchart2syntaxchart (XChart actives finals) pinfo =
literals :: FCFPInfo -> Input FToken -> [(FCat,Item)]
literals pinfo toks =
[let (c,node) = grammarLexer pinfo t in (c,Final [makeRange i j] node) | Edge i j t <- inputEdges toks, not (t `elem` grammarToks pinfo)]
[let (c,node) = lexer t in (c,Final [makeRange i j] node) | Edge i j t <- inputEdges toks, not (t `elem` grammarToks pinfo)]
where
lexer t =
case reads t of
[(n,"")] -> (fcatInt, SInt (n::Integer))
_ -> case reads t of
[(f,"")] -> (fcatFloat, SFloat (f::Double))
_ -> (fcatString,SString t)
----------------------------------------------------------------------
-- Earley --