def interpret(x): if isinstance(x, Ast): return x.jsonNode(False, set()) elif isinstance(x, basestring): return ppfa(x).jsonNode(False, set()) else: return pfa(x).jsonNode(False, set())
def interpret(x): """Interpret expression from a PFA abstract syntax tree or PrettyPFA string. :type x: titus.datatype.Ast, PrettyPFA string :param x: input PFA :rtype: Pythonized JSON :return: the PFA as Pythonized JSON """ if isinstance(x, Ast): return x.jsonNode(False, set()) elif isinstance(x, str): return ppfa(x).jsonNode(False, set()) else: return pfa(x).jsonNode(False, set())
def interpret(x): """Interpret expression from a PFA abstract syntax tree or PrettyPFA string. :type x: titus.datatype.Ast, PrettyPFA string :param x: input PFA :rtype: Pythonized JSON :return: the PFA as Pythonized JSON """ if isinstance(x, Ast): return x.jsonNode(False, set()) elif isinstance(x, basestring): return ppfa(x).jsonNode(False, set()) else: return pfa(x).jsonNode(False, set())