You are on page 1of 3

Analysis

The term analysis refers to breaking down a product/system/event etc., into its
components so that each individual constituent is better understood. Once the
individual constituets are thoroughly studied the output in terms of their summation is
arrived at. This helps in better comprehension of the subject under study. The
breaking down obviously, need not be physical.

Synthesis

Synthesis on the other hand is the combination of ideas into a complex whole. Once
the individual components are clearly understood in the analytical stage, their
collective outcome is studied in the synthesis stage. However, it is important to
remember that the sum is always greater than the total. Hence the system synthesis
which is a holistic approach to a given problem studies not just the aggregate output
of individual constituent elements but the ultimate outcome which, in most cases
always exceeds the aggregate of contribution of individual members.
Deference between pars tree and ast

A parse tree is a record of the rules (and tokens) used to match


some input text whereas a syntax tree records the structure of the
input and is insensitive to the grammar that produced it. Note that
there are an infinite number of grammars for any single language
and hence every grammar will result in a different parse tree form
for a given input sentence because of all the different intermediate
rules. An abstract syntax tree is a far superior intermediate form
precisely because of this insensitivity and because it highlights the
structure of the language not the grammar.

It's best to look at an example. For input 3+4 you really want to
use the following intermediate form:
+
| \
3 4
That is, the operator at the root and 3 and 4 as operands (children).
In ANTLR child-sibling form, you'd have
+
|
3 -- 4
Ok, so now a parse tree. I'll pick an extremely simple one out of the
infinite number:
expr
|
plus
| \ \
3 + 4

Parse tree
A concrete syntax tree or parse tree or parsing tree[1] is an (ordered, rooted) tree that
represents the syntactic structure of a string according to some formal grammar. In a
parse tree, the interior nodes are labeled by non-terminals of the grammar, while the leaf
nodes are labeled by terminals of the grammar. Parse trees may be generated for
sentences in natural languages (see natural language processing), as well as during
processing of computer languages, such as programming languages. Parse trees are
distinct from abstract syntax trees (also known simply as syntax trees), in that their
structure and elements more concretely reflect the syntax of the input language.
Abstract syntax tree
In computer science, an abstract syntax tree (AST), or just syntax tree, is a tree
representation of the abstract syntactic structure of source code written in a programming
language. Each node of the tree denotes a construct occurring in the source code. The
syntax is 'abstract' in the sense that it does not represent every detail that appears in the
real syntax. For instance, grouping parentheses are implicit in the tree structure, and a
syntactic construct such as an if-condition-then expression may be denoted by a single
node with two branches.

You might also like