GitHub - znsoooo/lisp-parser: A Lisp parser based on Python's regular expression.

A Lisp parser based on Python's regular expression.

Usage

  • Parse text:

    root = lisp.ParseLisp(text)
  • Search node by name:

    for node in root['name']:
        print(node)
  • Search node by index:

  • Get node's parent:

  • Get node by chain:

    node = root['name', -1, ..., 2, 1, 0]
  • Get node's children:

    for child in node:
        print(child)
  • Get children's count:

  • Get node's name:

  • Compare with node's name:

  • Check sub-node in node: