MCPcopy Index your code
hub / github.com/IBM/Project_CodeNet / node_info

Function node_info

tools/json-graph/src/jgf2spt.c:33–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31static int pprint = 0; // to pretty-print or not
32
33static int node_info(Node u)
34{
35 fprintf(stderr, "node: ");
36 show(stderr, u->id, 0);
37 fprintf(stderr, " children: %u ", outdegree(u));
38 jsmntok_t *val = node_attr_value(u, "token_id");
39 if (val) {
40 fprintf(stderr, " token_id: ");
41 show(stderr, val, 0);
42 }
43 jsmntok_t *type = node_attr_value(u, "node-type");
44 if (type && string_eq(type, "Token")) {
45 fprintf(stderr, " token: ");
46 show(stderr, u->label, 1);
47 }
48 else {
49 fprintf(stderr, " nonterm: ");
50 show(stderr, u->label, 1);
51 }
52 fputc('\n', stderr);
53 return 1;
54}
55
56static int edge_info(Edge e)
57{

Callers 1

show_spt_auxFunction · 0.85

Calls 4

showFunction · 0.85
outdegreeFunction · 0.85
node_attr_valueFunction · 0.85
string_eqFunction · 0.85

Tested by

no test coverage detected