Question

Research to write down the rule of a variable identifier in the following programming languages and write down the regular grammar for that rule. For example, as elaborated in the class, the rule of a variable identifier in C is start either by_, or any alphabetic character, and then follow either by_, any alphabetic character, or number, and its regular grammar is: La-zA-Z][a-zA-ZO-9]* a. JavaScript i. Rule: ii. Regular grammar b. PHP i. Rule: ii. Regular grammar: c. Python i. Rule: li. Regular grammar: d. GoLang i. Rule: ii. Regular grammar:

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a. Javascript

Rule - variables first character must be a letter, or an underscore (_), or a dollar sign ($).

Regular Grammar - [ _ $ a-z A-Z ][a-z A-Z 0-9]

b. Php

Rule - it include letters, numbers, underscore characters, and other ASCII characters from 127 through 255

Regular Grammar - [ _ a-z A-Z ][a-z A-Z 0-9]

c. Python

Rule - varible starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores and digits (0 to 9).

Regular Grammar - [ _ a-z A-Z ][a-z A-Z 0-9]

d. GoLang -

Rule - variables starts with a letter A to Z or a to z , underscores in between or digits (0 to 9).

Regular Grammar - [ a-z A-Z _ ][a-z A-Z 0-9]

Add a comment
Know the answer?
Add Answer to:
Research to write down the rule of a variable identifier in the following programming languages and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Research to write down the rule of a variable identifier in the following programming languages...

    2. Research to write down the rule of a variable identifier in the following programming languages and write down the regular grammar for that rule. For example, as elaborated in the class, the rule of a variable identifier in C is "start either by or any alphabetic character, and then follow either by_, any alphabetic character, or number", and its regular grammar is: [_a-zA-2] [a-zA-ZO-9]* a. JavaScript i. (5 points) Rule: Solution: ii. (5 points) Regu grammar: Solution: b. PHP...

  • C programming is the main one and pick another code of choice!!! Background This assignment is...

    C programming is the main one and pick another code of choice!!! Background This assignment is based on one of the Big Ideas in this course, namely that reading C source code is a real aid in learning how to write C code. To that end, in this project, you write a program that scans C source from the 'Net and calculates some simple statistics. We're learning lots of concepts, and by running the program you write here on several...

  • As mentioned in Assignment 5. Prolog can be used to solve problems that are quite difficult with other programming languages.This is mainly because of the declarative nature of the languages....

    As mentioned in Assignment 5. Prolog can be used to solve problems that are quite difficult with other programming languages.This is mainly because of the declarative nature of the languages. What kind of difficulties do you think there will be if you are asked to write a program in another language fe.g. Python) to solve the puzzle in Assignment 5 L Introduction Prolog Is a language that Is sultable for solvins problems in the fleld of artifical Intelligence. That is,...

  • Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of...

    Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of physician-centered and collaborative communication. How is the caregiver’s role different in each model? How is the patient’s role different? Answer: Physical-centered communication involves the specialists taking control of the conversation. They decide on the topics of discussion and when to end the process. The patient responds to the issues raised by the caregiver and acts accordingly. On the other hand, Collaborative communication involves a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT