Explore BrainMass

Explore BrainMass

    Compiler Theory

    Compiler theory deals with the concept of a compiler for programming languages. The topic has heavy ties to linguistics because of the nature of compilers. A compiler is what translates the high-level code of the programmer into the machines particular object code. Compilers are very difficult to write and develop, but the best ones will not only translate, but also optimize the resulting object code. The compilers will generate object code based off the syntax, semantics and grammar of the programming language, which is where the tie to linguistics comes in.

    The compiler works in two phases. First, it does a lexical analysis of the source code, and organizes the code into groupings called Lexemes. These groupings are organized by their token class, such as Integer, or String, or Loop. Once the lexemes are created, the compiler will then analyze the syntax and grammar to determine the functional aspect of the code. When this step is done, the program is converted into Object Code, and can be run on the architecture it was compiled for. When optimizing, the compiler will generally do the optimization directly after the syntax analysis.

    Steps in compiling sourcecode to final code [ Image credit: Pau Gay ]

    Most modern compilers will also handle the linking and loading of files. When a compiler detects that a program requires external libraries to run, it will automatically prepend a compiled version of whatever is being used to the compiled product, as long as it exists on the system, and it does so fully recursively.


    © BrainMass Inc. brainmass.com January 18, 2021, 11:34 am ad1c9bdddf

    BrainMass Solutions Available for Instant Download

    Computer Science: Fork Function

    Write a C program that takes an integer argument from the command line and outputs the sum of all digits of the integer. For example, the result of the invocation sum of digits 12345 should be 15. The program has two constraints: 1) Each process can do at most one addition. If you want to calculate the sum of more than two

    notion IT professionals need to be both managed & motivated

    "There is a notion IT professionals need to be both managed and motivated differently. The attitudes, beliefs, and behaviors of IT professional all indicate that managing them successfully may differ" I agree and have found this to be true. But what is it that makes it different? Managing the Software Enterprise is Diff

    Write a program for an automatic teller machine that dispenses money

    Write a program for an automatic teller machine that dispenses money. The user should enter the amount desired (a multiple of ten dollars) and the machine dispenses this amount using the least number of bills. The bills dispensed are 50s, 20s, and 10s. Write a function that determines how many of each kind of bill to dispense.

    Compiler Theory in JAVA

    Write a JAVA application that prints the following table using the sqrt ( ) method in the Math class. Use a for loop to produce the output results. Compile and run your program until it works and the output looks nice Number SquareRoot 0 0.0000 2 1.4142 4 2.0000 6 2.4495 8

    Computer Science: Interpreter, Complier, and Operators

    1. What is the difference between an interpreter and a compiler? 2. What are some languages that use an interpreter? 3. What are some languages that use a compiler? 4. What does uncertainty mean? 5. How does uncertainty affect computer programs and databases when it occurs? 6. What is an example of an instance where you

    Requirements Analysis, Design, Verification & Validation

    ?Complete requirements analysis ?Design ?Verification ?Validation and test documentation The Currency Conversion application is a menu-driven program that allows users to select one of five international currency types, input the amount of a foreign currency, and then convert the foreign currency to dollars. The program di

    Organizing function of management: Anheuser-Busch InBev

    Can you help me with this assignment? Having trouble finding information on physical assets. Evaluate the organizing function of management as it relates to at least two of the following organizational resources: a. Physical assets b. Monetary c. Human resources d. Knowledge e. Technology Discuss whether or not Anheus

    Compiler Theory

    What is the difference between top-down and bottom-up parsing? What are the benefits of the two when developing a compiler? What are the disadvantages?

    C - Grocery Checkout

    C program: Grocery Checkout total. Implement the pseudocode developed in Week 2. Insert meaningful comments at least once for every few lines of the program. Please do not use loops or arrays.

    C++ Program to Assign Grades

    At Enlightened State University, students receive grades of Honors, Pass, or Fail rather than the usual letter grade. The function grade returns H, P, F depending on whether avg merits a grade of Honors (at least 92), Pass (at least 65, but less than 92), or Fail (less than 65). Write C++ statements that define the function grad

    int fun(int *k) Results Explanation

    Need help with Programming question. Run the code given in Problem on some system that support C to determine the value of sum1 and sum2. Explain the results. Let the function fun be defined as int fun(int *k) { *k += 4; Return 3 * (*k) - 1; }

    FOR loop and CONTINUE statement

    ****This needs to be in "C"**** Test the effect of a continue statement in the body of a for loop what is printed? for (putchar('1'); putchar('2'); putchar('3')) { putchar('4'); continue; putchar('5'); } ****This needs to be in "C"****

    Maslow's Hierarchy of Needs into the Workplace

    1. In 1800 words explain how Maslow's Hierarchy of Needs applies to professional work dynamics. 2. Describe how the theory designates the team member roles and responsibilities. 3. Explain how participation, leadership, and motivational skills would be demonstrated according to this theory. 4. Also describe how the theor

    Rabies vaccinations

    Why were the older types of rabies vaccinations required to be given via intraperitoneal injection, rather than other forms of injection (IV, IM)?