Answered step by step
Verified Expert Solution
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
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 { } blockStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started