ECE 209 / CSCI 255 Assignment 7A

This is not a full assignment. It's one-half of one.

Due date

This assignment must be submitted as a single file named RLparse.c for Assignment 7A of the CSCI 255 section on UNCA moodle by 11:45 PM on 24 November.

Your program should be written in standard ANSI C.

Getting started

Read the RL Assignment overview to get the "big picture" about this series of tasks. Disclosure: Another of my classes this term is working on parts of this assignment.

Your task

Modification A is performed in the parseRL function within RLparse.c. If you look at that file, you will find a rather long comment:

            /* RL Modification A:
             * valTar, valOp1, and valOp2 are loaded with the token values
             * and T3, T4, and T5 are loaded with the token types needed
             * to fill in the fields of present.
             * Your task is to write the code to fill in this fields.
             * Use strncpy to copy the variables.
             * Use atof to convert strings to constant values.
             * Twenty lines of code were deleted here.
             * This code contained three if-then-else statements.

Your task is to complete the job described in the comments.


You can already run the C program, it just doesn't print out any variable names or values. Theoretically are four fields of the assignment you need to complete; however, in practice you have to complete six fields of the C assignment structure because of the union.

Don't try to complete all six at once. Complete one field and then move on to the others.