Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/ml-yacc/src/parse.sml
ViewVC logotype

Annotation of /sml/trunk/src/ml-yacc/src/parse.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 249 - (view) (download)
Original Path: sml/branches/SMLNJ/src/ml-yacc/src/parse.sml

1 : monnier 249 (* ML-Yacc Parser Generator (c) 1989 Andrew W. Appel, David R. Tarditi
2 :     *
3 :     * $Log$
4 :     * Revision 1.1.1.10 1999/04/17 18:56:12 monnier
5 :     * version 110.16
6 :     *
7 :     * Revision 1.2 1997/05/23 16:21:10 dbm
8 :     * SML '97 sharing, where clauses.
9 :     *
10 :     # Revision 1.1.1.1 1997/01/14 01:38:06 george
11 :     # Version 109.24
12 :     #
13 :     * Revision 1.2 1996/02/26 15:02:38 george
14 :     * print no longer overloaded.
15 :     * use of makestring has been removed and replaced with Int.toString ..
16 :     * use of IO replaced with TextIO
17 :     *
18 :     * Revision 1.1.1.1 1996/01/31 16:01:46 george
19 :     * Version 109
20 :     *
21 :     *)
22 :    
23 :     functor ParseGenParserFun(structure Header : HEADER
24 :     structure Parser : ARG_PARSER
25 :     where type pos = Header.pos
26 :     sharing type Parser.result = Header.parseResult
27 :     sharing type Parser.arg = Header.inputSource =
28 :     Parser.lexarg
29 :     ) : PARSE_GEN_PARSER =
30 :    
31 :     struct
32 :     structure Header = Header
33 :     val parse = fn file =>
34 :     let
35 :     val in_str = TextIO.openIn file
36 :     val source = Header.newSource(file,in_str,TextIO.stdOut)
37 :     val error = fn (s : string,i:int,_) =>
38 :     Header.error source i s
39 :     val stream = Parser.makeLexer (fn i => (TextIO.inputN(in_str,i)))
40 :     source
41 :     val (result,_) = (Header.lineno := 1;
42 :     Header.text := nil;
43 :     Parser.parse(15,stream,error,source))
44 :     in (TextIO.closeIn in_str; (result,source))
45 :     end
46 :     end;

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0