Forward Declaration Syntax

From: [at]} <mcintosh{>
Date: Thu, 21 Mar 2002 06:34:26 -0600 (CST)

----boundary-LibPST-iamunique-700903061_-_-
Content-type: text/plain

I ran the syntax from Appendix B: Syntax of Component Pascal through Coco. I think that there is a discrepancy between the Forward procedure declaration in the explanitory text and the syntax diagram. The compiler seems to require the version in the explanitory text.

I wish that I had a current syntax to feed Coco.

MODULE PrivAlm01TestForward;
(* Test the compiler behavior on forward declarations. *)
        TYPE ReceiveRecord = POINTER TO RECORD END;
        PROCEDURE ^ (this:ReceiveRecord) Forward ( ):INTEGER, NEW; (*The NEW is the discrepancy *)
        PROCEDURE (this:ReceiveRecord) Forward ( ):INTEGER, NEW;
        BEGIN
                RETURN 42
        END Forward;
END PrivAlm01TestForward.


>From the explanitory text.

ProcedureHeading = PROCEDURE [Receiver] IdentDef
                [FormalParameters] MethAttributes.
Receiver = "(" [VAR | IN] ident ":" ident ")".
MethAttributes = ["," NEW] ["," (ABSTRACT | EMPTY | EXTENSIBLE)].

ProcedureDeclaration = ProcedureHeading ";" [ ProcedureBody ident ].
ProcedureHeading = PROCEDURE [Receiver] IdentDef
                [FormalParameters] MethAttributes.
ProcedureBody = DeclarationSequence
                [BEGIN StatementSequence] END.
DeclarationSequence = {CONST {ConstantDeclaration ";"} |
                TYPE {TypeDeclaration ";"} |
            VAR {VariableDeclaration ";"} }
           {ProcedureDeclaration ";" | ForwardDeclaration ";"}.
ForwardDeclaration = PROCEDURE " ^ " [Receiver] IdentDef
                [FormalParameters] MethAttributes.


>From the syntax diagrams.

ForwardDecl = PROCEDURE "^" [Receiver] IdentDef [FormalPars].
ProcDecl = PROCEDURE [Receiver] IdentDef [FormalPars]
                ["," NEW] ["," (ABSTRACT | EMPTY | EXTENSIBLE)]
                [";" DeclSeq [BEGIN StatementSeq] END ident].
--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-700903061_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEkgcmFuIHRoZSBzeW50YXggZnJvbSBBcHBlbmRp
eCBCOiBTeW50YXggb2YgQ29tcG9uZW50IFBhc2NhbCB0aHJvdWdoIENvY28uICBJIHRoaW5rIHRo
YXQgdGhlcmUgaXMgYSBkaXNjcmVwYW5jeSBiZXR3ZWVuIHRoZSBGb3J3YXJkIHByb2NlZHVyZSBk
ZWNsYXJhdGlvbiBpbiB0aGUgZXhwbGFuaXRvcnkgdGV4dCBhbmQgdGhlIHN5bnRheCBkaWFncmFt
LiAgVGhlIGNvbXBpbGVyIHNlZW1zIHRvIHJlcXVpcmUgdGhlIHZlcnNpb24gaW4gdGhlIGV4cGxh
bml0b3J5IHRleHQuXHBhcg0KXHBhcg0KSSB3aXNoIHRoYXQgSSBoYWQgYSBjdXJyZW50IHN5bnRh
eCB0byBmZWV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bHksIHdpdGhvdXQgY3JlYXRp
bmcgYW55IG92ZXJoZWFkLlxwYXINClxwYXINCmIpIElmLCBmb3Igc29tZSByZWFzb24sIHlvdSBj
YW5ub3QgcG9zdCBmcm9tIHRoZSBhZGRyZXNzLCBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmliZWQs
IHlvdXIgbWVzc2FnZSB3aWxsIGJlIG1vZGVyYXRlZCB0byBhdm9pZCBzcGFtLiBQbGVhc2UgdW5k
ZXJzdGFuZCB0aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRlbiBjYXVzZSBzb21lIGRlbGF5LCBpbiBw
YXJ0aWN1bGFyIG92ZXIgd2Vla2VuZHMgb3IgaG9seWRheX19AH/Wfu2GwDv3hvGQaA==


----boundary-LibPST-iamunique-700903061_-_---
Received on Thu Mar 21 2002 - 13:34:26 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:46 UTC