Import Upstream version 20180207
[hcoop/debian/mlton.git] / mlyacc / examples / pascal / README
CommitLineData
7f918cf1
CE
1This is a grammar for Berkeley Pascal, hacked to be SLR, though that is
2not necessary because ML-Yacc supports LALR(1).
3
4To construct the parser, make this your current directory and run the
5following commands
6
7 mllex pascal.lex
8 mlyacc pascal.grm
9 mlton pascal.mlb
10
11They will apply ML-Yacc to the file "pascal.grm" to create
12the files "pascal.grm.sig" and "pascal.grm.sml", then
13ML_Lex will be applied to pascal.lex to produce pascal.lex.sml.
14
15Then these generated files will be compiled together with necessary
16components from the ML-Yacc library supplied by the ml-yacc-lib.cm
17file.
18
19The end result is a structure Parser with two functions. The
20function
21
22 parse: string ->
23 PascalParser.result *
24 (Parser.PascalParser.svalue,PascalParser.pos) LrParser.Token.token
25 LrParser.stream
26
27parses input from a file, while
28
29 keybd: unit ->
30 Parser.PascalParser.result *
31 (Parser.PascalParser.svalue,Parser.PascalParser.pos)
32 LrParser.Token.token LrParser.stream
33
34parses from the standard input.