diff options
| author | Scott Lawrence <scott+git@ineffectivetheory.com> | 2024-06-26 21:16:21 -0700 |
|---|---|---|
| committer | Scott Lawrence <scott+git@ineffectivetheory.com> | 2024-06-26 21:16:21 -0700 |
| commit | a4c197dea1a0192b93e205daf8738f99a4f039b2 (patch) | |
| tree | 0d6ff8063a1c0df0174524b1ea239b36821912a6 /agate.ml | |
| parent | 490ab998999e033e91929f63d2deae4900c90375 (diff) | |
| download | agate-a4c197dea1a0192b93e205daf8738f99a4f039b2.tar.gz agate-a4c197dea1a0192b93e205daf8738f99a4f039b2.tar.bz2 agate-a4c197dea1a0192b93e205daf8738f99a4f039b2.zip | |
Possibly shifting to a single script
Diffstat (limited to 'agate.ml')
| -rwxr-xr-x | agate.ml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/agate.ml b/agate.ml new file mode 100755 index 0000000..0e44939 --- /dev/null +++ b/agate.ml @@ -0,0 +1,19 @@ +#!/usr/bin/env ocaml + +type interpreter = { + mutable stack : int list +} + +type token = Word of string + +let tokenize line : token list = + String.split_on_char ' ' line |> List.map (fun s -> Word s) + +let parse line = + let _tokens = tokenize line in + () + +let () = + let line = input_line stdin |> parse in + print_string "HI" |> print_newline + |
