Warning, /education/kalzium/src/solver/lexer.mll is written in an unsupported language. File is not indexed.
0001 (* 0002 SPDX-FileCopyrightText: 2004 Thomas Nagy <tnagy2^8@yahoo.fr> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 *) 0006 0007 (* File lexer.mll*) 0008 { 0009 open Parser;; 0010 exception IllegalChar 0011 } 0012 0013 rule token = parse 0014 [' ' '\t' '\n'] {token lexbuf} (* ignore whitespaces *) 0015 | ['0'-'9']+ { INT(int_of_string(Lexing.lexeme lexbuf)) } 0016 | ['A'-'Z'] { CAPITAL(Lexing.lexeme lexbuf) } 0017 | ['a'-'z']+ { MINOR(Lexing.lexeme lexbuf) } 0018 | '+' { PLUS } 0019 | '-' { MINUS } 0020 | '(' { LPAREN } 0021 | ')' { RPAREN } 0022 | '[' { LBRACKET } 0023 | ']' { RBRACKET } 0024 | "->" { ARROW } 0025 | _ { raise IllegalChar; } 0026 | eof { EOF }