Font Size: a A A

Research And Implementation Of C-alike Teaching Language For Compiler Principles

Posted on:2008-04-27Degree:MasterType:Thesis
Country:ChinaCandidate:Y L GaoFull Text:PDF
GTID:2178360242472551Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Based on the current state of the teaching affairs of "compiler principles",the purpose of this research topic is defining a C-alike teaching language.This C-alike teaching language is similar to a subset of C,with the clear lexical and syntax definition, including the essential parts such as functions,pointers,arrays,more then one data types and so on required by a general high-level language.Moreover,the language is simple in functions,clear in structures and convenience for applications.Considering the needs on the course teaching of "compiler principles",and the nature of experiment and extensibility as a teaching language,the scale of it is moderate.By using a single pass structure,the compiler of the teaching language implements the basic processes for a compiler,including lexical analysis,syntax analysis,semantic analysis,target assembly codes generation,machine codes generation,symbol table management,and the interpretational execution of the machine codes,therefore,has the students establish a whole concept on the construction on compiler programs.The reasons to choose the research topic are the following.First,the most popular teaching language for compile principles,PL/O,is a subset of PASCAL,but the students nowadays are unfamiliar to PASCAL,Which will enlarged the difficulty on the study of compile principles.Second,compiler is a quite complex and extremely important procedure.Through the exploration of a C-alike compiler development program, students will be able to have a profound understanding to every part in compile procedure,which will reduce the difficulty on the study of compiler principles.Third, since C is a common used procedure oriented programming language,and the carriers of the most object oriented languages are procedure oriented,therefore,it will not be difficulty to implement the compiler program of an object oriented language by mastering the compiler techniques on a procedural language.Finally,the technology of designing a special-purpose interpreter program of a language virtual machine to execute the self-defined target codes mentioned above can guarantee the C-alike compiler's independency on the operating platforms and make the C -alike teaching language no longer a strategy on paper,but a true one.The results of this paper are the definition of a teaching language and the implementation of its compiling system.The compiling program of the language should reflect the basic contents of the course on "compiler principles" in order to be suitable for the students to learn,and therefore,it is undesirable by using too complex algorithms to strive purely for the running efficiency.The scale of the compiling program should be moderate for students to understand and further extend,and the key sections of the program should be annotated for students to learn easily.
Keywords/Search Tags:Compiler, Virtual machine, Self-defined target codes
PDF Full Text Request
Related items