Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

design a scanner In c language using following rules yes, design a scanner with these rules A program begins with the word main followed by

design a scanner In c language using following rules

image text in transcribed

yes, design a scanner with these rules

A program begins with the word main followed by a sequence of statements within block. The block has at least one statement. There are five types of statements. They are assignment statement, read statement, write statement, if-else statement, and while statement An identifier consists of lower or upper case letters and digits. An identifier begins with a letter. The identifiers are case sensitive. The following identifiers are considered reserved words with predefined meaning: main, read, write, if, else, while. An arithmetic expression consists of variables, integer literals, plus operator , minus operator multiplication operator *, division operator /, left parenthesis and right parenthesis ). The usual arithmetic rules hold. The multiplication and division have precedence over addition and subtraction. The parentheses have higher precedence. The integer literals are positive integers or zero. An assignment statement has a variable on the left side and an arithmetic expression on the right side of the assignment operator. The assignment operator is :- The assignment statement ends with a semicolon. A read statement has the read word followed by a list of variables within parentheses separated by commas. The read statement ends with a semicolon. A write statement has the write word followed by a list of variables within parentheses separated by commas. The write statement ends with a semicolon. A boolean expression consists of a left operand, a relational operator, and a right operand in that order. An operand is either a variable or an integer literal. The relational operators are , = ==, and ! - with their usual meanings. An if-else statement has the if word followed by a boolean expression within parenthesis peny followed by a sequence of statements within ( } block followed by the else word sibo followed by a sequence of statements within ) block. The { } block has at least one statement. The statements inside the block can be any of the five statement types. An if-else statement may have no else part. In that case, the if statement has the if word followed by a boolean expression within parenthesis ) followed by a sequence of statements within { } block. A program begins with the word main followed by a sequence of statements within block. The block has at least one statement. There are five types of statements. They are assignment statement, read statement, write statement, if-else statement, and while statement An identifier consists of lower or upper case letters and digits. An identifier begins with a letter. The identifiers are case sensitive. The following identifiers are considered reserved words with predefined meaning: main, read, write, if, else, while. An arithmetic expression consists of variables, integer literals, plus operator , minus operator multiplication operator *, division operator /, left parenthesis and right parenthesis ). The usual arithmetic rules hold. The multiplication and division have precedence over addition and subtraction. The parentheses have higher precedence. The integer literals are positive integers or zero. An assignment statement has a variable on the left side and an arithmetic expression on the right side of the assignment operator. The assignment operator is :- The assignment statement ends with a semicolon. A read statement has the read word followed by a list of variables within parentheses separated by commas. The read statement ends with a semicolon. A write statement has the write word followed by a list of variables within parentheses separated by commas. The write statement ends with a semicolon. A boolean expression consists of a left operand, a relational operator, and a right operand in that order. An operand is either a variable or an integer literal. The relational operators are , = ==, and ! - with their usual meanings. An if-else statement has the if word followed by a boolean expression within parenthesis peny followed by a sequence of statements within ( } block followed by the else word sibo followed by a sequence of statements within ) block. The { } block has at least one statement. The statements inside the block can be any of the five statement types. An if-else statement may have no else part. In that case, the if statement has the if word followed by a boolean expression within parenthesis ) followed by a sequence of statements within { } block

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

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions

Question

What is the difference between standard costs and budgeted costs?

Answered: 1 week ago

Question

Approaches to Managing Organizations

Answered: 1 week ago

Question

Communicating Organizational Culture

Answered: 1 week ago