[Grace-core] Proposed Input spec

James Noble kjx at ecs.vuw.ac.nz
Wed Jun 18 12:15:46 PDT 2014


> Here is the spec that Femi is planning on implementing as a way of handling input.  

OK right - 

> 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.

what's a "filepath"?

> 
> // Handles all types of file input and parsing
> type graceInput = {

GraceInput?  
Input?
InputStream?

(the last raises another question - how does this relate to Andrew's collection/stream library? Should it?)

>    // 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

what's the "s:String" argument do on this and the next four methods?

>    // 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