From d652155ae013f36a1ee17653a8e458baad2d9c2c Mon Sep 17 00:00:00 2001 From: Checkmate50 Date: Mon, 6 Jun 2016 23:14:18 -0600 Subject: Merging complete. Everything looks good *crosses fingers* --- Source/Forro/Lexer.fsl | 120 ++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'Source/Forro/Lexer.fsl') diff --git a/Source/Forro/Lexer.fsl b/Source/Forro/Lexer.fsl index 4252af23..5f69df7c 100644 --- a/Source/Forro/Lexer.fsl +++ b/Source/Forro/Lexer.fsl @@ -1,60 +1,60 @@ -{ -module Lexer -open System -open Parser -open Microsoft.FSharp.Text.Lexing -} - -// These are some regular expression definitions -let digit = ['0'-'9'] -let nondigit = [ 'a'-'z' 'A'-'Z' '_' ] -let idchar = (nondigit | digit) -let whitespace = [' ' '\t' ] -let newline = ('\n' | '\r' '\n') - -rule tokenize = parse -| whitespace { tokenize lexbuf } -| newline { // lexbuf.EndPos <- lexbuf.EndPos.AsNewLinePos() ; - tokenize lexbuf } -// operators -| "==" { EQ } -| "!=" { NEQ } -| "+" { PLUS } -| "-" { MINUS } -| "*" { STAR } -| "<" { LESS } -| "<=" { ATMOST } -| "and" { AND } -| "or" { OR } -| "not" { NOT } -| "old" { OLD } -| "." { DOT } -// misc -| "(" { LPAREN } -| ")" { RPAREN } -| "{" { LCURLY } -| "}" { RCURLY } -| ";" { SEMI } -| "," { COMMA } -| ":=" { ASSIGN } -// keywords -| "procedure" { PROCEDURE } -| "requires" { REQUIRES } -| "ensures" { ENSURES } -| "do" { DO } -| "end" { END } -| "new" { NEW } -| "if" { IF } -| "then" { THEN } -| "else" { ELSE } -| "while" { WHILE } -| "invariant" { INVARIANT } -| "call" { CALL } -| "assert" { ASSERT } -// literals -| ['-']?digit+ { INT32 (Int32.Parse(LexBuffer.LexemeString lexbuf)) } -| "null" { NULL } -// identifiers -| idchar+ { ID (LexBuffer.LexemeString lexbuf) } -// EOF -| eof { EOF } +{ +module Lexer +open System +open Parser +open Microsoft.FSharp.Text.Lexing +} + +// These are some regular expression definitions +let digit = ['0'-'9'] +let nondigit = [ 'a'-'z' 'A'-'Z' '_' ] +let idchar = (nondigit | digit) +let whitespace = [' ' '\t' ] +let newline = ('\n' | '\r' '\n') + +rule tokenize = parse +| whitespace { tokenize lexbuf } +| newline { // lexbuf.EndPos <- lexbuf.EndPos.AsNewLinePos() ; + tokenize lexbuf } +// operators +| "==" { EQ } +| "!=" { NEQ } +| "+" { PLUS } +| "-" { MINUS } +| "*" { STAR } +| "<" { LESS } +| "<=" { ATMOST } +| "and" { AND } +| "or" { OR } +| "not" { NOT } +| "old" { OLD } +| "." { DOT } +// misc +| "(" { LPAREN } +| ")" { RPAREN } +| "{" { LCURLY } +| "}" { RCURLY } +| ";" { SEMI } +| "," { COMMA } +| ":=" { ASSIGN } +// keywords +| "procedure" { PROCEDURE } +| "requires" { REQUIRES } +| "ensures" { ENSURES } +| "do" { DO } +| "end" { END } +| "new" { NEW } +| "if" { IF } +| "then" { THEN } +| "else" { ELSE } +| "while" { WHILE } +| "invariant" { INVARIANT } +| "call" { CALL } +| "assert" { ASSERT } +// literals +| ['-']?digit+ { INT32 (Int32.Parse(LexBuffer.LexemeString lexbuf)) } +| "null" { NULL } +// identifiers +| idchar+ { ID (LexBuffer.LexemeString lexbuf) } +// EOF +| eof { EOF } -- cgit v1.2.3