File: README

package info (click to toggle)
mlton 20061107-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,828 kB
  • ctags: 61,118
  • sloc: ansic: 11,446; makefile: 1,339; sh: 1,160; lisp: 900; pascal: 256; asm: 97
file content (32 lines) | stat: -rw-r--r-- 997 bytes parent folder | download | duplicates (11)
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
32
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.