Diagramming the sentence
Just as you diagram a sentence to show which words modify which, a parser arranges tokens into a tree showing program structure — the abstract syntax tree.
Structure from grammar
Parsing applies grammar rules to tokens, building an abstract syntax tree (AST) that captures the program's structure.