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/branches/SMLNJ/src/ml-yacc/examples/pascal/README
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/ml-yacc/examples/pascal/README

Parent Directory Parent Directory | Revision Log Revision Log

Revision 3 - (view) (download)

1 : monnier 2 This is a grammar for Berkeley Pascal, hacked to be SLR, though that is
2 :     not necessary because ML-Yacc supports LALR(1).
3 :    
4 :     To construct the parser, first use ML-Yacc on the file "pascal.grm" to create
5 :     the files "pascal.grm.sig" and "pascal.grm.sml". This can be done by loading
6 :     ML-Yacc and typing ``ParseGen.parseGen "pascal.grm"''. Then construct the
7 :     lexer by using ML_Lex on the file pascal.lex (``LexGen.lexGen "pascal.lex"'').
8 :    
9 :     Finally, load the background file "base.sml". Then use "load.sml" to
10 :     load all the files. The end result is a structure Parser with four
11 :     functions. The function parse_prog will parse a program in a string.
12 :     Then function parse_query will parse a query in a string. The function
13 :     parse_file will parse a program in a file. The function top_parse will
14 :     parse a query from the standard input.
15 :    

ViewVC Help
Powered by ViewVC 1.0.0