Parcer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Parcer

Michael Gross-4

Where is Smalltalk getting information from to know that an external C call is formatted correctly?

 

Thanks!

 

Mike


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Parcer

Wallen, David

With DLLCC package loaded, the developer can declare external functions and the types of their parameters. If it thinks there are syntactical errors, the parser won’t accept the declaration. If it accepts it, then the external interface machinery passes this “signature” to the OE, along with the parameters when a call is made. At run time, if the parameter types don’t match the declared types, you get an error before the call is even made. So, there are at least two checks on format—one during parsing, which you are probably asking about. The other is at runtime, when the arguments (er, parameters?) are checked.

 

Next, about the parser, how do we know it is correct? Well, it’s mostly correct, but needs updating. There are a variety of C constructs that it doesn’t handle well. Most of those are modernizations. If you are having trouble parsing a C header file, it may be easier over the short term to track down the declarations you really need, and try implementing them by hand. Alternatively, you can copy the header file and remove stuff you know isn’t needed. The resulting simplified .h file may parse successfully.

 

I hope this helps at least somewhat.

 

- Dave

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Gross
Sent: Wednesday, July 06, 2011 6:22 AM
To: [hidden email]
Subject: [vwnc] Parcer

 

Where is Smalltalk getting information from to know that an external C call is formatted correctly?

 

Thanks!

 

Mike


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Parcer

Michael Gross-4

Hi David,

              Thanks for your reply!

Specifically I am trying to declare an external function and when I try save the method it says there are syntactical errors.

The method will save in a current version of VW but not in the version I am working with. It tells me there are syntactical errors.

I was trying to work around this.

 

Mike

 

 

From: Wallen, David [mailto:[hidden email]]
Sent: Wednesday, July 06, 2011 1:02 PM
To: Michael Gross; [hidden email]
Subject: RE: [vwnc] Parcer

 

With DLLCC package loaded, the developer can declare external functions and the types of their parameters. If it thinks there are syntactical errors, the parser won’t accept the declaration. If it accepts it, then the external interface machinery passes this “signature” to the OE, along with the parameters when a call is made. At run time, if the parameter types don’t match the declared types, you get an error before the call is even made. So, there are at least two checks on format—one during parsing, which you are probably asking about. The other is at runtime, when the arguments (er, parameters?) are checked.

 

Next, about the parser, how do we know it is correct? Well, it’s mostly correct, but needs updating. There are a variety of C constructs that it doesn’t handle well. Most of those are modernizations. If you are having trouble parsing a C header file, it may be easier over the short term to track down the declarations you really need, and try implementing them by hand. Alternatively, you can copy the header file and remove stuff you know isn’t needed. The resulting simplified .h file may parse successfully.

 

I hope this helps at least somewhat.

 

- Dave

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Gross
Sent: Wednesday, July 06, 2011 6:22 AM
To: [hidden email]
Subject: [vwnc] Parcer

 

Where is Smalltalk getting information from to know that an external C call is formatted correctly?

 

Thanks!

 

Mike


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Parcer

Wallen, David

Sometimes you can get by using an older version. Perhaps it will work if you save your external interface in a parcel, and then load that parcel into your older image? This may work, as long as you don’t  edit and re-accept that declaration in the older VW. Could be worth a try, at least.

 

- Dave

 

From: Michael Gross [mailto:[hidden email]]
Sent: Wednesday, July 06, 2011 10:32 AM
To: Wallen, David; [hidden email]
Subject: RE: [vwnc] Parcer

 

Hi David,

              Thanks for your reply!

Specifically I am trying to declare an external function and when I try save the method it says there are syntactical errors.

The method will save in a current version of VW but not in the version I am working with. It tells me there are syntactical errors.

I was trying to work around this.

 

Mike

 

 

From: Wallen, David [mailto:[hidden email]]
Sent: Wednesday, July 06, 2011 1:02 PM
To: Michael Gross; [hidden email]
Subject: RE: [vwnc] Parcer

 

With DLLCC package loaded, the developer can declare external functions and the types of their parameters. If it thinks there are syntactical errors, the parser won’t accept the declaration. If it accepts it, then the external interface machinery passes this “signature” to the OE, along with the parameters when a call is made. At run time, if the parameter types don’t match the declared types, you get an error before the call is even made. So, there are at least two checks on format—one during parsing, which you are probably asking about. The other is at runtime, when the arguments (er, parameters?) are checked.

 

Next, about the parser, how do we know it is correct? Well, it’s mostly correct, but needs updating. There are a variety of C constructs that it doesn’t handle well. Most of those are modernizations. If you are having trouble parsing a C header file, it may be easier over the short term to track down the declarations you really need, and try implementing them by hand. Alternatively, you can copy the header file and remove stuff you know isn’t needed. The resulting simplified .h file may parse successfully.

 

I hope this helps at least somewhat.

 

- Dave

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Gross
Sent: Wednesday, July 06, 2011 6:22 AM
To: [hidden email]
Subject: [vwnc] Parcer

 

Where is Smalltalk getting information from to know that an external C call is formatted correctly?

 

Thanks!

 

Mike


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc