module Casl-Lexical %% written/changed by Bjarke Wedemeijer (January 1998) %% adapted by Mark van den Brand (June 1999) %% adapted by Mark van den Brand (November 2000) %% adapted by Christian Maeder (January 2002) %% adapted by Christian Maeder (February 2004) exports sorts Ann Number Char Literal Id Simple-Id Sort-Id Token Place Path Url Digit Digits aliases ~[\n]* -> Text-Line (~[\)]|(")" ~[\%]))* -> Text-Lines [\ \t]* -> White-Space lexical syntax [\ \n\t\13] -> LAYOUT "%[" (~[\]]|("]" ~[\%]))* "]%" -> LAYOUT "%%" Text-Line "\n" -> Comment-Line "%{" (~[\}]|("}" ~[\%]))* "}%" -> Comment-Group %% Annotations "%(" Text-Lines ")%" -> Label "%" Words -> Annote-Word Annote-Word Text-Line "\n" -> Annote-Line Annote-Word "(" Text-Lines ")%" -> Annote-Group %% Words, Sign [\192-\207\209-\214\216-\221] -> Letter [\223-\239\241-\246\248-\253\255] -> Letter [A-Za-z] -> Letter [0-9] -> Digit Digit Digit+ -> Digits Letter | "'" | Digit -> Word-Char Word-Char+ -> Word {avoid} Letter Word-Char* ("_" Word)* -> Words "." Words -> Dot-Words [\161-\163\167\169\172\176-\179] -> Sign [\181-\183\185\191\215\247] -> Sign [\+\-\*\/\\\&\=\<\>\!\?\:\.\$\@\#\^\~\|] -> Sign Sign+ -> Signs {avoid} Digit -> Number Digits -> Number Number "." Number -> Fraction Number "E" [\+\-]? Number -> Floating Fraction "E" [\+\-]? Number -> Floating "\\" [01] [0-9] [0-9] -> Char "\\" "2" [0-4] [0-9] -> Char "\\" "2" "5" [0-5] -> Char "\\" "x" [0-9A-F][0-9A-F] -> Char "\\" "o" [0-3] [0-7] [0-7] -> Char "\\" [ntrvbfa\?\\\"\'] -> Char ~[\0-\31\"\\] -> Char [\t\n\13] -> Char "'" Char|[\"] "'" -> Quoted-Char [\"] Char* [\"] -> String %% The lexical syntax for libraries. "%" [0-9a-fA-F] [0-9a-fA-F] -> Path-Char [A-Za-z0-9\:\;\=\$\?\+\\\_\@\.\&\!\~\*\"\'\(\)\,] -> Path-Char Path-Char+ -> Path-Word {Path-Word [\/]}+ -> Path {avoid} "http:" Path -> Url {avoid} "ftp:" Path -> Url {avoid} "file:" Path -> Url {avoid} lexical restrictions Words -/- [A-Za-z0-9\'\192-\207\209-\214\216-\221\223-\239\241-\246\248-253\255] Signs -/- [\+\-\*\/\\\&\=\<\>\!\?\:\.\$\@\#\^\~\|\161-\163\167\169\172\176-\179\181-\183\185\191\215\247] context-free syntax ":" -> Signs {reject} ":?" -> Signs {reject} "::=" -> Signs {reject} "=" -> Signs {reject} "=>" -> Signs {reject} "<=>" -> Signs {reject} "." -> Signs {reject} "·" -> Signs {reject} "|" -> Signs {reject} "|->" -> Signs {reject} "/\\" -> Signs {reject} "\\/" -> Signs {reject} "¬" -> Signs {reject} "and" -> Words {reject} "arch" -> Words {reject} "as" -> Words {reject} "axiom" -> Words {reject} "axioms" -> Words {reject} "closed" -> Words {reject} "def" -> Words {reject} "else" -> Words {reject} "end" -> Words {reject} "exists" -> Words {reject} "false" -> Words {reject} "fit" -> Words {reject} "forall" -> Words {reject} "free" -> Words {reject} "from" -> Words {reject} "generated" -> Words {reject} "get" -> Words {reject} "given" -> Words {reject} "hide" -> Words {reject} "if" -> Words {reject} "in" -> Words {reject} "lambda" -> Words {reject} "library" -> Words {reject} "local" -> Words {reject} "not" -> Words {reject} "op" -> Words {reject} "ops" -> Words {reject} "pred" -> Words {reject} "preds" -> Words {reject} "result" -> Words {reject} "reveal" -> Words {reject} "sort" -> Words {reject} "sorts" -> Words {reject} "spec" -> Words {reject} "then" -> Words {reject} "to" -> Words {reject} "true" -> Words {reject} "type" -> Words {reject} "types" -> Words {reject} "unit" -> Words {reject} "units" -> Words {reject} "var" -> Words {reject} "vars" -> Words {reject} "version" -> Words {reject} "view" -> Words {reject} "when" -> Words {reject} "with" -> Words {reject} "within" -> Words {reject} %% Literal String -> Literal Digits -> Literal Fraction -> Literal Floating -> Literal %% Simple-Id Words -> Simple-Id %% Sort-Id Words -> Sort-Id Words "[" {Id ","}+ "]" -> Sort-Id %% Id Mix-Token+ -> Id %% Mix-Token Token -> Mix-Token Place -> Mix-Token "[" {Id ","}+ "]" -> Mix-Token "[" "]" -> Mix-Token "{" "}" -> Mix-Token "{" Id "}" -> Mix-Token %% Place "__" -> Place %% Token Words -> Token Signs -> Token Digit -> Token Quoted-Char -> Token Dot-Words -> Token %% Annotation and Comment (Annote-Line|Annote-Group|Label|Comment-Group|Comment-Line)* -> Ann context-free restrictions LAYOUT? -/- [\ \n\t\13]