Главная » Все файлы » Просмотр файлов из архивов » PDF-файлы » A.W. Appel, J. Palsberg - Modern Compiler Implementation in Java (Second Edition)

A.W. Appel, J. Palsberg - Modern Compiler Implementation in Java (Second Edition), страница 2

Описание файла

PDF-файл из архива "A.W. Appel, J. Palsberg - Modern Compiler Implementation in Java (Second Edition)", который расположен в категории "книги и методические указания". Всё это находится в предмете "конструирование компиляторов" из седьмого семестра, которые можно найти в файловом архиве МГУ им. Ломоносова. Не смотря на прямую связь этого архива с МГУ им. Ломоносова, его также можно найти и в других разделах. .

Просмотр PDF-файла онлайн

Текст 2 страницы из PDF

38Chapter 3: Parsing .................................................................................................................... 41OVERVIEW......................................................................................................................... 413.1 CONTEXT-FREE GRAMMARS.................................................................................. 42DERIVATIONS ............................................................................................................... 43PARSE TREES ................................................................................................................

44AMBIGUOUS GRAMMARS ......................................................................................... 44END-OF-FILE MARKER ............................................................................................... 463.2 PREDICTIVE PARSING .............................................................................................. 47FIRST AND FOLLOW SETS ......................................................................................... 48CONSTRUCTING A PREDICTIVE PARSER............................................................... 51ELIMINATING LEFT RECURSION ............................................................................. 52LEFT FACTORING ........................................................................................................

53ERROR RECOVERY ...................................................................................................... 543.3 LR PARSING................................................................................................................. 55LR PARSING ENGINE...................................................................................................

57LR(0) PARSER GENERATION ..................................................................................... 58SLR PARSER GENERATION........................................................................................ 61LR(1) ITEMS; LR(1) PARSING TABLE ....................................................................... 62LALR(1) PARSING TABLES......................................................................................... 64HIERARCHY OF GRAMMAR CLASSES ....................................................................

65LR PARSING OF AMBIGUOUS GRAMMARS ........................................................... 653.4 USING PARSER GENERATORS ................................................................................ 664JAVACC .......................................................................................................................... 66SABLECC........................................................................................................................

68PRECEDENCE DIRECTIVES........................................................................................ 69SYNTAX VERSUS SEMANTICS.................................................................................. 723.5 ERROR RECOVERY .................................................................................................... 73RECOVERY USING THE ERROR SYMBOL .............................................................. 73GLOBAL ERROR REPAIR ............................................................................................ 75PROGRAM PARSING ........................................................................................................ 77FURTHER READING.........................................................................................................

77EXERCISES......................................................................................................................... 77Chapter 4: Abstract Syntax ...................................................................................................... 81OVERVIEW......................................................................................................................... 814.1 SEMANTIC ACTIONS ................................................................................................. 81RECURSIVE DESCENT.................................................................................................

81AUTOMATICALLY GENERATED PARSERS............................................................ 824.2 ABSTRACT PARSE TREES ........................................................................................ 83POSITIONS ..................................................................................................................... 854.3 VISITORS...................................................................................................................... 86ABSTRACT SYNTAX FOR MiniJava ...........................................................................

91PROGRAM ABSTRACT SYNTAX ................................................................................... 92FURTHER READING......................................................................................................... 92EXERCISES......................................................................................................................... 93Chapter 5: Semantic Analysis .................................................................................................. 94OVERVIEW.........................................................................................................................

945.1 SYMBOL TABLES ....................................................................................................... 94MULTIPLE SYMBOL TABLES .................................................................................... 95EFFICIENT IMPERATIVE SYMBOL TABLES........................................................... 96EFFICIENT FUNCTIONAL SYMBOL TABLES..........................................................

97SYMBOLS ....................................................................................................................... 985.2 TYPE-CHECKING MiniJava ...................................................................................... 100ERROR HANDLING .................................................................................................... 102PROGRAM TYPE-CHECKING .......................................................................................

103EXERCISES....................................................................................................................... 103Chapter 6: Activation Records ............................................................................................... 105OVERVIEW....................................................................................................................... 105HIGHER-ORDER FUNCTIONS ..................................................................................

1056.1 STACK FRAMES........................................................................................................ 106THE FRAME POINTER ............................................................................................... 108REGISTERS...................................................................................................................

108PARAMETER PASSING .............................................................................................. 109RETURN ADDRESSES ................................................................................................ 110FRAME-RESIDENT VARIABLES .............................................................................. 110STATIC LINKS ............................................................................................................. 1116.2 FRAMES IN THE MiniJava COMPILER................................................................... 112REPRESENTATION OF FRAME DESCRIPTIONS...................................................

114LOCAL VARIABLES ................................................................................................... 115TEMPORARIES AND LABELS .................................................................................. 116MANAGING STATIC LINKS......................................................................................

117PROGRAM FRAMES ....................................................................................................... 117FURTHER READING....................................................................................................... 118EXERCISES....................................................................................................................... 118Chapter 7: Translation to Intermediate Code ......................................................................... 121OVERVIEW....................................................................................................................... 12157.1 INTERMEDIATE REPRESENTATION TREES .......................................................

Свежие статьи
Популярно сейчас