Commit 415d1d69 authored by POGODALLA Sylvain's avatar POGODALLA Sylvain

'extend' and 'with' keywords commented

parent 9b572d88
......@@ -94,6 +94,16 @@ rule lexer =
Data_parser.NL_LEX_OPEN(loc lexbuf)
else
IDENT(id,loc lexbuf)}
(* | "extend" as id {
let () = check_brackets () in
if !ctx = NoContext then
else
IDENT(id,loc lexbuf)}
| "with" as id {
let () = check_brackets () in
if !ctx = NoContext then
else
IDENT(id,loc lexbuf)} *)
| ['='] {
let () = check_brackets () in
Data_parser.EQUAL(loc lexbuf)}
......@@ -122,6 +132,7 @@ rule lexer =
Data_parser.DOT(loc lexbuf)}
| "end" {
let () = check_brackets () in
let () = set NoContext in
Data_parser.END_OF_DEC(loc lexbuf)}
| '\\' keyword as id {
let () = check_brackets () in
......@@ -148,9 +159,7 @@ rule lexer =
Data_parser.ARROW(loc lexbuf)}
| ":=" {
Data_parser.COLON_EQUAL(loc lexbuf)}
| letter string {
let id = Lexing.lexeme lexbuf in
Data_parser.IDENT (id,loc lexbuf)}
| letter string as id { Data_parser.IDENT (id,loc lexbuf) }
| symbol {
Data_parser.SYMBOL (Lexing.lexeme lexbuf,loc lexbuf)}
| _ as input_char {let () = Printf.fprintf stderr "%c" input_char in raise (Error.Error (Error.Lexer_error (Error.Bad_token,loc lexbuf)))}
......
......@@ -9,119 +9,119 @@ let message =
| 0 ->
"A term is expected.\n"
| 27 | 25 ->
"A term or a colon \":\" are expected.\n"
"A term or a colon ':' are expected.\n"
| 1 ->
"A term is expected.\n"
| 32 | 37 | 17 | 18 | 21 | 22 ->
"A term or a right parenthesis \")\" are expected.\n"
"A term or a right parenthesis ')' are expected.\n"
| 3 ->
"An identifier (the name of a bound variable) or a dot \".\" are expected.\n"
"An identifier (the name of a bound variable) or a dot '.' are expected.\n"
| 5 | 2 ->
"An identifier (the name of a bound variable) is expected.\n"
| 40 | 7 | 19 | 38 ->
"A term or a colon \":\" are expected.\n"
"A term or a colon ':' are expected.\n"
| 4 ->
"A term is expected.\n"
| 60 ->
"An identifier (i.e., a type or a term) or a symbol are expected.\n"
| 72 ->
"A comma \",\" or an interpretation symbol \":=\" are expected.\n"
"A comma ',' or an interpretation symbol ':=' are expected.\n"
| 73 ->
"An identifier (i.e., a type or a term) or a symbol are expected.\n"
| 65 | 64 | 42 | 41 ->
"A term or a type are expected.\n"
| 56 ->
"An arrow (\"->\" or \"=>\"), a right parenthesis, a term, or a semi-colon are expected.\n"
"An arrow ('->' or '=>'), a right parenthesis, a term, or a semi-colon are expected.\n"
| 43 ->
"An arrow (\"->\" or \"=>\"), a right parenthesis, or a semi-colon are expected.\n"
"An arrow ('->' or '=>'), a right parenthesis, or a semi-colon are expected.\n"
| 45 ->
"An arrow (\"->\" or \"=>\"), or a semi-colon are expected.\n"
"An arrow ('->' or '=>'), or a semi-colon are expected.\n"
| 70 | 57 ->
"An end of input is expected (no more keyword or semi-colon or colon).\n"
| 68 ->
"An arrow (\"->\" or \"=>), a term, or a semi-colon are expected.\n"
"An arrow ('->' or '=>'), a term, or a semi-colon are expected.\n"
| 52 | 50 | 54 | 46 ->
"A type expression is expected.\n"
| 77 ->
"An equality symbol \"=\" is expected.\n"
"An equality symbol '=' is expected.\n"
| 124 | 78 ->
"A signature entry (type declaration, type definition, term declaration, or term definition) is expected.\n"
| 75 ->
"A declaration of a signature (keyword \"signature\") or of a lexicon (keyword \"lexicon\" or \"nl_lexicon\") is expected.\n"
"A declaration of a signature (keyword 'signature') or of a lexicon (keyword 'lexicon' or 'nl_lexicon') is expected.\n"
| 133 ->
"An identifier (the name of a new lexicon) is expected.\n"
| 134 ->
"A left parenthesis \"(\" is expected.\n"
"A left parenthesis '(' is expected.\n"
| 136 ->
"A right parenthesis \")\" is expected.\n"
"A right parenthesis ')' is expected.\n"
| 137 ->
"A colon \":\" is expected.\n"
"A colon ':' is expected.\n"
| 138 ->
"An identifier (the name of a signature) is expected.\n"
| 139 ->
"An equality symbol \"=\" is expected.\n"
"An equality symbol '=' is expected.\n"
| 141 ->
"A semi-colon \";\" or the \"end\" keyword are expected.\n"
"A semi-colon ';' or the 'end' keyword are expected.\n"
| 147 ->
"An identifier (the name of a new lexicon) is expected\n"
| 148 ->
"A left parenthesis \"(\" is expected.\n"
"A left parenthesis '(' is expected.\n"
| 149 ->
"An identifier (the name of a signature) is expected.\n"
| 150 ->
"A right parenthesis \")\" is expected.\n"
"A right parenthesis ')' is expected.\n"
| 151 ->
"A expression in the form of \": <identifier> =\" where the identifier is the name of a signature is expected.\n"
| 152 | 135 | 76 ->
"An identifier (the name of a signature) is expected.\n"
| 153 ->
"An equality symbold \"=\" is expected.\n"
"An equality symbold '=' is expected.\n"
| 154 | 142 | 140 ->
"A lexicon entry of the form \"<term> := <term>;\" or \"<type> := <type>\" is expected.\n"
| 157 | 156 ->
"An expression representing the composition of lexicons is expected.\n"
| 162 ->
"The composition operator \"<<\" or a right parenthesis \")\" is expected.\n"
"The composition operator '<<' or a right parenthesis ')' is expected.\n"
| 159 | 166 ->
"The composition operator \"<<\" is expected.\n"
"The composition operator '<<' is expected.\n"
| 160 ->
"An identifier (the name of a lexicon), or an expression representing the composition of lexicons is expected.\n"
| 172 ->
"An identifier or a keyword (\"infix\", \"prefix, or \"binder\") is expected.\n"
"An identifier or a keyword ('infix', 'prefix', or 'binder') is expected.\n"
| 87 | 79 ->
"A symbol is expected.\n"
| 88 | 80 ->
"A typing judgmenet in the form of \": <type>;\" or a defintion in the form of \"= <term>: <type>;\" is expected.\n"
| 89 | 81 ->
"A typing judgment in the form \"term : <type>;\" is expected.\n"
"A typing judgment in the form \"<term> : <type>;\" is expected.\n"
| 90 | 82 ->
"A typing judgment in the form \": <type>;\" is expected.\n"
| 93 | 91 | 85 | 83 ->
"A type is expected after the colon \":\".\n"
"A type is expected after the colon ':'.\n"
| 95 ->
"A comma \",\" or a colon \":\" are expected in a type or term declaration. An equality symbol \"=\" is expected in a type or term definition.\n"
"A comma ',' or a colon ':' are expected in a type or term declaration. An equality symbol '=' is expected in a type or term definition.\n"
| 96 ->
"A definition in the form of \"<term> : <type>;\" or a type definition of the form \"<type> : type;\" is expected after a term or a type defintion, resp.\n"
"A definition in the form of \"<term> : <type>;\" or a type definition of the form \"<type> : type;\" (with the keyword 'type') is expected after a term or a type defintion, resp.\n"
| 100 ->
"A typing judgement in the form of \": <type>\" is expected in a term definition.\n"
| 101 ->
"A type is expected in a term definition.\n"
| 103 ->
"A typing judgement in the form of \": <type>;\" or a type definition with a colon and the \"type\" keyword in the form of \": type;\" is expectedin a term or a type definition.\n"
"A typing judgement in the form of \": <type>;\" or a type definition with a colon ':' and the 'type' keyword in the form of \": type;\" is expected in a term or a type definition.\n"
| 116 ->
"The \"type\" keyword or a typing judgement in the form of \": <type>;\" is expected after the definition of a type or a term, resp.\n"
"The 'type' keyword or a typing judgement in the form of \": <type>;\" is expected after the definition of a type or a term, resp.\n"
| 97 ->
"In a type definition, a colon \":\" is expeced before the keyword \"type\".\n"
"In a type definition, a colon ':' is expeced before the keyword 'type'.\n"
| 98 ->
"In a type definition, the keyword \"type\" is expected after the colon \":\".\n"
"In a type definition, the keyword 'type' is expected after the colon ':'.\n"
| 106 | 105 ->
"After a term or type declaration of the form \"<ident1>, <ident2>\", a type declaration of the form \": type;\" (where type is a keyword) or a typing judgment of the form \": <type>;\" is expected.\n"
"After a term or type declaration of the form \"<ident1>, <ident2>\", a type declaration of the form \": type;\" (with the keyword 'type') or a typing judgment of the form \": <type>;\" is expected.\n"
| 126 ->
"After a term declaration of the form \"<term>: \", a type expression and a semicolon \"<type> ;\" are expected.\n"
| 174 ->
"After a term declaration of the form \"<term>: <type>\", a semicolon \";\" is expected.\n"
"After a term declaration of the form \"<term>: <type>\", a semicolon ';' is expected.\n"
| 108 ->
"An identidier (the name of the binder) is expected after the keyword \"binder\".\n"
"An identidier (the name of the binder) is expected after the keyword 'binder'.\n"
| 109 ->
"A typing judgement in the form of \": <type>\" or a definition in the form of \"= <term> : <type>\" is expected after the declaration of a binder.\n"
| 110 ->
......@@ -133,6 +133,6 @@ let message =
| 178 ->
"A typing judgement in the form of \": <type>\" is expected after a term.\n"
| 180 | 179 | 114 | 112 | 123 ->
"A type expression is expected after \":\".\n"
"A type expression is expected after ':'.\n"
| _ ->
raise Not_found
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment