comparison src/urweb.lex @ 2226:e10881cd92da

Merge.
author Ziv Scully <ziv@mit.edu>
date Fri, 27 Mar 2015 11:26:06 -0400
parents 4d967a4ddb82 f3c24e6790ba
children 2b1af5dc6dee
comparison
equal deleted inserted replaced
2225:6262dabc08d6 2226:e10881cd92da
180 xmlid = [A-Za-z][A-Za-z0-9_-]*; 180 xmlid = [A-Za-z][A-Za-z0-9_-]*;
181 cid = [A-Z][A-Za-z0-9_]*; 181 cid = [A-Z][A-Za-z0-9_]*;
182 ws = [\ \t\012\r]; 182 ws = [\ \t\012\r];
183 intconst = [0-9]+; 183 intconst = [0-9]+;
184 realconst = [0-9]+\.[0-9]*; 184 realconst = [0-9]+\.[0-9]*;
185 hexconst = 0x[0-9A-F]{1,8};
185 notags = ([^<{\n(]|(\([^\*<{\n]))+; 186 notags = ([^<{\n(]|(\([^\*<{\n]))+;
186 xcom = ([^\-]|(-[^\-]))+; 187 xcom = ([^\-]|(-[^\-]))+;
187 oint = [0-9][0-9][0-9]; 188 oint = [0-9][0-9][0-9];
188 xint = x[0-9a-fA-F][0-9a-fA-F]; 189 xint = x[0-9a-fA-F][0-9a-fA-F];
189 190
374 <INITIAL> "^" => (Tokens.CARET (pos yypos, pos yypos + size yytext)); 375 <INITIAL> "^" => (Tokens.CARET (pos yypos, pos yypos + size yytext));
375 376
376 <INITIAL> "&&" => (Tokens.ANDALSO (pos yypos, pos yypos + size yytext)); 377 <INITIAL> "&&" => (Tokens.ANDALSO (pos yypos, pos yypos + size yytext));
377 <INITIAL> "||" => (Tokens.ORELSE (pos yypos, pos yypos + size yytext)); 378 <INITIAL> "||" => (Tokens.ORELSE (pos yypos, pos yypos + size yytext));
378 379
380 <INITIAL> "<<<" => (Tokens.COMPOSE (pos yypos, pos yypos + size yytext));
381 <INITIAL> ">>>" => (Tokens.ANDTHEN (pos yypos, pos yypos + size yytext));
382 <INITIAL> "<|" => (Tokens.FWDAPP (pos yypos, pos yypos + size yytext));
383 <INITIAL> "|>" => (Tokens.REVAPP (pos yypos, pos yypos + size yytext));
384
385 <INITIAL> "`" ({cid} ".")* {id} "`" => (Tokens.BACKTICK_PATH ( (* strip backticks *)
386 substring (yytext,1,size yytext -2),
387 pos yypos, pos yypos + size yytext));
388
379 <INITIAL> "=" => (Tokens.EQ (pos yypos, pos yypos + size yytext)); 389 <INITIAL> "=" => (Tokens.EQ (pos yypos, pos yypos + size yytext));
380 <INITIAL> "<>" => (Tokens.NE (pos yypos, pos yypos + size yytext)); 390 <INITIAL> "<>" => (Tokens.NE (pos yypos, pos yypos + size yytext));
381 <INITIAL> "<" => (Tokens.LT (pos yypos, pos yypos + size yytext)); 391 <INITIAL> "<" => (Tokens.LT (pos yypos, pos yypos + size yytext));
382 <INITIAL> ">" => (Tokens.GT (pos yypos, pos yypos + size yytext)); 392 <INITIAL> ">" => (Tokens.GT (pos yypos, pos yypos + size yytext));
383 <INITIAL> "<=" => (Tokens.LE (pos yypos, pos yypos + size yytext)); 393 <INITIAL> "<=" => (Tokens.LE (pos yypos, pos yypos + size yytext));
530 <INITIAL> "CURRENT_TIMESTAMP" => (Tokens.CURRENT_TIMESTAMP (pos yypos, pos yypos + size yytext)); 540 <INITIAL> "CURRENT_TIMESTAMP" => (Tokens.CURRENT_TIMESTAMP (pos yypos, pos yypos + size yytext));
531 541
532 <INITIAL> {id} => (Tokens.SYMBOL (yytext, pos yypos, pos yypos + size yytext)); 542 <INITIAL> {id} => (Tokens.SYMBOL (yytext, pos yypos, pos yypos + size yytext));
533 <INITIAL> {cid} => (Tokens.CSYMBOL (yytext, pos yypos, pos yypos + size yytext)); 543 <INITIAL> {cid} => (Tokens.CSYMBOL (yytext, pos yypos, pos yypos + size yytext));
534 544
545 <INITIAL> {hexconst} => (case StringCvt.scanString (Int64.scan StringCvt.HEX) (String.extract (yytext, 2, NONE)) of
546 SOME x => Tokens.INT (x, pos yypos, pos yypos + size yytext)
547 | NONE => (ErrorMsg.errorAt' (pos yypos, pos yypos)
548 ("Expected hexInt, received: " ^ yytext);
549 continue ()));
550
535 <INITIAL> {intconst} => (case Int64.fromString yytext of 551 <INITIAL> {intconst} => (case Int64.fromString yytext of
536 SOME x => Tokens.INT (x, pos yypos, pos yypos + size yytext) 552 SOME x => Tokens.INT (x, pos yypos, pos yypos + size yytext)
537 | NONE => (ErrorMsg.errorAt' (pos yypos, pos yypos) 553 | NONE => (ErrorMsg.errorAt' (pos yypos, pos yypos)
538 ("Expected int, received: " ^ yytext); 554 ("Expected int, received: " ^ yytext);
539 continue ())); 555 continue ()));