Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 61 lines (48 sloc) 1.805 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 parser
21 (implemented by roughly following the ecmascript specification
22 http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf)
23 *)
24
25 (**
26 Low level parsing functions, taking streams as input
27 *)
28
fccc685 Initial open-source release
MLstate authored
29 val code : JsLex.token Stream.t -> JsAst.code
30 val expr : JsLex.token Stream.t -> JsAst.expr
31 val stm : JsLex.token Stream.t -> JsAst.statement
32
5496ee5 [doc] jslang: adding some comments in the js lexer/parser
Valentin Gatien-Baron authored
33 (**
34 The exception that is thrown when the corresponding argument
35 is given to the functions below and a syntax error occurs
36 *)
37
fccc685 Initial open-source release
MLstate authored
38 type error
39 exception Exception of error
40 val pp : Format.formatter -> error -> unit
41
5496ee5 [doc] jslang: adding some comments in the js lexer/parser
Valentin Gatien-Baron authored
42 (**
43 The high level parsing functions interface
44 By default [throw_exn] is false, and the parser exits when faced
45 with a parse error
46 *)
47
fccc685 Initial open-source release
MLstate authored
48 module String :
49 sig
50 val code : ?throw_exn:bool -> string -> JsAst.code
51 val expr : ?throw_exn:bool -> ?globalize:bool -> string -> JsAst.expr
52 val stm : ?throw_exn:bool -> string -> JsAst.statement
53 end
5496ee5 [doc] jslang: adding some comments in the js lexer/parser
Valentin Gatien-Baron authored
54
fccc685 Initial open-source release
MLstate authored
55 module File :
56 sig
57 val code : ?throw_exn:bool -> string -> JsAst.code
58 val expr : ?throw_exn:bool -> ?globalize:bool -> string -> JsAst.expr
59 val stm : ?throw_exn:bool -> string -> JsAst.statement
60 end
Something went wrong with that request. Please try again.