Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Standard Parser vs. My Object Model for Very Abstract ML

Reply
Thread Tools

Standard Parser vs. My Object Model for Very Abstract ML

 
 
T. Sawyer
Guest
Posts: n/a
 
      08-18-2004
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.




 
Reply With Quote
 
 
 
 
Lennon Day-Reynolds
Guest
Posts: n/a
 
      08-18-2004
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.

--
Lennon
rcoder.net


 
Reply With Quote
 
 
 
 
T. Sawyer
Guest
Posts: n/a
 
      08-18-2004
> 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.
>
> --
> Lennon
> rcoder.net


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

T.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstract Methods & Abstract Class Iyer, Prasad C Python 0 10-20-2005 06:35 AM
About abstract class and abstract method Sameer Java 4 08-31-2005 12:59 AM
Deriving abstract class from non-abstract class Matthias Kaeppler Java 1 05-22-2005 01:28 PM
Abstract class with no abstract functions Uzytkownik C++ 3 04-03-2005 05:45 PM
Abstract Classes w/o abstract methods DaKoadMunky Java 4 04-20-2004 04:53 AM



Advertisments