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

SCM Repository

[smlnj] View of /sml/trunk/src/ml-flex/src/FrontEnds/ml-lex/ml-lex-input.sml
ViewVC logotype

View of /sml/trunk/src/ml-flex/src/FrontEnds/ml-lex/ml-lex-input.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1895 - (download) (annotate)
Fri Feb 24 22:23:53 2006 UTC (13 years, 5 months ago) by mblume
File size: 923 byte(s)
sources for ml-flex added; integration partially done
(* ml-lex-input.sml
 *
 * COPYRIGHT (c) 2005 
 * John Reppy (http://www.cs.uchicago.edu/~jhr)
 * Aaron Turon (adrassi@gmail.com)
 * All rights reserved.
 *
 * Driver for ml-lex input format.
 *)

structure MLLexInput =
  struct

    structure MLLexLrVals =
      MLLexLrValsFun(structure Token = LrParser.Token)
    structure MLLexLex = 
      MLLexLexFun(structure Tok = MLLexLrVals.Tokens)
    structure MLLexParser =
      Join(structure ParserData = MLLexLrVals.ParserData
           structure Lex = MLLexLex
           structure LrParser = LrParser)    

    fun parseFile fname = let
          fun parseErr (msg, line, _) = 
	        (print (Int.toString line);
		 print ": ";
		 print msg;
		 print "\n")
	  val strm = TextIO.openIn fname
	  val lexer =
		MLLexParser.makeLexer (fn n => TextIO.inputN (strm, n))
	  in
	    #1(MLLexParser.parse(15, lexer, parseErr, ()))
	    before TextIO.closeIn strm
	  end

  end

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