[Grace-core] Proposed Input spec

Andrew P. Black black at cs.pdx.edu
Wed Jul 2 21:37:43 PDT 2014


These look like methods on string streams — iterators over strings.    I agree that we need such a module.   These methods don’t seem to have anything to do with input or output.  An I missing something?

	Andrew


On 18 Jun 2014, at 11:27, Kim Bruce <kim at cs.pomona.edu> wrote:

> Here is the spec that Femi is planning on implementing as a way of handling input.  There would be a class taking a filepath as a parameter that would construct objects of this type.  It is based on a simplified version of the Scanner class of Java and is intended to be very easy to use.
> 
> // Handles all types of file input and parsing
> type graceInput = {
> 
>    // Moves to the indicated position in the file
>    goToPosition(pos:Number)->Done
> 
>    // Returns true if the current position is at the end of the file
>    endOfFile->Boolean
> 
>    //Determines if the next token is of the indicated type
>    hasNextWord->Boolean
>    hasNextNumber->Boolean
>    hasNextBoolean->Boolean
> 
>    // Returns the next token if it is of the correct type
>    // Raises an IOException if the token is of the wrong type
> 
>    // Returns the next number in the file as a number 
>    nextNum(s:String)->Number
> 
>    // Returns the next line of text excluding the "\n" character
>    nextLine(s:String)->String
> 
>    // Returns the next word in the file excluding white spaces
>    nextWord(s:String)->String
> 
>    // Returns the next Boolean that is found in the file
>    nextBoolean(s:String)->Boolean
> 
> }
> 
> Comments/Questions/Suggestions?
> Kim
> 
> 
> 
> 
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core




More information about the Grace-core mailing list