module Text.Highlighter.Lexers.Modelica (lexer) where
import qualified Text.Highlighter.Lexers.Html as Html
import Text.Regex.PCRE.Light
import Text.Highlighter.Types

lexer :: Lexer
lexer = Lexer
    { lName = "\72\116\109\108"
    , lAliases = ["\109\111\100\101\108\105\99\97"]
    , lExtensions = ["\46\109\111"]
    , lMimetypes = ["\116\101\120\116\47\120\45\109\111\100\101\108\105\99\97"]
    , lStart = root'
    , lFlags = [caseless, dotall]
    }

functions' :: TokenMatcher
functions' =
    [ tok "\40\97\98\115\124\97\99\111\115\124\97\99\111\115\104\124\97\115\105\110\124\97\115\105\110\104\124\97\116\97\110\124\97\116\97\110\50\124\97\116\97\110\51\124\99\101\105\108\124\99\111\115\124\99\111\115\104\124\99\114\111\115\115\124\100\105\118\124\101\120\112\124\102\108\111\111\114\124\108\111\103\124\108\111\103\49\48\124\109\111\100\124\114\101\109\124\115\105\103\110\124\115\105\110\124\115\105\110\104\124\115\105\122\101\124\115\113\114\116\124\116\97\110\124\116\97\110\104\124\122\101\114\111\115\41\92\98" (Arbitrary "\78\97\109\101" :. Arbitrary "\70\117\110\99\116\105\111\110")
    ]

classes' :: TokenMatcher
classes' =
    [ tok "\40\98\108\111\99\107\124\99\108\97\115\115\124\99\111\110\110\101\99\116\111\114\124\102\117\110\99\116\105\111\110\124\109\111\100\101\108\124\112\97\99\107\97\103\101\124\114\101\99\111\114\100\124\116\121\112\101\41\92\98" (Arbitrary "\78\97\109\101" :. Arbitrary "\67\108\97\115\115")
    ]

statements' :: TokenMatcher
statements' =
    [ tokNext "\34" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\83\116\114\105\110\103") (GoTo string')
    , tok "\40\92\100\43\92\46\92\100\42\124\92\46\92\100\43\124\92\100\43\124\92\100\46\41\91\101\69\93\91\43\45\93\63\92\100\43\91\108\76\93\63" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\78\117\109\98\101\114" :. Arbitrary "\70\108\111\97\116")
    , tok "\40\92\100\43\92\46\92\100\42\124\92\46\92\100\43\41" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\78\117\109\98\101\114" :. Arbitrary "\70\108\111\97\116")
    , tok "\92\100\43\91\76\108\93\63" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\78\117\109\98\101\114" :. Arbitrary "\73\110\116\101\103\101\114")
    , tok "\91\126\33\37\94\38\42\43\61\124\63\58\60\62\47\45\93" (Arbitrary "\79\112\101\114\97\116\111\114")
    , tok "\91\40\41\92\91\92\93\123\125\44\46\59\93" (Arbitrary "\80\117\110\99\116\117\97\116\105\111\110")
    , tok "\40\116\114\117\101\124\102\97\108\115\101\124\78\85\76\76\124\82\101\97\108\124\73\110\116\101\103\101\114\124\66\111\111\108\101\97\110\41\92\98" (Arbitrary "\78\97\109\101" :. Arbitrary "\66\117\105\108\116\105\110")
    , tok "\40\91\97\45\122\65\45\90\95\93\91\92\119\93\42\124\39\91\97\45\122\65\45\90\95\92\43\92\45\92\42\92\47\92\94\93\91\92\119\93\42\39\41\40\92\46\40\91\97\45\122\65\45\90\95\93\91\92\119\93\42\124\39\91\97\45\122\65\45\90\95\92\43\92\45\92\42\92\47\92\94\93\91\92\119\93\42\39\41\41\43" (Arbitrary "\78\97\109\101" :. Arbitrary "\67\108\97\115\115")
    , tok "\40\39\91\92\119\92\43\92\45\92\42\92\47\92\94\93\43\39\124\92\119\43\41" (Arbitrary "\78\97\109\101")
    ]

whitespace' :: TokenMatcher
whitespace' =
    [ tok "\92\110" (Arbitrary "\84\101\120\116")
    , tok "\92\115\43" (Arbitrary "\84\101\120\116")
    , tok "\92\92\92\110" (Arbitrary "\84\101\120\116")
    , tok "\47\47\40\92\110\124\40\46\124\92\110\41\42\63\91\94\92\92\93\92\110\41" (Arbitrary "\67\111\109\109\101\110\116")
    , tok "\47\40\92\92\92\110\41\63\91\42\93\40\46\124\92\110\41\42\63\91\42\93\40\92\92\92\110\41\63\47" (Arbitrary "\67\111\109\109\101\110\116")
    ]

