Skip to content

parse tree > Abstract Syntax Tree (AST) #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions software/micropython.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ This is, in fact, what you're doing when you live-code using the REPL. However,

MicroPython uses a combination of compilation and interpretation techniques to run your program. Here's how:

When MicroPython sees a script it parses each line of the script. The end result is a set of in-memory tokens grouped in such a way that they represent how your program works. This is called the *parse tree*.
When MicroPython sees a script it parses each line of the script. The end result is a set of in-memory tokens grouped in such a way that they represent how your program works. This is called the *Abstract Syntax Tree (AST)*.

The parse tree is compiled into a terse set of instructions called Python *bytecode*. Bytecode instructions are like CPU assembly language instructions, but they are targeted for a *virtual machine*, not for a real piece of computer hardware.
The AST is compiled into a terse set of instructions called Python *bytecode*. Bytecode instructions are like CPU assembly language instructions, but they are targeted for a *virtual machine*, not for a real piece of computer hardware.

The Python bytecode is given to the Python virtual machine to run and so your program is executed.

Expand Down