diff options
author | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2017-02-15 09:55:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-15 09:55:01 +0100 |
commit | 29653baeb2c7fa6bfe5da031622d8fb8ac1e50c3 (patch) | |
tree | 0c6bd91373882c97ddd80f72f53bf8406459d999 /backend/CMlexer.mll | |
parent | d28d699bc848795ff9801faef621ac209e992fa0 (diff) | |
parent | d000fe3f6df676596b5371f9760cdf0b2922ea11 (diff) | |
download | compcert-29653baeb2c7fa6bfe5da031622d8fb8ac1e50c3.tar.gz compcert-29653baeb2c7fa6bfe5da031622d8fb8ac1e50c3.zip |
Merge pull request #170 from AbsInt/remove_cminor
Remove CompCert's ability to parse and compile source files written in Cminor
This facility is no longer used (as far as we know) and is painful to maintain.
Diffstat (limited to 'backend/CMlexer.mll')
-rw-r--r-- | backend/CMlexer.mll | 180 |
1 files changed, 0 insertions, 180 deletions
diff --git a/backend/CMlexer.mll b/backend/CMlexer.mll deleted file mode 100644 index 65f244b5..00000000 --- a/backend/CMlexer.mll +++ /dev/null @@ -1,180 +0,0 @@ -(* *********************************************************************) -(* *) -(* The Compcert verified compiler *) -(* *) -(* Xavier Leroy, INRIA Paris-Rocquencourt *) -(* *) -(* Copyright Institut National de Recherche en Informatique et en *) -(* Automatique. All rights reserved. This file is distributed *) -(* under the terms of the GNU General Public License as published by *) -(* the Free Software Foundation, either version 2 of the License, or *) -(* (at your option) any later version. This file is also distributed *) -(* under the terms of the INRIA Non-Commercial License Agreement. *) -(* *) -(* *********************************************************************) - -{ -open CMparser -exception Error of string -} - -let blank = [' ' '\009' '\012' '\010' '\013'] -let floatlit = - ("-"? (['0'-'9'] ['0'-'9' '_']* - ('.' ['0'-'9' '_']* )? - (['e' 'E'] ['+' '-']? ['0'-'9'] ['0'-'9' '_']*)? )) | "inf" | "nan" -let ident = ['A'-'Z' 'a'-'z' '_'] ['A'-'Z' 'a'-'z' '_' '$' '0'-'9']* -let qident = '\'' [ ^ '\'' ]+ '\'' -let temp = "$" ['1'-'9'] ['0'-'9']* -let intlit = "-"? ( ['0'-'9']+ | "0x" ['0'-'9' 'a'-'f' 'A'-'F']+ - | "0o" ['0'-'7']+ | "0b" ['0'-'1']+ ) -let stringlit = "\"" [ ^ '"' ] * '"' - -rule token = parse - | blank + { token lexbuf } - | "/*" { comment lexbuf; token lexbuf } - | "absf" { ABSF } - | "&" { AMPERSAND } - | "&l" { AMPERSANDL } - | "!" { BANG } - | "!=" { BANGEQUAL } - | "!=f" { BANGEQUALF } - | "!=l" { BANGEQUALL } - | "!=lu" { BANGEQUALLU } - | "!=u" { BANGEQUALU } - | "|" { BAR } - | "|l" { BARL } - | "builtin" { BUILTIN } - | "^" { CARET } - | "^l" { CARETL } - | "case" { CASE } - | ":" { COLON } - | "," { COMMA } - | "default" { DEFAULT } - | "else" { ELSE } - | "=" { EQUAL } - | "==" { EQUALEQUAL } - | "==f" { EQUALEQUALF } - | "==l" { EQUALEQUALL } - | "==lu" { EQUALEQUALLU } - | "==u" { EQUALEQUALU } - | "exit" { EXIT } - | "extern" { EXTERN } - | "float" { FLOAT } - | "float32" { FLOAT32 } - | "float64" { FLOAT64 } - | "floatofint" { FLOATOFINT } - | "floatofintu" { FLOATOFINTU } - | "floatoflong" { FLOATOFLONG } - | "floatoflongu" { FLOATOFLONGU } - | "goto" { GOTO } - | ">" { GREATER } - | ">f" { GREATERF } - | ">l" { GREATERL } - | ">lu" { GREATERLU } - | ">u" { GREATERU } - | ">=" { GREATEREQUAL } - | ">=f" { GREATEREQUALF } - | ">=l" { GREATEREQUALL } - | ">=lu" { GREATEREQUALLU } - | ">=u" { GREATEREQUALU } - | ">>" { GREATERGREATER } - | ">>u" { GREATERGREATERU } - | ">>l" { GREATERGREATERL } - | ">>lu" { GREATERGREATERLU } - | "if" { IF } - | "int" { INT } - | "int16" { INT16 } - | "int16s" { INT16S } - | "int16u" { INT16U } - | "int32" { INT32 } - | "int64" { INT64 } - | "int8" { INT8 } - | "int8s" { INT8S } - | "int8u" { INT8U } - | "intoffloat" { INTOFFLOAT } - | "intuoffloat" { INTUOFFLOAT } - | "intoflong" { INTOFLONG } - | "{" { LBRACE } - | "{{" { LBRACELBRACE } - | "[" { LBRACKET } - | "<" { LESS } - | "<u" { LESSU } - | "<l" { LESSL } - | "<lu" { LESSLU } - | "<f" { LESSF } - | "<=" { LESSEQUAL } - | "<=u" { LESSEQUALU } - | "<=f" { LESSEQUALF } - | "<=l" { LESSEQUALL } - | "<=lu" { LESSEQUALLU } - | "<<" { LESSLESS } - | "<<l" { LESSLESSL } - | "long" { LONG } - | "longofint" { LONGOFINT } - | "longofintu" { LONGOFINTU } - | "longoffloat" { LONGOFFLOAT } - | "longuoffloat" { LONGUOFFLOAT } - | "loop" { LOOP } - | "(" { LPAREN } - | "match" { MATCH } - | "-" { MINUS } - | "->" { MINUSGREATER } - | "-f" { MINUSF } - | "-s" { MINUSS } - | "-l" { MINUSL } - | "%" { PERCENT } - | "%l" { PERCENTL } - | "%lu" { PERCENTLU } - | "%u" { PERCENTU } - | "+" { PLUS } - | "+f" { PLUSF } - | "+s" { PLUSS } - | "+l" { PLUSL } - | "}" { RBRACE } - | "}}" { RBRACERBRACE } - | "]" { RBRACKET } - | "readonly" { READONLY } - | "return" { RETURN } - | "runtime" { RUNTIME } - | ")" { RPAREN } - | ";" { SEMICOLON } - | "/" { SLASH } - | "/f" { SLASHF } - | "/s" { SLASHS } - | "/l" { SLASHL } - | "/lu" { SLASHLU } - | "/u" { SLASHU } - | "single" { SINGLE } - | "singleofint" { SINGLEOFINT } - | "stack" { STACK } - | "*" { STAR } - | "*f" { STARF } - | "*s" { STARS } - | "*l" { STARL } - | "switch" { SWITCH } - | "switchl" { SWITCHL } - | "tailcall" { TAILCALL } - | "~" { TILDE } - | "~l" { TILDEL } - | "var" { VAR } - | "void" { VOID } - | "volatile" { VOLATILE } - | "while" { WHILE } - - | intlit"LL" { let s = Lexing.lexeme lexbuf in - LONGLIT(Int64.of_string(String.sub s 0 (String.length s - 2))) } - | intlit { INTLIT(Int32.of_string(Lexing.lexeme lexbuf)) } - | floatlit { FLOATLIT(float_of_string(Lexing.lexeme lexbuf)) } - | stringlit { let s = Lexing.lexeme lexbuf in - STRINGLIT(String.sub s 1 (String.length s - 2)) } - | ident | temp { IDENT(Lexing.lexeme lexbuf) } - | qident { let s = Lexing.lexeme lexbuf in - IDENT(String.sub s 1 (String.length s - 2)) } - | eof { EOF } - | _ { raise(Error("illegal character `" ^ Char.escaped (Lexing.lexeme_char lexbuf 0) ^ "'")) } - -and comment = parse - "*/" { () } - | eof { raise(Error "unterminated comment") } - | _ { comment lexbuf } |