Skip to content

jake484/Ai4EMetaPSE.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ai4EMetaPSE

Stable Dev Build Status

Ai4EMetaPSE.jl can parse:

  • julia ASTs(abstract syntax tree) to a json file
  • json file to julia AST
  • a json file that include differential equations and generate julia solution code based on Sciml Ecosystem.

Install

using Pkg
Pkg.add("Ai4EMetaPSE")

Document

see more infomation in docs

Example

using Ai4EMetaPSE
open(`s.json`, "w") do io

    # parse a function f(x) to json file
    s = @julia2json function f(x)
        x + 1
    end

    JSON3.pretty(io, s)
end

In s.json:

{
    "args": [
        {
            "args": [
                "f",
                "x"
            ],
            "head": "call"
        },
        {
            "args": [
                {
                    "LINENUMBERNODE": {
                        "line": 11,
                        "file": "e:\\develop\\Ai4EMetaPSE.jl\\test\\julia2json.jl"
                    }
                },
                {
                    "LINENUMBERNODE": {
                        "line": 12,
                        "file": "e:\\develop\\Ai4EMetaPSE.jl\\test\\julia2json.jl"
                    }
                },
                {
                    "args": [
                        "+",
                        "x",
                        1
                    ],
                    "head": "call"
                }
            ],
            "head": "block"
        }
    ],
    "head": "function"
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Julia 100.0%