AST nodes in GitHub datasets

37 views
Skip to first unread message

Zhiyuan Wan

unread,
Apr 15, 2016, 5:23:51 AM4/15/16
to Boa Language and Infrastructure User Forum, wanzh...@zju.edu.cn
Hi there,
I have submit a Boa example with input dataset "2015 September/GitHub (small)". The example counts the AST nodes to measure the projects. However, there is no output after compiling and executing. 

The public information of this job can be found at this page: http://boa.cs.iastate.edu/boa/index.php?q=boa/run

Meanwhile, when I run the example with SourceForge dataset, the output is generated successfully.

I was wondering why this happened. Thank you so much in advance. 

The example is one of the examples on the website (http://boa.cs.iastate.edu/boa/index.php?q=boa/run) and the code is pasted as below:
--------------------------------------------------------------------------
# What are the 5 largest projects, in terms of AST nodes?
# Output is in Millions of AST nodes.
p: Project = input;
top5: output top(5) of string weight int;

astCount := 0;

visit(p, visitor {
# only look at the latest snapshot
before n: CodeRepository -> {
snapshot := getsnapshot(n);
foreach (i: int; def(snapshot[i]))
visit(snapshot[i]);
stop;
}
# by default, count all visited nodes
before _ -> astCount++;
# these nodes are not part of the AST, so do nothing when visiting
before Project, ChangedFile -> ;
});

top5 << p.project_url weight astCount / 1000000;
------------------------------------------------------------------------
 
Best,
Zhiyuan

Hoan Nguyen

unread,
Apr 15, 2016, 6:55:52 AM4/15/16
to boa-...@googlegroups.com, wanzh...@zju.edu.cn
Removing the division by 1,000,000 (/ 1000000) at the end of the program fixes the problem.

The reason was that the all projects in 2015 September/GitHub (small) dataset have less than 1,000,000 AST nodes.


--
More information about Boa: http://boa.cs.iastate.edu/
---
You received this message because you are subscribed to the Google Groups "Boa Language and Infrastructure User Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boa-user+u...@googlegroups.com.
To post to this group, send email to boa-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhiyuan Wan

unread,
Apr 16, 2016, 7:24:09 AM4/16/16
to Boa Language and Infrastructure User Forum
Thank you so much for your reply.
It works!

在 2016年4月15日星期五 UTC+8下午6:55:52,Hoan Nguyen写道:
Reply all
Reply to author
Forward
0 new messages