I heard that a program can be presented as a tree. I also heard that there is a programming language whose syntax make this idea very clear. I mean that programs written in this language can be easily represented as a tree. Does anybody know what is the name of this language?
The Lisp language can be easily seen as a tree due to its parenthesized form. For example:
(lambda (arg) (+ arg 1))
O
/|\
/ | \
/ | \
/ | \
lambda O O
/ /|\
/ / | \
/ / | \
arg + arg 1
Of course every program can be represented by its syntax tree but this is not as easy to see.
The syntax of code in most programming languages can be represented as a tree. Parsers usually work by transforming the program text into a tree, which is called a parse tree.
Lisp has a syntax that makes the tree-structure of code quite explicit, since the source code is written as nested lists. Eg. an if in Lisp:
(if (= a (+ b c))
(print (string-append "something" a))
(print "something else"))
Equivalent in Python:
if a == b + c:
print "something: " + a
else:
print "something else"
The tree structure of the code is very clear in the Lisp code (as a tree of nested lists), while it is somewhat obscured in the Python code due to syntax and precedence rules.
The representation of code as a tree structure of nested lists is a powerful feature. For example, you can pretty easily write macros which transforms code. The drawback is that some find the very uniform Lisp code hard to read.
Any language using polish notation matches your question.
Other than Lisp, most popular are Postscript and PDF.
Unix dc
is another example.
You might be thinking of the rather unfortunately named 'Jackson Structured Programming' method which, whilst not a language in its own right, does force you to lay out programs in a strict tree format.