htmlContent' :: TokenMatcher
htmlContent' =
    [ tokNext "\60\92\115\42\47\92\115\42\104\116\109\108\92\115\42\62" (Arbitrary "\78\97\109\101" :. Arbitrary "\84\97\103") Pop
    , tok "\46\43\63\40\63\61\60\92\115\42\47\92\115\42\104\116\109\108\92\115\42\62\41" (Using Html.lexer)
    ]

keywords' :: TokenMatcher
keywords' =
    [ tok "\40\97\108\103\111\114\105\116\104\109\124\97\110\110\111\116\97\116\105\111\110\124\98\114\101\97\107\124\99\111\110\110\101\99\116\124\99\111\110\115\116\97\110\116\124\99\111\110\115\116\114\97\105\110\101\100\98\121\124\100\105\115\99\114\101\116\101\124\101\97\99\104\124\101\108\115\101\124\101\108\115\101\105\102\124\101\108\115\101\119\104\101\110\124\101\110\99\97\112\115\117\108\97\116\101\100\124\101\110\117\109\101\114\97\116\105\111\110\124\101\110\100\124\101\113\117\97\116\105\111\110\124\101\120\105\116\124\101\120\112\97\110\100\97\98\108\101\124\101\120\116\101\110\100\115\124\101\120\116\101\114\110\97\108\124\102\97\108\115\101\124\102\105\110\97\108\124\102\108\111\119\124\102\111\114\124\105\102\124\105\109\112\111\114\116\124\105\110\124\105\110\110\101\114\124\105\110\112\117\116\124\108\111\111\112\124\110\111\110\100\105\115\99\114\101\116\101\124\111\117\116\101\114\124\111\117\116\112\117\116\124\112\97\114\97\109\101\116\101\114\124\112\97\114\116\105\97\108\124\112\114\111\116\101\99\116\101\100\124\112\117\98\108\105\99\124\114\101\100\101\99\108\97\114\101\124\114\101\112\108\97\99\101\97\98\108\101\124\115\116\114\101\97\109\124\116\105\109\101\124\116\104\101\110\124\116\114\117\101\124\119\104\101\110\124\119\104\105\108\101\124\119\105\116\104\105\110\41\92\98" (Arbitrary "\75\101\121\119\111\114\100")
    ]

operators' :: TokenMatcher
operators' =
    [ tok "\40\97\110\100\124\97\115\115\101\114\116\124\99\97\114\100\105\110\97\108\105\116\121\124\99\104\97\110\103\101\124\100\101\108\97\121\124\100\101\114\124\101\100\103\101\124\105\110\105\116\105\97\108\124\110\111\69\118\101\110\116\124\110\111\116\124\111\114\124\112\114\101\124\114\101\105\110\105\116\124\114\101\116\117\114\110\124\115\97\109\112\108\101\124\115\109\111\111\116\104\124\116\101\114\109\105\110\97\108\124\116\101\114\109\105\110\97\116\101\41\92\98" (Arbitrary "\78\97\109\101" :. Arbitrary "\66\117\105\108\116\105\110")
    ]

root' :: TokenMatcher
root' =
    [ anyOf whitespace'
    , anyOf keywords'
    , anyOf functions'
    , anyOf operators'
    , anyOf classes'
    , tokNext "\40\34\60\104\116\109\108\62\124\60\104\116\109\108\62\41" (Arbitrary "\78\97\109\101" :. Arbitrary "\84\97\103") (GoTo htmlContent')
    , anyOf statements'
    ]

string' :: TokenMatcher
string' =
    [ tokNext "\34" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\83\116\114\105\110\103") Pop
    , tok "\92\92\40\91\92\92\97\98\102\110\114\116\118\34\92\39\93\124\120\91\97\45\102\65\45\70\48\45\57\93\123\50\44\52\125\124\91\48\45\55\93\123\49\44\51\125\41" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\83\116\114\105\110\103" :. Arbitrary "\69\115\99\97\112\101")
    , tok "\91\94\92\92\34\92\110\93\43" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\83\116\114\105\110\103")
    , tok "\92\92\92\110" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\83\116\114\105\110\103")
    , tok "\92\92" (Arbitrary "\76\105\116\101\114\97\108" :. Arbitrary "\83\116\114\105\110\103")
    ]