Tags:
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...
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post