Question: 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

design a scanner In c language using following rules yes, design a

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

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!