[xsmith-dev] Random Function Name Generate Question
TUO ZHAO
u1129777 at utah.edu
Tue Apr 14 13:41:34 MDT 2020
Hi all,
I'm trying to use XSmith to generate functions with different function names.
>From `3.6 Another Small Example With Variables` in the XSmith Doc, I think I need to use:
(add-to-grammar<file:///D:/Study/U/2020%20spring/Independent%20Study/racket/xsmith/xsmith/doc/xsmith/index.html#%28form._%28%28lib._xsmith%2Fmain..rkt%29._add-to-grammar%29%29>
....
[Decl #f (name type)]
)
But I still don't understand how to `access` this `name`
What I want to do, is that I want to generate a program like:
fn main() { random_program_name() ; } fn random_program_name() -> givenType { return 73 * 7 ; }
Basically it has a function declaration (with a random name and given type) in main and then I could create a function with that random name and return type. Now I just hard code it.
I don't actually know how to describe my problem well, so I attached my program and add a `;;TODO` comment next to the lines I'm confusing, hope you could give me some suggestions on how to fix it.
Please let me know what can I do
Best,
Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </listarchives/xsmith-dev/attachments/20200414/424017c2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rustlang.rkt
Type: application/octet-stream
Size: 4078 bytes
Desc: rustlang.rkt
URL: </listarchives/xsmith-dev/attachments/20200414/424017c2/attachment.obj>
More information about the xsmith-dev
mailing list