Skip to content

Traversing Formula AST #164

@kduraiswami

Description

@kduraiswami

Hello, I am trying to parse a formula into an AST tree and be able to decompose the functions. We are trying to build something which will rewrite the AST tree from excel into an AST tree in SQL.

formulas.Parser().ast('=SUBSTITUTE(H2,"AP","ATP")')
formulas.Parser().ast('=SUBSTITUTE(H2,"AP","ATP")')[1].compile()

Both of these run, but I am not clear at all how to traverse these objects or see what the AST is in the runtime in order to transpile to SQL. Thank you very much for the help, please let me know if there is a better method to use for my task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions