My own infix to prefix approach. What do you think?
|
04-29-2014, 04:16 AM
Post: #4
|
|||
|
|||
RE: My own infix to prefix approach. What do you think?
(04-29-2014 03:08 AM)Les Bell Wrote: Matt, you're exploring the ideas that underlie parsing of formal languages, finite state machines, compilers, etc. For example, your idea can be implemented very easily using a parser toolkit like ANTLR (Another Toolkit for Language Recognition). In particular, ANTLR will let you write a grammar which will parse infix expressions and spit out prefix notation with virtually no programming at all. In fact, while implementing a parser and interpreter for a domain-specific language I've been working on, my diagnostic dumps of the ANTLR parse trees looked very much like your example. ANTLR also has an associated template engine which allows you to format the output so it could look exactly like your example, with no programming at all. Thanks Les! I'll look those up and see what I can uncover. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)