You are here:   ArielOrtiz.com > Compilers > The BASIC Compiler Project

The BASIC Compiler Project

Phase Date Description Upload link
1 25-Oct-2012 Lexical analysis, syntactic analysis, AST construction. SETA
2 08-Nov-2012 Semantic analysis. SETA
3 25-Nov-2012 CIL code generation. SETA

Source code examples

Source file Description Date added
hello.bas Prints "HELLO WORLD!" in the screen. 15-Nov-2012
largest.bas Find the largest of several numbers using READ/DATA. 15-Nov-2012
funs.bas Test BASIC standard functions and user defined functions. 15-Nov-2012
stats.bas Computes the average and standard deviation of 200 random numbers. 15-Nov-2012
steps.bas Test the use of STEP in a FOR statement. 15-Nov-2012
Updated 16-Nov-2012
fizzbuzz.bas This program prints the numbers from 1 to 100, but for multiples of three it prints "FIZZ" instead of the number and for the multiples of five it prints "BUZZ". For numbers which are multiples of both three and five it prints "FIZZBUZZ". See the Fizz Buzz Test. 15-Nov-2012
equations.bas Solves two simultaneous linear equations with two unknowns. Taken from the BASIC manual, p. 3. 25-Oct-2012
Updated 15-Nov-2012
sales.bas This program computes the total sales for each of five salesmen selling three different goods. The list P gives the price of the three goods. The table S gives the individual item sales of the five salesmen, where the rows stand for the items and the columns for the salesmen. Taken from the BASIC manual, p. 37. 25-Oct-2012
recfact.bas Prints the factorials of numbers from 0 to 20. Factorials are computed using a recursive subroutine (OMG!). 15-Nov-2012
matrix.bas Simple big matrix manipulation example. 15-Nov-2012