Re: A question about parsing
- Posted by axtens_bruce in March
- 421 views
So I've noticed that Euphoria has tools for defining and detecting commandline configuration. I'm wondering if there's something similar for DSLs, similar say to, but not as powerful, as a PEG parser.
At the moment, I'm using tokenize_string and pulling out the parts, viz
if length(cl) < 3 then inCli = 1 sequence parse = {} while 1 do cl = {} sequence cmd = prompt_string(prompt()) if equal("exit", cmd) then exit end if puts(STDOUT, "\n") sequence tokens = tokenize_string(cmd) parse = tokens[1] for i = 1 to length(parse) do cl = append(cl, parse[i][TDATA]) end for parse_pairs_from(1) end while end if
-Bruce