[Grace-core] Proposed Input spec

Kim Bruce kim at cs.pomona.edu
Wed Jun 18 13:54:57 PDT 2014


On Jun 18, 2014, at 12:15 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:

>> 
> 
>> 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"?

Probably a string or URL providing access to the file
> 
>> 
>> // 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?)

Good question, but I didn't see anything about streams in Andrews collections.grace in gUnit.  Is it somewhere else?

Should be capitalized.
> 
>>   // 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?

Clearly a mistake and should be removed.  Sorry!
> 
>>   // 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