Software for Translators Barcelona, January 2002.
-
Upload
marvin-ford -
Category
Documents
-
view
216 -
download
1
Transcript of Software for Translators Barcelona, January 2002.
Content
Programming and Languages Origins 4 Languages
The Programming Cylcle Edit Compile Execute
Exercises: Java Programming
Language Elements
The old days (1970)
ComputerMemory
A
C
B
D
E F
„Registers“
ProgramCounter
00010203040506070809101112
..
2 B
ld A, 101 PC
1 A
ld B, 202 PC
2 B
add A,B03 PC
3 A
Programming Languages
Historic PL/1 Cobol Fortran Basic
Object Oriented Smalltalk C C++ Java Python
Exotic Prolog Lisp
Scripting Shell Perl TCL
Database SQL dBase
Visual Basic Example
'###############################################'# # # #'# # This program places a text into a # #'# # a text box for viewing. # #'# # # #'###############################################
Dim i As Integer
Private Sub Command1_Click() On Error Resume Next CommonDialog1.ShowOpen i = FreeFile Open CommonDialog1.filename For Input As #i Text1.Text = Input(LOF(i), i) Close #iEnd Sub
Java Example
// This example is from Java in a Nutshell.// Copyright (c) 1997 by David Flanagan public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } }
=> Hello World
Language Elements
Comments // Comment /* Comment */ % Comment
Keywords: FOR NEXT WHILE DOI F
Strings: “Hello World” ´Hello World´ ‘Hello World’
Identifiers: ClassName x, y, z
Parenthesis: (foo bar) [foo bar] {foo bar}
Comments
// This example is from Java in a Nutshell.// Copyright (c) 1997 by David Flanagan public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } }
Keywords
// This example is from Java in a Nutshell.// Copyright (c) 1997 by David Flanagan public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } }
Strings
// This example is from Java in a Nutshell.// Copyright (c) 1997 by David Flanagan public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } }