Version française
Home     About     Download     Resources     Contact us    
Browse thread
camlp4: Understanding class_declaration
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joel Reymont <joelr1@g...>
Subject: camlp4: Understanding class_declaration
Would someone kindly explain LEFTA, SELF, ANTIQUOT and QUOTATION below?

    class_declaration:
       [ LEFTA
         [ c1 = SELF; "and"; c2 = SELF ->
             <:class_expr< $c1$ and $c2$ >>
         | `ANTIQUOT (""|"cdcl"|"anti"|"list" as n) s ->
             <:class_expr< $anti:mk_anti ~c:"class_expr" n s$ >>
         | `QUOTATION x -> Quotation.expand _loc x  
Quotation.DynAst.class_expr_tag
         | ci = class_info_for_class_expr; ce = class_fun_binding ->
             <:class_expr< $ci$ = $ce$ >>
       ] ]

It seems they are variants but that's about as much as I understand.  
What are the "cdcl", "anti" or "list", for example? Why are they  
strings?

And why is `QUOTATION x expanded into Quotation.expand _loc x  
Quotation.DynAst.class_expr_tag?

	Thanks in advance, Joel

--
http://wagerlabs.com