... | ... | @@ -50,7 +50,7 @@ Note: some sources will say an "AST", but they actually mean a parse tree. One c |
|
|
|
|
|
Some examples of parse trees and ASTs:
|
|
|
|
|
|
* Python: [parse tree](https://docs.python.org/3/reference/grammar.html) and [AST](https://docs.python.org/3/library/ast.html#abstract-grammar).
|
|
|
* Python: [parse tree](https://docs.python.org/3/reference/grammar.html) and [AST](https://docs.python.org/3/library/ast.html#abstract-grammar) ([docs](https://docs.python.org/devguide/compiler.html)).
|
|
|
* C: [parse tree](https://www.lysator.liu.se/c/ANSI-C-grammar-y.html) and [AST](https://www.cs.utah.edu/flux/flick/current/doc/guts/gutsch6.html), another [AST](https://github.com/eliben/pycparser/blob/7547e850a05d84fbe598e6bd1bd03f09bf524ac6/pycparser/_c_ast.cfg) (from which [c_ast.py](https://github.com/eliben/pycparser/blob/7547e850a05d84fbe598e6bd1bd03f09bf524ac6/pycparser/c_ast.py) is generated).
|
|
|
* Fortran: [parse tree](http://docs.cray.com/books/007-3694-003/html-007-3694-003/faxalchri.html) (see also the Appendix D in the [Fortran 2008 Standard](http://www.j3-fortran.org/doc/year/10/10-007.pdf) for another parse tree). I haven't found an example of an AST for Fortran.
|
|
|
|
... | ... | |