Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

GDB - Topic:
“In computer science, a parsing is the process of analyzing a string of symbols according to the rules of a formal grammar in a computer, either in natural language or in different computer languages. In your opinion, what significance, a parse tree does have during syntax and semantic analysis in compiler designing? Discuss it with proper reasoning”.

A concise, coherent and to the point comment is preferred over lengthy comment having irrelevant details. Your comment must not be more than 5-7 lines. Comments, posted on regular Lesson's MDB or sent through email will NOT be considered in any case. Any request about such an acceptance will not be catered

Views: 531

Replies to This Discussion

In my opinion the significance a parse tree does have during syntax and semantic analysis in compiler designing are:


Semantic Analysis

Disambiguate Overloaded operators: If an operator is overloaded, one would like to specify the meaning of that particular operator because from one will go into code generation phase next.

Type checking: The process of verifying and enforcing the constraints of types is called type checking. This may occur either at compile-time (a static check) or run-time (a dynamic check). Static type checking is a primary task of the semantic analysis carried out by a compiler. If type rules are enforced strongly (that is, generally allowing only those automatic type conversions which do not lose information), the process is called strongly typed, if not, weakly typed.

Uniqueness checking: Whether a variable name is unique or not, in its scope.

Type coercion: If some kind of mixing of types is allowed it will be done in languages which are not strongly typed. This can be done dynamically as well as statically.

Name Checks: Check whether any variable has a name which is not allowed. Ex. Name is same as an identifier (Ex. int in java).

Syntax analysis

In syntax analysis we used context free grammar. Here we put lot of attributes around it.

So it consists of context sensitive grammars along with extended attribute grammars. Adhoc methods also good as there is no structure in it and the formal method is simply just too tough. So we would like to use something in between. Formalism may be so difficult that writing specifications it may become tougher than writing compiler itself. So we do use attributes but we do analysis along with parse tree itself instead of using context sensitive grammars.


plzzzzzzzz coment on this is this right?????/

in your GDB...what is the part of parse tree..?

Naina thanks for sharing 

All students must share points and also your problems.... so it can discussed and solution can prepare.

Don’t wait for solutions just participate in Discussions because after discussions a correct solution will prepare...

koi prper solution tu send krooooooooooo

1 hour remaining......????


© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service