I'm not sure exactly what you want, but:

function parse_file(filename)
    str = readstring(filename)
    exprs = Any[]
    pos = 1
    while pos <= endof(str)
        ex, pos = parse(str, pos)
        push!(exprs, ex)
    end
    return exprs
end


will return an array of the parsed expressions in the file, or throw an 
error if parsing failed.

Reply via email to