Skip to content

yitao-li/compile_construction_course_project_spring_2012

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

** to compile optimally **

make clean
make


** to run on input files **

./parser < lexer_test.pas
./parser < test2.pas
./parser < test3.pas


** to examine output **

cat symtable.out (<-- this output is not used since each scope now has a symbol table)
cat rules.out


/*

   note:

    1. Conflicts: 1 shift/reduce, 1 reduce/reduce

    2. The current symbol table does not have any name-mangling features (perhaps to be added in the foreseeable future).

    3. The current version only checks for type mismatch in simple assignment operations (i.e. assignment in the form of "a := b") but does not check for
       type mismatch in assignment of the form "a := b + c" (since specific language-dependent rules are needed to determine the type of the right-hand side
       and the project would become too complicated if all those rules have to be included).

    4. Many other things such as division by 0 are not handled yet (not part of the project though)

    5. Assuming all for loop have step size +1, and also because the for ? = ? to ? in PASCAL already implies an increment, an instruction in the form of
       ? := ? + 1 will be automatically printed in the TAC)

    6. A test case that failed was component selections in the form of c.d[e]
    
*/

About

compiler for a Pascal-like language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published