This project must be developed in teams of up to three members. Using C#, you must implement the different compiler phases for a subset of Fortran 77, exactly as described in the provided “Fortran 77 Tutorial”. Each phase will be evaluated using the following grading criteria:
Concept | % |
---|---|
Phase implementation | 80% |
Version control usage | 20% |
Each team member must create a Bitbucket account. The team leader must create a new repository for the project with these characteristics:
Afterwards, the team leader must send invitations to the other team members (and also to ariel.ortiz@itesm.mx) so that they can all join the repo. Make sure that all members have write privileges.
All team members are expected to clone the Git repository and to commit and push frequently all code contributions to the project.
Source file | Description | Date added |
---|---|---|
hello.f | The world famous "Hello World!" program. | 31-Aug-2016 |
largest.f | Find the largest of several positive numbers contained in an array. | 31-Aug-2016 |
fizzbuzz.f | Solves the classical fizzbuzz programming puzzle. | 31-Aug-2016 |
pi.f | Computes pi through numerical integration. | 31-Aug-2016 |
matrix.f | Simple big matrix manipulation example. | 31-Aug-2016 |
factorials.f | Computes and prints the factorials of numbers from 0 to 10 using iteration and recursion. | 31-Aug-2016 |
stats.f | Computes the average and standard deviation of 200 positive integer numbers. | 31-Aug-2016 |
cramer.f | Uses Cramer's rule to solve a system of 3 linear equations with 3 unknows. | 31-Aug-2016 |
callex.f | Demonstrates the call-by-reference mechanism. | 26-Oct-2016 |
taylor.f | Computes Taylor polynomials. | 02-Nov-2016 |
intrinsics.f | Using mathematical intrinsic functions. | 16-Nov-2016 |
program
, function
, or subroutine
) must be unique.
program
, function
, or subroutine
).
+
and &
) must appear only in column 6.
program
, function
, or subroutine
)
parameter
statement must have been previously defined and its type must be compatible with the value being assigned to.
parameter
statement cannot be used in the left-hand side of an assignment statement because it represents a constant.
parameter
statement.
parameter
statement(s) must come before the first executable statement.
+
, -
, *
, /
, **
. If both operands are integers, the result must be an integer. If at least one operand is real, the result must be real.
-
operator must take a numeric (integer or real) operand. If the operand is an integer, the result must be an integer. If the operand is a real number, the result must also be real.
.lt.
, .le.
, .gt.
, .ge.
, .eq.
, and .ne.
. The result must always be a logical (boolean) value.
.and.
and .or.
. The .not.
operator must only takes one logical operand. These three operators must return a logical (boolean) value.
if
statement (and also in an if else
statement), its expression must evaluate to a logical (boolean) value.
goto
statement, the target label must be inside the same programming unit (program
, function
, or subroutine
).
do
statement, the target label must be inside the same programming unit (program
, function
, or subroutine
). The loop control variable must be previously declared as integer. The initial and terminating values must be of type integer. The optional increment must also be of type integer.
Nested do
statements must have their labels correctly placed.
For example, this is OK:
do 10 i = 1, 5 do 20 j = 1, 3 write(*, *) i, j 20 continue 10 continue
But this is not:
do 10 i = 1, 5 do 20 j = 1, 3 write(*, *) i, j 10 continue 20 continue
parameter
statement. Arrays can only have one or two dimensions.
abs
, sqrt
, sin
, cos
, tan
, atan
, exp
, and log
. The following instrinsic functions must take two numeric arguments (whatever combination of real or integer) and return a real: min
and max
.
function
or subroutine
, all their parameters must be properly declared.
function
has to be type compatible with the declared function type.
call
statement can only be used for declared subroutine
s. The number and types of the arguments must match those of the subroutine declaration.
common
statement must appear together with the variable declarations, before the executable statements. Different common
blocks must have different names (just like variables). A variable cannot belong to more than one common
block. The variables in a common block do not need to have the same names each place they occur, but they must be listed in the same order and have the same type and size.
data
statement must match the variables being initialized.
Phase | Date | Description | Exemplar |
---|---|---|---|
1 | 07-Sep-2016 | Lexical analysis. | buttercup-0.1.tgz |
2 | 12-Oct-2016 | Syntactic analysis. | buttercup-0.2.tgz |
3 | 26-Oct-2016 | AST construction. | buttercup-0.3.tgz |
4 | 09-Nov-2016 | Semantic analysis. | buttercup-0.4.tgz |
5 | 25-Nov-2016 | CIL code generation. | buttercup-0.5.tgz |
All your code should be in the Bitbucket repo, so nothing else needs to be delivered.