登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 外文翻译 > 计算机类 > 软件工程 > 正文

编译程序在线评测辅助教学系统的设计与实现外文翻译资料

 2021-12-17 22:36:28  

英语原文共 5 页


目录

一、英文翻译原文 2

Introduction 2

The Course Outline 3

Conclusion 9

二、英文文献翻译 11

一.介绍 11

二.课程大纲 12

三.结论 15

一、英文翻译原文

Learning Compiler Construction by Examples

Jose de Oliveira Guimaraes

Departamento de Computacao-UFSCar

Sao Carlos- SP, 13565-905

Brazil

Email: jose@dc.ufscar.br

Abstract: In traditional compiler construction courses, each compiler phase is studied in detail before moving on to the next one. This not only places a great distance between theory and practice but also makes the students lose the big picture of the subject. We have been employing a different course format in which the subject is incrementally introduced through ten compilers of increasingly complexity. The first compiler is in fact just a syntax analyzer of a very simple language. The last one is a complete compiler of a Pascal-like language. Students of this course learn how to build compilers faster than the usual.

Key-Words: compiler construction, learning by examples, object-oriented programming.

Introduction

Students usually consider difficult courses on compiler construction. The reasons are that compiler construction demands a heavy dose of programming and theory. A compiler operates in phases, each one with its particularities, algorithms, techniques, and tricks of the trade. The phases are lexical analysis, syntax analysis (parsing), semantic analysis, code generation, and code optimization [5]. The last phase is not usually studied in the undergraduate courses of our university.

A compiler takes a program writ ten in a source language S and produces as output another program in a target language. The lexical analyzer takes characters of the input, in language S, and groups them in what we call tokens. Each language terminal is a token, which is associated to an integer constant. The syntax analyzer (parser) takes the tokens as input and checks if the source program matches the S grammar. The parser may build an abstract syntax tree (AST) of the source program. An AST is a data structure representing all the main elements of the input. It has all the important information present in the source program. The source program may have errors not detected by the parser such as 'variable not declared' and 'left and right-hand sides of the assignment have incompatible types'. The semantic analysis is responsible for this kind of checking. In general, the semantic analyzer is composed by a myriad of pieces of code spread in the parser. The code optimizer changes the AST or some intermediary program representation produced by the parser in order to make the output program faster or smaller. The code generator is responsible for generating code in the target language.

Traditional compiler construction courses present most or even all aspects of every compilation phase before moving on to the next one. As a consequence, students feel lost in details, losing the big compiler picture. Only at the middle or at the end of the course that a complete compiler emerges? sometimes a complete compiler is never presented. Students usually ask the question 'why am I learning this?'. Since they do not know the whole, they do not understand why the parts are necessary.

This article presents the details of a different compiler construction course which has been taught every year since 2002 at the Computer Science Department of the Federal University of Satilde;o Carlos, Brazil. The subject is introduced through examples of increasing complexity, starting with a very simple expression grammar and finishing with a complete compiler of a language similar to Pascal. The next section explains how these examples are presented to the students. The last section concludes.

The Course Outline

The compiler construction course is taught in one semester with sixteen weeks, three of which are reserved for examinations. There are four consecutive 50-minutes classes a week. Most of the students are in the fifth (Computer Science) or seventh (Computing Engineering) semester of their courses. Now that we described the context, the course outline can be presented.

The course is divided in two parts, each one eight- weeks long. The first one is very practical. We teach how to build compilers without worrying in proving why the techniques present ted work. In the second part, we teach the theory behind compiler construction. This inversion is made on purpose. The objective is to introduce the subject as fast as possible to enable students to build a simple compiler in the first month. Students do not miss the theory since it is intuitively clear that the parsing method used, recursive descendent parsing, works.

The first course e part uses ten compilers made using recursive descendent analysis and five compilers made using CUP/ Lex [1] [8]. The first ten compilers were made in Java without the help of any tool. All of the compilers [6] and a manual [7] explaining them are available to the students. In the first day of the course, in four 50-minutes classes, the following topics are seen:

  • the definition of a compiler;
  • the compiler cousins: where compiler techniques may be employed;
  • the phases of a compiler (lexical analysis, s

    资料编号:[4661]

您需要先支付 20元 才能查看全部内容!立即支付

微信号:bysjorg

Copyright © 2010-2022 毕业论文网 站点地图