Purchase Solution

Compilers and Language Translation: Token Identification

Not what you're looking for?

Ask Custom Question

1. Identify the tokens in each of the following statements.

a. if (a == b1) a = x + y;
b. delta = epilson + 1.23 - sqrt(zz);
c. print(Q);

2. Assume that we are looking in a programming language that allows underscore (_) in variable names. When a scanner sees a character string such as AB_CD, is it more likely to identify this string as the single five-character token AB_CD or as three separate tokens: AB, _, CD? Explain your answer.

Purchase this Solution

Solution Summary

Answer identifies the tokens in each of the given statements. It does not classify them as ID, NUMBER etc.

Solution Preview

1. Tokens are separated by comma below.

a. "if", "(", "a", "==", "b1", ")", "a", "=", "x", "+", "y", ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.