Question

2. Research to write down the rule of a variable identifier in the following programming languages and write down the regular
C. Scheme i. (5 points) Rule: Solution: (5 points) Regular grammar: ii. Solution: d. GoLang i. (5 points) Rule: Solution: (5
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

a. JavaScript

Rule: Start either by_,$, or any alphabetic character, and then follow either by _,$ any alphabetic character or number

Regular grammer: [_$a-zA-Z] [_$a-zA-Z0-9]*

b. PHP

Rule: All php variables start with $. Their names start either by_, or any alphabetic character, and the follow either by _, any alphabetic character or number

Regular grammer: [$] [_a-zA-Z] [_a-zA-Z0-9]*

c. Scheme

Rule: Their names start with any of these characters ? ! * / < = > : $ % ^ & _ ~ or any alphabetic character, and the follow by any of ? ! . * / < = > : $ % ^ & _ ~ + - @, any alphabetic character or number

Regular grammer: [? ! * / < = > : $ % ^ & _ ~ a-zA-Z] [? ! . * / < = > : $ % ^ & _ ~ + - @a-zA-Z0-9]*

a. GoLang

Rule: Start either by_ or any alphabetic character, and then followed either by _, any alphabetic character or number

Regular grammer: [_a-zA-Z] [_a-zA-Z0-9]*

Add a comment
Know the answer?
Add Answer to:
2. Research to write down the rule of a variable identifier in the following programming languages...
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
  • Research to write down the rule of a variable identifier in the following programming languages and...

    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....

  • 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,...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Edit a C program based on the surface code(which is after the question's instruction.) that will...

    Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

  • Read the Article posted below, then answer the following questions: 1. As a junior member of...

    Read the Article posted below, then answer the following questions: 1. As a junior member of your company’s committee to explore new markets, you have received a memo from the chairperson telling you to be prepared at the next meeting to discuss key questions that need to be addressed if the company decides to look further into the possibility of marketing to the BOP segment. The ultimate goal of this meeting will be to establish a set of general guidelines...

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