File size: 574 Bytes
339ddd8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- Node retriever (to executor): gathers Python AST symbols, imports, and call edges.
-- NOTE: this specification has not been compiled with the GF toolchain in the authoring environment.
abstract PythonRetriever = {
  cat
    Context ; Symbol ; Edge ;
  fun
    Gather : Symbol -> Edge -> Context ;
    Sym : String -> Symbol ;
    Dep : String -> String -> Edge ;
}

concrete PythonRetrieverEng of PythonRetriever = {
  lincat
    Context, Symbol, Edge = Str ;
  lin
    Gather s e = "context" ++ s ++ "edges" ++ e ;
    Sym n = n.s ;
    Dep a b = a.s ++ "->" ++ b.s ;
}