下载此文档

Java Programming - UNLV:java编程-拉斯维加斯.ppt


文档分类:IT计算机 | 页数:约21页 举报非法文档有奖
1/21
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/21 下载此文档
文档列表 文档介绍
Introduction to Java ? Developed at Sun Microsystems by James Gosling in 1991 ? Object Oriented ? Free ? Compiled and Interpreted (Hybrid) ? Current version is Types of Languages ? 2 different dimensions for classification ? Programming paradigm ? Compiled or interpreted (or hybrid) Compiled Languages (Simplified) int a := 100; while (a > 0) { a := a – 1; } Source code (program) written in a source language. Compiler Performs checks on the program like - are variable names defined? - are they the right type? - are functions used correctly? - etc etc. Produces output - bytecode - binary executable ld length,% %r1,-1,%r1 %r1,%r2,%r4 …. Compiler output. the source program translated (compiled) to a target language. Compiled Languages (Simplified) ? piler ? Translates (compiles) a program written in a source language to a program written in a target language. ? Performs a number of checks (syntactically and semantically) on the code to assure that the translated code is ‘ correct ’. The Inside of piler Scanning Parsing Name resolution Type checking Intermediate code generation Optimization Code generation Typical stages of piler Scanning ? A scanner reads the input (source program) and creates a stream of tokens. int a := 100; while (a > 0) { a := a – 1; } Scanner [INT, int], [ID, a], [COEQ, :=], [INTLIT, 100], [WHILE, while], [LPAREN, (], …. Token Stream Token type Actual scanned text Parsing ? A parser reads a token stream and produces a parse-tree (if the program is syntactically correct) [INT, int], [ID, a], [COEQ, :=], [INTLIT, 100], [WHILE, while], [LPAREN, (], …. Scanner :=a a while 100 := >0a a+1 Parse-tree (simplified) int Syntax ? The syntax of a language describes which programs are correct in the sense that the textual representation follows the rules of the language. int a := 100; while (a > 0) { a := a – 1; }? int a := 100; while (a > 0) { a ( > a – 1; }? int a := 100; while (a > 0) { a := a + “ Hello ”;}?

Java Programming - UNLV:java编程-拉斯维加斯 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数21
  • 收藏数0 收藏
  • 顶次数0
  • 上传人薄荷牛奶
  • 文件大小0 KB
  • 时间2016-04-19