Question: Develop a complete Interpreter in python that executes with the scanner and parser for the Julia Grammar below. You must show the execution of this

Develop a complete Interpreter in python that executes with the scanner and parser for the Julia Grammar below. You must show the execution of this program by using several relevant source lines as input, the program must show the corresponding statement recognized. Write a short report with READABLE screenshot of your execution output, then your report describing the work performed, followed by your interpreter code copied and pasted as text.
Scanner
import re
# Define token types
token_spec =[
('FUNCTION', r'\bfunction\b'),
('END', r'\bend\b'),
('IF', r'\bif\b'),
('THEN', r'\bthen\b'),
('ELSE', r'\belse\b'),
('WHILE', r'\bwhile\b'),
('DO', r'\bdo\b'),
('REPEAT', r'\brepeat\b'),
('UNTIL', r'\buntil\b'),
('PRINT', r'\bprint\b'),
('ID', r'[A-Za-z_][A-Za-z0-9_]*'),
('ASSIGN', r'='),
('LE_Operator', r'<='),
('LT_Operator', r'<'),
('GE_Operator', r'>='),
('GT_Operator', r'>'),
('EQ_Operator', r'=='),
('NE_Operator', r'~='),
('Add_Operator', r'\+'),
('Sub_Operator', r'-'),
('Mul_Operator', r'\*'),
('Div_Operator', r'/'),
('INTEGER', r'\d+'),
('NEWLINE', r'
'),
('SKIP', r'[\t]+'),
('MISMATCH', r'.'),
]
# Compile the regex for efficiency
token_regex ='|'.join('(?P

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 Programming Questions!