Abstract syntax tree

It is a tree representation of the abstract syntactic structure of text (often source code) written in a formal language.Likewise, a syntactic construct like an if-condition-then statement may be denoted by means of a single node with three branches.However, some language constructs require an arbitrarily large number of children, such as argument lists passed to programs from the command shell.As a result, an AST used to represent code written in such a language has to also be flexible enough to allow for quick addition of an unknown quantity of children.The source code produced should be sufficiently similar to the original in appearance and identical in execution, upon recompilation.The AST is used intensively during semantic analysis, where the compiler checks for correct usage of the elements of the program and the language.
An abstract syntax tree for the following code for the Euclidean algorithm :
while b  0:
    if a > b:
        a := a - b
    else:
        b := b - a
return a
parse treeEuclidean algorithmcomputer scienceabstract syntacticsource codeformal languageparse treesparsercompilingcontextual analysisprogram analysisprogram transformationdata structurescompilerssyntax analysisambiguouscontext-free grammarduck typingOperator overloadingcommand shellsemantic analysissymbol tablesintermediate languageclone detectionAbstract semantic graphComposite patternControl-flow graphDirected acyclic graphDocument Object ModelExpression treeExtended Backus–Naur formSemantic resolution treeShunting-yard algorithmSymbol tableTreeDLCiteSeerXEclipsevisualizeUnparsingParsing algorithmsTop-downEarleyRecursive descentTail recursiveBottom-upSimpleOperatorShunting-yardLook-aheadCanonicalGeneralizedRecursive ascentShift-reduceCombinatorLeft cornerDefinite clause grammarDeterministic parsingDynamic programmingMemoizationParser generatorScannerless parsingHistory of compiler constructionComparison of parser generatorsOperator-precedence grammar