File: exprlex.mll

package info (click to toggle)
pxp 1.2.9-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,844 kB
  • sloc: ml: 28,666; xml: 2,597; makefile: 822; sh: 691
file content (34 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(* $Id$
 * ----------------------------------------------------------------------
 *
 *)

{ open Expr }

rule scan_expr = parse
    [ ' ' '\t' ]+ 
      { Space }
  | '\013' '\010'
      { Newline }
  | '\013'
      { Newline }
  | '\010'
      { Newline }
  | [ '0'-'9' ]+
      { Number(int_of_string(Lexing.lexeme lexbuf)) }
  | '+'
      { Add }
  | '-'
      { Sub }
  | '*'
      { Mult }
  | '/'
      { Div }
  | '('
      { LParen }
  | ')'
      { RParen }
  | '}'
      { Stop }