regex patterns for tokens

This commit is contained in:
aarne
2006-01-07 12:26:11 +00:00
parent a641bf4004
commit 4e42d73ee5
16 changed files with 358 additions and 199 deletions

View File

@@ -1,10 +1,10 @@
-- -*- haskell -*-
-- This Alex file was machine-generated by the BNF converter
{
module GF.Source.LexGF where -- H
module LexGF where
import GF.Data.ErrM -- H
import GF.Data.SharedString -- H
import ErrM
import SharedString
}
@@ -16,7 +16,7 @@ $i = [$l $d _ '] -- identifier character
$u = [\0-\255] -- universal: any character
@rsyms = -- reserved words consisting of special symbols
\; | \= | \{ | \} | \( | \) | \: | \- \> | \* \* | \, | \[ | \] | \. | \| | \% | \? | \< | \> | \@ | \! | \* | \\ | \= \> | \+ \+ | \+ | \_ | \$ | \/ | \-
\; | \= | \{ | \} | \( | \) | \: | \- \> | \* \* | \, | \[ | \] | \- | \. | \| | \% | \? | \< | \> | \@ | \! | \* | \+ | \+ \+ | \\ | \= \> | \_ | \$ | \/
:-
"--" [.]* ; -- Toss single line comments
@@ -30,7 +30,7 @@ $l $i* { tok (\p s -> PT p (eitherResIdent (TV . share) s)) }
\" ([$u # [\" \\ \n]] | (\\ (\" | \\ | \' | n | t)))* \"{ tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) }
$d+ { tok (\p s -> PT p (TI $ share s)) }
$d+ \. $d+ (e (\-)? $d+)? { tok (\p s -> PT p (TD $ share s)) }
{