# Parsing Julia code

**URL:** <https://discourse.julialang.org/t/parsing-julia-code/61599>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [May 21, 2021, 5:22pm UTC](https://discourse.julialang.org/t/parsing-julia-code/61599 "2021-05-21T17:22:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![achjaj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/achjaj/32/22358_2.png) [@achjaj](https://discourse.julialang.org/u/achjaj)\
**Post date:** [May 21, 2021, 5:22pm UTC](https://discourse.julialang.org/t/parsing-julia-code/61599/1 "2021-05-21T17:22:08Z")

</div>

Hello, I am working on a project where I need to parse and tokenized Julia source code. As I understand it correctly, the only available parser is the one used in REPL and is written in Scheme/Lisp. So, it looks like I need to somehow utilize this parser, but I do not know how to use it. What I understand is that there are at least two files `julia-parser.scm` and `julia-syntax.scm` that are executed internally using a modified version of Femtolisp. I was looking on the Internet for more information, but it looks like despite the demand there is no documentation about the internals of Julia.

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [May 21, 2021, 5:26pm UTC](https://discourse.julialang.org/t/parsing-julia-code/61599/2 "2021-05-21T17:26:17Z")

</div>

Use `Base.Meta.parse(str)`

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [May 21, 2021, 5:27pm UTC](https://discourse.julialang.org/t/parsing-julia-code/61599/3 "2021-05-21T17:27:55Z")

</div>

> [@achjaj](#):
>
> As I understand it correctly, the only available parser is the one used in REPL and is written in Scheme/Lisp.

There is also [GitHub - julia-vscode/CSTParser.jl: A concrete syntax tree parser for Julia](https://github.com/julia-vscode/CSTParser.jl), which is written in native Julia and uses [GitHub - JuliaLang/Tokenize.jl: Tokenization for Julia source code](https://github.com/JuliaLang/Tokenize.jl/) for tokenization.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [May 22, 2021, 1:15pm UTC](https://discourse.julialang.org/t/parsing-julia-code/61599/4 "2021-05-22T13:15:58Z")

</div>

> [@achjaj](#):
>
> I was looking on the Internet for more information, but it looks like despite the demand there is no documentation about the internals of Julia.

There’s a whole section of the manual:

[https://docs.julialang.org/en/v1/devdocs/init/](https://docs.julialang.org/en/v1/devdocs/init/)
