summaryrefslogtreecommitdiff
path: root/backend/CMlexer.mll
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-12-29 16:55:38 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-12-29 16:55:38 +0000
commit8539759095f95f2fbb680efc7633d868099114c8 (patch)
tree3401d7cd91686026090a21f600cf70ea4372ebf3 /backend/CMlexer.mll
parent7e9c6fc9a51adc5e488c590d83c1e8ef5a256c9f (diff)
Merge of the clightgen branch:
- Alternate semantics for Clight where function parameters are temporaries, not variables - New pass SimplLocals that turns non-addressed local variables into temporaries - Simplified Csharpminor, Cshmgen and Cminorgen accordingly - SimplExpr starts its temporaries above variable names, therefoe Cminorgen no longer needs to encode variable names and temps names. - Simplified Cminor parser & printer, as well as Errors, accordingly. - New tool clightgen to produce Clight AST in Coq-parsable .v files. - Removed side condition "return type is void" on rules skip_seq in the semantics of CompCert C, Clight, C#minor, Cminor. - Adapted RTLgenproof accordingly (now uses a memory extension). git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2083 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend/CMlexer.mll')
-rw-r--r--backend/CMlexer.mll7
1 files changed, 2 insertions, 5 deletions
diff --git a/backend/CMlexer.mll b/backend/CMlexer.mll
index fba85ff..2eaa488 100644
--- a/backend/CMlexer.mll
+++ b/backend/CMlexer.mll
@@ -25,7 +25,7 @@ let floatlit =
('.' ['0'-'9' '_']* )?
(['e' 'E'] ['+' '-']? ['0'-'9'] ['0'-'9' '_']*)?
let ident = ['A'-'Z' 'a'-'z' '_'] ['A'-'Z' 'a'-'z' '_' '$' '0'-'9']*
-let temp = "$" ['0'-'9'] ['0'-'9']*
+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 = "\"" [ ^ '"' ] * '"'
@@ -125,10 +125,7 @@ rule token = parse
| floatlit { FLOATLIT(float_of_string(Lexing.lexeme lexbuf)) }
| stringlit { let s = Lexing.lexeme lexbuf in
STRINGLIT(intern_string(String.sub s 1 (String.length s - 2))) }
- | ident { IDENT(BinPos.Coq_xO (intern_string(Lexing.lexeme lexbuf))) }
- | temp { let s = Lexing.lexeme lexbuf in
- let n = Int32.of_string(String.sub s 1 (String.length s -1)) in
- IDENT(if n = 0l then BinPos.Coq_xH else BinPos.Coq_xI (positive_of_camlint n)) }
+ | ident | temp { IDENT(intern_string(Lexing.lexeme lexbuf)) }
| eof { EOF }
| _ { raise(Error("illegal character `" ^ Char.escaped (Lexing.lexeme_char lexbuf 0) ^ "'")) }