Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. (15) You are a Pascal teacher (a very good programmer using assembly language (i.e., machine language) of your local machine). You are given only

image text in transcribed
5. (15) You are a Pascal teacher (a very good programmer using assembly language (i.e., machine language) of your local machine). You are given only the following programmes: (a) A compiler written in P-code: translate a program in Pascal to one in P-code (P-code is very close to your local machine language). narstongfdarabbt fojivihirbagfjhalvirjgfdkugkligkflikaitkujibaktefnunjfejkyet (b) A P-code interpreter written in Pascal: able to interpret any program written in P-code. a) (10) What will you do (with minimal effort) to run the Pascal programs your students submit on your local machine? b) (5) If you are given a compiler written in Pascal which translate a program in Pascal to a program in P-code, how can you produce a compiler in machine language that compiles a program in Pascal to a program in machine language? 6. Use regular expression (in the form of production rules) to specify the syntax (a) natural numbers. (b) all strings over alphabet {a, b, A, B} that starts with capital letters. (c) Numeric constants in a language X. A numeric constant is an octal, decimal, or hexadecimal integer. An octal integer begins with 0, and may contain only the digits from 0 to 7. A hexadecimal integer begins with Ox or 0x, and may contain the digits from 0 to 9 and letters from a/A to f/F. Decimal integers are those we normally use in our daily life. 7. Use English to describe what strings are represented by the regular expression (in classical form)(cab) ? 8. (15) Given an input (x+y5) *5 /* This is a comment */ 2x, what are the tokens recognized by the DFA in Page 12 of the slides (for regular expressions)? 5. (15) You are a Pascal teacher (a very good programmer using assembly language (i.e., machine language) of your local machine). You are given only the following programmes: (a) A compiler written in P-code: translate a program in Pascal to one in P-code (P-code is very close to your local machine language). narstongfdarabbt fojivihirbagfjhalvirjgfdkugkligkflikaitkujibaktefnunjfejkyet (b) A P-code interpreter written in Pascal: able to interpret any program written in P-code. a) (10) What will you do (with minimal effort) to run the Pascal programs your students submit on your local machine? b) (5) If you are given a compiler written in Pascal which translate a program in Pascal to a program in P-code, how can you produce a compiler in machine language that compiles a program in Pascal to a program in machine language? 6. Use regular expression (in the form of production rules) to specify the syntax (a) natural numbers. (b) all strings over alphabet {a, b, A, B} that starts with capital letters. (c) Numeric constants in a language X. A numeric constant is an octal, decimal, or hexadecimal integer. An octal integer begins with 0, and may contain only the digits from 0 to 7. A hexadecimal integer begins with Ox or 0x, and may contain the digits from 0 to 9 and letters from a/A to f/F. Decimal integers are those we normally use in our daily life. 7. Use English to describe what strings are represented by the regular expression (in classical form)(cab) ? 8. (15) Given an input (x+y5) *5 /* This is a comment */ 2x, what are the tokens recognized by the DFA in Page 12 of the slides (for regular expressions)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago