Representing production expansion
A context-free grammar derives input by replacing nonterminals using productions. A parse tree arranges these replacements hierarchically: its root is the start symbol and its ordered leaves yield the terminal sequence.
Different expansion orders can produce the same tree, such as choosing which nonterminal to expand first. The tree records structural relationships rather than one unique temporal sequence, so different derivations do not automatically imply different meanings.
References: [1]
Different trees can change interpretation
A grammar is ambiguous when one string admits more than one parse tree. For an expression such as 2+3*4, alternative grouping trees can correspond to different arithmetic results.
Separate grammar levels can enforce precedence, while parentheses provide explicit grouping. Associativity constrains repeated operators at the same precedence. These rules restrict admissible trees rather than merely changing how an already fixed tree is displayed.
References: [1]
Parse trees and ASTs serve different needs
A grammar-level tree can contain punctuation and intermediate nodes introduced to express productions. An abstract syntax tree commonly compresses these details into operations and related program constructs.
Comments and exact formatting depend on the representation. Neither label alone guarantees byte-for-byte source reconstruction; rewriting tools can retain token positions and additional textual information for that purpose.