open CS334 (** * This program takes the first input given to `dotnet run` * and attempts to parse and evaluate the expression. * This program should probably do a bit more input validation * and also provide a usage() message when things go wrong, * but it is intentionally minimal so that you can focus your * attention on the new ideas. * * Note that the course packet chapter on Evaluation also * discusses a version of pluslang with a slightly different syntax * than the one here, however, the two languages are still * very similar. *) [] let main args = let input = args[0] let ast_maybe = parse input match ast_maybe with | Some ast -> printfn "%A" ast let res = eval ast printfn "result: %d" res | None -> printfn "Invalid program." 0