Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

entity relationship modeling

by moo (Acolyte)
on Dec 14, 2001 at 04:41 UTC ( [id://131851]=perlquestion: print w/replies, xml ) Need Help??

moo has asked for the wisdom of the Perl Monks concerning the following question:

hello all,

the point to my last question regarding accessing the text of an icon was to find out about HOW perl sets up the relationship between icons.

for example: x = 1;

seems simple enough, but the relationship may be described as:

entity relation entity

looks like three thingies. but, there are actually 5 thingies...within the spaces between each the entity and relation is "something" that does the binding. i'm looking for that "something".

why? the main reason behind this is that we can use this stuff as a model for programming objects...emulate that binding in the "how" during the design phase. it'll also help us think about what perl is doing in the background and any useful side effects.

i've started my research with chapter 3, Advanced Perl Programming and am wading through it. i really like the notion of truly lexical entities.

anyone have some insight into this stuff?

thanks,

moo

Edit ar0n -- removed <pre> tags

Replies are listed 'Best First'.
Re: entity relationship modeling
by Zaxo (Archbishop) on Dec 14, 2001 at 05:26 UTC

    Consider:

    $x=1;
    One answer to your specific question is that the token '=' is recognised by Perl as an operator which demands an argument on each side. Following rules of precedence, Perl looks left for an 'lvalue' which can be assigned to, and an 'rvalue' to the right from which to draw the new value.

    Your way of expressing the question suggests that you are unfamiliar with Perl syntax and spoken conventions. Perhaps The Llama or The Camel would serve you better for now, and make the excellent Black Cat more accessible.

    After Compline,
    Zaxo

Re: entity relationship modeling
by jepri (Parson) on Dec 14, 2001 at 06:16 UTC
    I've been batting this sort of thing around for a compiler (not perl) and like Zaxo says, it translates into an "assign" operation. In more detail, it becomes:

    left-value operator expression

    which roughly translates into a conceptual function like assign(left-value, eval(expression)). As to assigning relationships, the parser builds a tree. I'm not familiar with perl's tree, but it would probably look a little like this:

    = / \ x 1

    That is, the '=' is the important parent and the x and the 1 are arguements to it.

    Is that what you were looking for?

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

      thanks for the reply jeremy!
      
      what is (are) your source(s) for the above?
      
      thanks,
      
      moo
      
        At first I fumbled around and got it by accident. Then I found a post by Brent Dax on the Perl 6 mailing list called "babyperl.pl" which is a mini perl parser, and took that apart.

        I also have some books, one by Niklaus Wirth called "Compiler Construction". Check the comp.compilers homepage for Jack Crenshaw's excellent "Let's write a compiler" online tutorial. The page also has other resources that are very handy indeed.

        Finally, /msg me... I'm in the middle of writing a pascal compiler so I'm facing the same issues you are looking at.

        ____________________
        Jeremy
        I didn't believe in evil until I dated it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://131851]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2024-04-25 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found