File: README

package info (click to toggle)
mlton 20100608-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 34,980 kB
  • ctags: 69,089
  • sloc: ansic: 18,421; lisp: 2,879; makefile: 1,570; sh: 1,325; pascal: 256; asm: 97
file content (31 lines) | stat: -rw-r--r-- 991 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
This is a grammar for Berkeley Pascal, hacked to be SLR, though that is
not necessary because ML-Yacc supports LALR(1).

To construct the parser, make this your current directory and run

  CM.make "sources.cm";

This will apply ML-Yacc to the file "pascal.grm" to create
the files "pascal.grm.sig" and "pascal.grm.sml", then
ML_Lex will be applied to pascal.lex to produce pascal.lex.sml.

Then these generated files will be compiled together with necessary
components from the ML-Yacc library supplied by the ml-yacc-lib.cm
file.

The end result is a structure Parser with two functions.  The
function

  parse: string ->
         PascalParser.result *
         (Parser.PascalParser.svalue,PascalParser.pos) LrParser.Token.token
            LrParser.stream

parses input from a file, while

  keybd: unit ->
         Parser.PascalParser.result *
         (Parser.PascalParser.svalue,Parser.PascalParser.pos)
           LrParser.Token.token LrParser.stream

parses from the standard input.