for the past few days i've been writing a text interface tokeniser|detokeniser for BASIC|Axe|Grammer|etc 8x programs because i wanted something that could easily be used in scripts, and have it to the point of being fairly functional:
at the moment, i'm trying to implement reading file input from stdin, but am not sure how to go about it. when reading from a flat file, i just malloced a flat buffer of the file's size and used that for my reading and processing of things. i tried mallocing a small chunk, scanning through stdin and copying over everything (reallocing to larger chunk size when necessary), and breaking the loop when either i reached an EOF or hit the max allowed size, but it doesn't appear to be working, and i wanted to get a second opinion before spending more time on this.
oh, and thanks to merthsoft and everyone else who helped in making TokenIDE's xmls. they've been a big help as a reference =)
EDIT: huh, i hadn't even noticed that elfprince was already working on something very similar. regardless, i think i'll go ahead and finish this for my own benefit (and for anyone who may want a standalone C executable using only standard libs)
at the moment, i'm trying to implement reading file input from stdin, but am not sure how to go about it. when reading from a flat file, i just malloced a flat buffer of the file's size and used that for my reading and processing of things. i tried mallocing a small chunk, scanning through stdin and copying over everything (reallocing to larger chunk size when necessary), and breaking the loop when either i reached an EOF or hit the max allowed size, but it doesn't appear to be working, and i wanted to get a second opinion before spending more time on this.
oh, and thanks to merthsoft and everyone else who helped in making TokenIDE's xmls. they've been a big help as a reference =)
EDIT: huh, i hadn't even noticed that elfprince was already working on something very similar. regardless, i think i'll go ahead and finish this for my own benefit (and for anyone who may want a standalone C executable using only standard libs)