Question: CODING GUIDES: >>>> >>> MAKE CLASS AND USE IMPORT re IN MODULE 2: ALSO TAKE INPUT FROM USER AND USE IMPORT ast Output Should be

 CODING GUIDES: >>>> >>> MAKE CLASS AND USE IMPORT re IN

MODULE 2: ALSO TAKE INPUT FROM USER AND USE IMPORT ast Output

CODING GUIDES:

>>>>

>>>

MAKE CLASS AND USE IMPORT re

IN MODULE 2: ALSO TAKE INPUT FROM USER AND USE IMPORT ast

Output Should be According to the given input.

Links:

Mod 1:

1. https://docs.python.org/3/library/re.html

2. https://www.w3schools.com/python/python_regex.asp

Mod 2:

1. https://docs.python.org/3/library/ast.html

2. https://www.pythonpool.com/python-ast/

IMPORTANT NOTE:

1) Documentation of each module along with code file.

2) Use of proper function for each module.

3) No PLAGIARISM- CODE SHOULD NOT BE AVAILAIBLE ON OTHER SITES

4) Write SIMPLE CODE WITH COMMENTS AND NOT COPIED CODE.

KINDLY FOLLOW ALL ABOVE INSTRUCTIONS, THANKYOU...

Compiler operates in various phases each phase transforms the source program from one representation to another. Every phase takes inputs from its previous stage and feeds its output to the next phase of the compiler. There are 6 phases in a compiler. Each of this phase help in converting the high-level langue the machine code. The phases of a compiler are: 1. Lexical analysis 2. Syntax analysis 3. Semantic analysis 4. Intermediate code generator 5. Code optimizer 6. Code Generator All these phases convert the source code by dividing into tokens, creating parse trees, and optimizing the source code by different phases. You are required to implement all the phases with module wise. For this assignment you are going to implement two phases: Module 1: Implementation of lexical analyzer - Tokenization of expression (expression can be i.e a +(bc) or 3+(52) digits, alphabets, characters ) - Building regex for the expression - Output tags/ tokens of the expression (i.e. ['a', '+', '(', 'b', '*', 'c', ')'] ) Note: For this task you are required to explore python re library: 1. https://docs.python.org/3/library/re.html 2. https://www.w3schools.com/python/python regex.asp Module 2: Implementation of syntax tree using AST library of python Note: For this task you are required to explore python AST library: 1. https://docs.python.org/3/library/ast.html 2. https://www.pythonpool.com/python-ast/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!