~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to examples/OCaml-Kaleidoscope/Chapter7/token.ml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(*===----------------------------------------------------------------------===
 
2
 * Lexer Tokens
 
3
 *===----------------------------------------------------------------------===*)
 
4
 
 
5
(* The lexer returns these 'Kwd' if it is an unknown character, otherwise one of
 
6
 * these others for known things. *)
 
7
type token =
 
8
  (* commands *)
 
9
  | Def | Extern
 
10
 
 
11
  (* primary *)
 
12
  | Ident of string | Number of float
 
13
 
 
14
  (* unknown *)
 
15
  | Kwd of char
 
16
 
 
17
  (* control *)
 
18
  | If | Then | Else
 
19
  | For | In
 
20
 
 
21
  (* operators *)
 
22
  | Binary | Unary
 
23
 
 
24
  (* var definition *)
 
25
  | Var