Name: answer/4
Name: q_call/5
Name: q_garbage/3
Name: q_keep/3
Name: q_import/4
Name: q_fetch/3
Name: q_push/3
Name: q_method/6
answer(Object, success) --> "0", !, object(Object). answer(_, Error) --> "1", !, object(Error).
Calls:
Name: object/3
Name: !
Name: =/2
atomstring(X) --> {atom_codes(X, C)}, C.
Name: phrase/3
Name: atom_codes/2
Called:
avl_pairs([H|T]) --> key_value_pair(H), !, avl_pairs_remainder(T). avl_pairs([]) --> [].
Name: avl_pairs_remainder/3
Name: key_value_pair/3
Name: dict/3
avl_pairs_remainder([H|T]) --> ",", !, key_value_pair(H), avl_pairs_remainder(T). avl_pairs_remainder([]) --> [].
Name: RECURSIVE_CALL/3
Name: avl_pairs/3
bool(true) --> "True", !. bool(false) --> "False".
dict(AVL) --> {var(AVL)}, "{", !, avl_pairs(List), "}", {list_to_avl(List, AVL)}. dict(AVL) --> {avl_to_list(AVL, List)}, !, "{", avl_pairs(List), "}". dict(dict(X)) --> "{", dict_elements(X), "}".
Name: dict_elements/3
Name: avl_to_list/2
Name: list_to_avl/2
Name: var/1
dict_element(X) --> {ground(X), X =.. [Key, Value], atom_codes(Key, KeyCodes)}, !, string(string(KeyCodes)), ":", object(Value).
Name: string/3
Name: =../2
Name: ground/1
Name: dict_elements_remainder/3
dict_elements([H|T]) --> dict_element(H), !, dict_elements_remainder(T). dict_elements([]) --> [].
Name: dict_element/3
dict_elements_remainder([H|T]) --> ",", !, dict_element(H), dict_elements_remainder(T). dict_elements_remainder([]) --> [].
digit(X) --> [X], {ground(X), X =< 0x39, X >= 0x30}.
Name: >=/2
Name: =</2
Name: num/4
elements([H|T]) --> object(H), !, elements_remainder(T). elements([]) --> [].
Name: elements_remainder/3
Name: tuple/3
Name: list/3
elements_remainder([H|T]) --> ",", !, object(H), elements_remainder(T). elements_remainder([]) --> [].
Name: elements/3
id(py(Id)) --> "py[", num(Id), "]".
Name: num/3
id_list(X) --> "[", ids(X), "]".
Name: ids/3
ids([]) --> "". ids([py(H)]) --> num(H), !. ids([py(H)|T]) --> num(H), ",", ids(T).
Name: id_list/3
key_value_pair(K-V) --> object(K), ":", object(V).
list(L) --> "[", !, elements(L), "]".
none(none) --> "None".
num(X) --> {number(X), !, number_codes(X, C)}, C. num(X) --> "-", !, num([H|T], 0), !, {number_codes(X, [0x2D, H|T])}. num(X) --> num([H|T], 0), !, {number_codes(X, [H|T])}.
Name: number_codes/2
Name: number/1
Name: id/3
num([H|T], X) --> digit(H), !, num(T, X). num([0x2E, H2|T], 0) --> ".", !, num([H2|T], 1). num([], _) --> [].
Name: RECURSIVE_CALL/4
Name: digit/3
object(X) --> list(X), !. object(X) --> tuple(X), !. object(X) --> dict(X), !. object(X) --> num(X), !. object(X) --> string(X), !. object(X) --> id(X), !. object(X) --> bool(X), !. object(X) --> none(X).
Name: none/3
Name: bool/3
q_call(Function, Args, KeywordArgs) --> "call,", atomstring(Function), ",", tuple(tuple([Args, KeywordArgs])).
Name: atomstring/3
q_fetch(Depth) --> "fetch,", {number_codes(Depth, Codes)}, Codes.
q_garbage(Ids) --> "del,", id_list(Ids).
q_import(Module, Alias) --> "import,", atomstring(Module), ",", atomstring(Alias).
q_keep(Ids) --> "keep,", id_list(Ids).
q_method(Object, Method, Args, KeywordArgs) --> "method,", id(Object), ",", atomstring(Method), ",", tuple(tuple([Args, KeywordArgs])).
q_push(py(ID)) --> "push,", num(ID).
string(string(S)) --> "\"", !, string_content(S)."
Name: string_content/3
string_content([]) --> "\"", !." string_content([92|T]) --> "\\\\", !, string_content(T). string_content([34|T]) --> "\\\"", !, string_content(T)." string_content([H|T]) --> [H], string_content(T).
tuple(tuple(L)) --> "(", !, elements(L), ")".