Font Size: a A A

Lalr (1) Grammar Analyzer Automatic Generating System Design And Implementation

Posted on:2013-09-07Degree:MasterType:Thesis
Country:ChinaCandidate:Y LiFull Text:PDF
GTID:2248330374985752Subject:Software engineering
Abstract/Summary:PDF Full Text Request
The compiler principles and techniques is one of the most important theories andalso techniques in computer science and technology. The compiler designing touchesupon formal methods,automata theory,syntax analysis technique and so on. Thosetheories and techniques are widely used in every domain of computer science andtechnology, such as compilers for a wide variety of programming languages, officeautomation software,database management systems and compilers for languages inspecial fields. Therefore study of compilers is not only of academic interest, but evenwith better engineering value.As one of the most complex compiler techniques, syntax analysis techniquespresently can be divided into two types of methods: top_down parsing and bottom_upparsing. And LALR(1) parsing that is one kind of bottom_up parsing, is widely used inpractice, because of the relaxation in the grammar rules, faster analysis speed,discovering errors accurately and other advantages. But it’s not easy to construct aLALR(1) parser, because the LALR(1) parsing tables are too large to be obtainedmanually. Consequently, there is a need for a LALR(1) parser generator, by using it,user only needs to define the grammar rules of target language,and then the source codeof the target syntax parser will be obtained.This paper finished a software of a LALR(1) parser generator system namedLRGS(LALR(1) Generation System) and the language named LRGL((LALR(1)Generation Language) supported by LRGS, which was based on the exploration ofLALR(1) parser generator techniques, developed on Visual Studio2008platform andby C#language. LRGS provides IDE (Integrated Development Environment), userobtains the C++source code of target syntax parser by a sequence of steps that isbuilding a new project, writing a LRGL source program, compiling the source program.If there are errors in the source program, user can see the causes of errors in LRGSinterface. And user also can debug the syntax parser easily by checking the parsingtables and the collection of sets of LALR(1) items in the interface. In summation,applying LRGS in the process of compiler development will greatly reduce the difficulty in and improve the efficiency of the development, increase the product quality.
Keywords/Search Tags:LALR(1), syntax parser, parsing tables, generator, YACC, LEMON
PDF Full Text Request
Related items