dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]A step into c_grammar.y


From: minddog
Subject: [DotGNU]A step into c_grammar.y
Date: Tue, 29 Oct 2002 09:19:28 -0700
User-agent: KMail/1.4.3

Okay,
        I'm working on a plugin and taking a look at a bunch of source code 
that rhys 
and others had written to create the C and Csharp languages in treecc to 
plugin to cscc compiler.   Now when looking at the yacc grammar extensively, 
I've come by many things I don't actually comprehend til hopping #include 
directives to find out what does what.  Good lesson for me when reading code, 
but sometimes that doesn't always work.  For instance,

PostfixExpression
        : PrimaryExpression
        
        ................................deleted

LINE 1:        | PostfixExpression '.' AnyIdentifier   {  // right here is 
something I am trying to modify for class attributes but looks like the 
oepration down on line 5
LINE 2:                      $$ = ILNode_CMemberField_create                    
                     
(FixIdentifierNode($1, 0), $3);
                        }
LINE 3:        | K_INVOKE TYPE_NAME '.' AnyIdentifier '(' ')'  { // the same 
thing here , I want to put in PTR_OP too... but i noticed a different type of 
node creation...if it was the same as above, a CMemberField_create, i 
wouldn't be asking, but does this function pertain to any cross compat with 
Csharp code or just a reuse of a function?
                                $$ = ILNode_CSharpInvocation_create
                                                                
(CScopeGetType(CScopeLookup($2)), $4, 0);
                        }
LINE 4:        | K_INVOKE TYPE_NAME '.' AnyIdentifier '(' 
ArgumentExpressionList ')'   {
                                $$ = ILNode_CSharpInvocation_create
                                                
(CScopeGetType(CScopeLookup($2)), $4, $6);
                        }
LINE 5:        | PostfixExpression PTR_OP AnyIdentifier        {
                                $$ = ILNode_CDerefField_create
                                                (FixIdentifierNode($1, 0), 
$3);
                        }

        .........................deleted


Kinda messy, but im learning ;)  Any help appreciate, can't quite figure out 
how to ask these questions better just yet...


-- 
--minddog( Adam Ballai )

"I try to take it one day at a time, but several of them attack me at once."
-mistyflip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]