Standard Parser vs. My Object Model for Very Abstract ML

T

T. Sawyer

OKay this is kind of an odd one, so I thought others might be interested. I have developed a new "meta-language" that uses an abstract ascii-art template syntax. I'm sure you have all seen ascii diagrams like this before:

+---------------+
| foo.bar |
+---------------+
| [click.btn] |
+---------------+

This is a very simplistic example, but I use something like this to generate user interface. Anyway, I'm currently converting the above diagram into an abstract object model by brute force. That is to say I wrote my own parser and I build a tree like structure with an object hierarchy, which is then used to produce other markup, like html.

So here's the deal. I don't know a lot about standard parsers. I'm wondering if this could be handled better by somthing like yacc? or others?

Thanks,
T.
 
L

Lennon Day-Reynolds

Standard parser-generators like yacc are designed to support the kind
of syntax you see in most programming languages: line-oriented,
balanced delimiters, simple tokens, etc. What you seem to be
describing is almost closer to image analysis (find bounding boxes,
determine containment based on size and location, etc.) than normal
code lexing and parsing.

Basically, if you have a parser for this syntax which works, I'd say
you should stick with it, as the work needed to shoehorn a traditional
parser generator into this role would probably be substantial.
 
T

T. Sawyer

Standard parser-generators like yacc are designed to support the kind
of syntax you see in most programming languages: line-oriented,
balanced delimiters, simple tokens, etc. What you seem to be
describing is almost closer to image analysis (find bounding boxes,
determine containment based on size and location, etc.) than normal
code lexing and parsing.

Basically, if you have a parser for this syntax which works, I'd say
you should stick with it, as the work needed to shoehorn a traditional
parser generator into this role would probably be substantial.

Thank you. That's what I need to know.

T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top