aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Lexer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/VeriFuzz/Lexer.hs')
-rw-r--r--src/VeriFuzz/Lexer.hs374
1 files changed, 187 insertions, 187 deletions
diff --git a/src/VeriFuzz/Lexer.hs b/src/VeriFuzz/Lexer.hs
index 9e9f35e..fe71abb 100644
--- a/src/VeriFuzz/Lexer.hs
+++ b/src/VeriFuzz/Lexer.hs
@@ -11,36 +11,36 @@ Lexer for Verilog.
-}
module VeriFuzz.Lexer
- ( lexer
- , identifier
- , reserved
- , operator
- , reservedOp
- , charLiteral
- , stringLiteral
- , natural
- , integer
- , float
- , naturalOrFloat
- , decimal
- , hexadecimal
- , octal
- , symbol
- , lexeme
- , whiteSpace
- , parens
- , braces
- , angles
- , brackets
- , squares
- , comma
- , colon
- , dot
- , semiSep
- , semiSep1
- , commaSep
- , commaSep1
- )
+ ( lexer
+ , identifier
+ , reserved
+ , operator
+ , reservedOp
+ , charLiteral
+ , stringLiteral
+ , natural
+ , integer
+ , float
+ , naturalOrFloat
+ , decimal
+ , hexadecimal
+ , octal
+ , symbol
+ , lexeme
+ , whiteSpace
+ , parens
+ , braces
+ , angles
+ , brackets
+ , squares
+ , comma
+ , colon
+ , dot
+ , semiSep
+ , semiSep1
+ , commaSep
+ , commaSep1
+ )
where
import Data.Char (digitToInt)
@@ -104,9 +104,9 @@ decimal = P.decimal lexer
number :: Integer -> Parser Char -> Parser Integer
number base baseDigit = do
- digits <- many1 baseDigit
- let n = foldl (\x d -> base * x + toInteger (digitToInt d)) 0 digits
- seq n (return n)
+ digits <- many1 baseDigit
+ let n = foldl (\x d -> base * x + toInteger (digitToInt d)) 0 digits
+ seq n (return n)
hexadecimal :: Parser Integer
hexadecimal = number 16 hexDigit
@@ -161,161 +161,161 @@ commaSep1 = P.commaSep1 lexer
reservedOp' :: [String]
reservedOp' =
- [ "!"
- , "~"
- , "~&"
- , "~|"
- , "+"
- , "-"
- , "*"
- , "/"
- , "%"
- , "=="
- , "!="
- , "==="
- , "!=="
- , "&&"
- , "||"
- , "<"
- , "<="
- , ">"
- , ">="
- , "&"
- , "|"
- , "^"
- , "^~"
- , "~^"
- , "**"
- , "<<"
- , ">>"
- , "<<<"
- , ">>>"
- ]
+ [ "!"
+ , "~"
+ , "~&"
+ , "~|"
+ , "+"
+ , "-"
+ , "*"
+ , "/"
+ , "%"
+ , "=="
+ , "!="
+ , "==="
+ , "!=="
+ , "&&"
+ , "||"
+ , "<"
+ , "<="
+ , ">"
+ , ">="
+ , "&"
+ , "|"
+ , "^"
+ , "^~"
+ , "~^"
+ , "**"
+ , "<<"
+ , ">>"
+ , "<<<"
+ , ">>>"
+ ]
reserved' :: [String]
reserved' =
- [ "always"
- , "and"
- , "assign"
- , "automatic"
- , "begin"
- , "buf"
- , "bufif0"
- , "bufif1"
- , "case"
- , "casex"
- , "casez"
- , "cell"
- , "cmos"
- , "config"
- , "deassign"
- , "default"
- , "defparam"
- , "design"
- , "disable"
- , "edge"
- , "else"
- , "end"
- , "endcase"
- , "endconfig"
- , "endfunction"
- , "endgenerate"
- , "endmodule"
- , "endprimitive"
- , "endspecify"
- , "endtable"
- , "endtask"
- , "event"
- , "for"
- , "force"
- , "forever"
- , "fork"
- , "function"
- , "generate"
- , "genvar"
- , "highz0"
- , "highz1"
- , "if"
- , "ifnone"
- , "incdir"
- , "include"
- , "initial"
- , "inout"
- , "input"
- , "instance"
- , "integer"
- , "join"
- , "large"
- , "liblist"
- , "library"
- , "localparam"
- , "macromodule"
- , "medium"
- , "module"
- , "nand"
- , "negedge"
- , "nmos"
- , "nor"
- , "noshowcancelled"
- , "not"
- , "notif0"
- , "notif1"
- , "or"
- , "output"
- , "parameter"
- , "pmos"
- , "posedge"
- , "primitive"
- , "pull0"
- , "pull1"
- , "pulldown"
- , "pullup"
- , "pulsestyle_onevent"
- , "pulsestyle_ondetect"
- , "remos"
- , "real"
- , "realtime"
- , "reg"
- , "release"
- , "repeat"
- , "rnmos"
- , "rpmos"
- , "rtran"
- , "rtranif0"
- , "rtranif1"
- , "scalared"
- , "showcancelled"
- , "signed"
- , "small"
- , "specify"
- , "specparam"
- , "strong0"
- , "strong1"
- , "supply0"
- , "supply1"
- , "table"
- , "task"
- , "time"
- , "tran"
- , "tranif0"
- , "tranif1"
- , "tri"
- , "tri0"
- , "tri1"
- , "triand"
- , "trior"
- , "trireg"
- , "unsigned"
- , "use"
- , "vectored"
- , "wait"
- , "wand"
- , "weak0"
- , "weak1"
- , "while"
- , "wire"
- , "wor"
- , "xnor"
- , "xor"
- ]
+ [ "always"
+ , "and"
+ , "assign"
+ , "automatic"
+ , "begin"
+ , "buf"
+ , "bufif0"
+ , "bufif1"
+ , "case"
+ , "casex"
+ , "casez"
+ , "cell"
+ , "cmos"
+ , "config"
+ , "deassign"
+ , "default"
+ , "defparam"
+ , "design"
+ , "disable"
+ , "edge"
+ , "else"
+ , "end"
+ , "endcase"
+ , "endconfig"
+ , "endfunction"
+ , "endgenerate"
+ , "endmodule"
+ , "endprimitive"
+ , "endspecify"
+ , "endtable"
+ , "endtask"
+ , "event"
+ , "for"
+ , "force"
+ , "forever"
+ , "fork"
+ , "function"
+ , "generate"
+ , "genvar"
+ , "highz0"
+ , "highz1"
+ , "if"
+ , "ifnone"
+ , "incdir"
+ , "include"
+ , "initial"
+ , "inout"
+ , "input"
+ , "instance"
+ , "integer"
+ , "join"
+ , "large"
+ , "liblist"
+ , "library"
+ , "localparam"
+ , "macromodule"
+ , "medium"
+ , "module"
+ , "nand"
+ , "negedge"
+ , "nmos"
+ , "nor"
+ , "noshowcancelled"
+ , "not"
+ , "notif0"
+ , "notif1"
+ , "or"
+ , "output"
+ , "parameter"
+ , "pmos"
+ , "posedge"
+ , "primitive"
+ , "pull0"
+ , "pull1"
+ , "pulldown"
+ , "pullup"
+ , "pulsestyle_onevent"
+ , "pulsestyle_ondetect"
+ , "remos"
+ , "real"
+ , "realtime"
+ , "reg"
+ , "release"
+ , "repeat"
+ , "rnmos"
+ , "rpmos"
+ , "rtran"
+ , "rtranif0"
+ , "rtranif1"
+ , "scalared"
+ , "showcancelled"
+ , "signed"
+ , "small"
+ , "specify"
+ , "specparam"
+ , "strong0"
+ , "strong1"
+ , "supply0"
+ , "supply1"
+ , "table"
+ , "task"
+ , "time"
+ , "tran"
+ , "tranif0"
+ , "tranif1"
+ , "tri"
+ , "tri0"
+ , "tri1"
+ , "triand"
+ , "trior"
+ , "trireg"
+ , "unsigned"
+ , "use"
+ , "vectored"
+ , "wait"
+ , "wand"
+ , "weak0"
+ , "weak1"
+ , "while"
+ , "wire"
+ , "wor"
+ , "xnor"
+ , "xor"
+ ]