Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 141 lines (130 sloc) 2.484 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
5496ee5 [doc] jslang: adding some comments in the js lexer/parser
Valentin Gatien-Baron authored
18
19 (**
20 The javascript lexer
21
22 Beware that the lexer is stateful, so it should not be used
23 by several threads simultaneously, nor should you try to intersperse
24 the lexing of several inputs
25
26 This module is not meant to be called directly, use instead the high level
27 functions provided in jsParse if you want to parse some javascript.
28 *)
29
fccc685 Initial open-source release
MLstate authored
30 type token =
31 | Yield
32 | With
33 | While
34 | Void
35 | Var
36 | Typeof
37 | Try
38 | True
39 | TimesEqual
40 | Times
41 | Tilda
42 | Throw
43 | This
44 | Switch
45 | Super
46 | String of (string)
47 | Static
48 | Semic
49 | Rparen
50 | Return
51 | Regexp of (string * string)
52 | Rcurly
53 | Rbracket
54 | Question
55 | Public
56 | Protected
57 | Private
58 | PlusPlus
59 | PlusEqual
60 | Plus
61 | PercentEqual
62 | Percent
63 | Package
64 | Null
65 | New
66 | MinusMinus
67 | MinusEqual
68 | Minus
69 | LtLtEqual
70 | LtLt
71 | Lt
72 | Lparen
73 | Let
74 | Le
75 | Lcurly
76 | Lbracket
77 | LT
78 | Interface
79 | Integer of (string)
80 | Instanceof
81 | In
82 | Import
83 | Implements
84 | If
85 | Ident of (string)
86 | GtGtGtEqual
87 | GtGtGt
88 | GtGtEqual
89 | GtGt
90 | Gt
91 | Ge
92 | Function
93 | For
94 | Finally
95 | False
96 | Extends
97 | Export
98 | EqualEqualEqual
99 | EqualEqual
100 | Equal
101 | Enum
102 | Else
103 | EOF
104 | Dot
105 | Do
106 | DivEqual
107 | Div
108 | Delete
109 | Default
110 | Debugger
111 | Continue
112 | Const
113 | Comma
114 | Colon
115 | Class
116 | ChapeauEqual
117 | Chapeau
118 | Catch
119 | Case
120 | Break
121 | BarEqual
122 | BarBar
123 | Bar
124 | BangEqualEqual
125 | BangEqual
126 | Bang
127 | AmperEqual
128 | AmperAmper
129 | Amper
130
131 val init_lexer : unit -> unit
132 val lex : Lexing.lexbuf -> token
133 val stream : Lexing.lexbuf -> token Stream.t
134
135 (**
136 These high levels function automatically init the lexer
137 when called
138 *)
139 val stream_of_file : string -> token Stream.t * Lexing.lexbuf
140 val stream_of_string : string -> token Stream.t * Lexing.lexbuf
Something went wrong with that request. Please try again.