Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter...

35
Z. Zhu, S. Ordonez, C. Kasten, May 20003
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    0

Transcript of Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter...

Page 1: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Z. Zhu, S. Ordonez, C. Kasten, May 20003

Page 2: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Language Overview

• jGTL is a high-level interpreter language.

• Basic Language functions are implemented in jGTL like in C.

• jGTL is focus on 3D graphic transformations, such as object scaling, translation, rotation, and projection.

Page 3: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Major Features • Simple

Simple syntax (similar to Java and C) and transformation functions.

• Intuitive An intuitive approach to 3D graphic definition and

manipulation.

• Friendly Programming Graphical IDE makes coding in jGTL easy and convenient

for error checking. • Object-Oriented Each defined point, matrix, and group of points is

represented by an object.

Page 4: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Why jGTL?

The graphics libraries of most popular languages, such as Borland C++ and Java, are very large and complex.

Graphic definitions using Java 3D is complicated and verbose.

OpenGL Utility Library (GLU) provides about 150 distinct commands to specify the objects and operations

Page 5: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Why jGTL?

It is good for the user without much computer programming experience and graphical knowledge to learn and create complex 3D graphical objects.

With this object-oriented language and its graphic development environment, users can control the geometrical transformation of 3D objects easily and quickly.

The jGTL language provides a powerful and simple approach to 3D graphics programming.

Page 6: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 7: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

jGTL Grammar----What this language can do?

BASIC + Graphics

Page 8: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Data Flow Control –if-else

If [n1<0 ] then {n2=n2+n1; n3=n2+2;} else {n3=0;}

Java-like

Page 9: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Iteration—for-loop

for(n1=1; [n1<10]; n1=n1+1) { n_f=n_f*n1; }

Java-like

Page 10: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

System Commands

Text output:$JprintLine( )$JprintList ( )

Graphic output:$JdrawPoint( )$JdrawLine( )$JdrawConfig( )

Page 11: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Language Components and Interfaces

Page 12: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Code Structure—IDE

Page 13: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Design Features

• Graphic interface IDE

Page 14: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Design Features

• Graphic output and Text output

Page 15: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Design Features

• Simultaneous help document checking

Page 16: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Design Features

• Object-oriented Language

• Compile error report and handle

Page 17: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Applications--Sphere Ring

/*********Draw Double Courves*********/for(ni=-n_max_x; [ni<=(n_max_x+0.05)]; ni=ni+0.05){ n_para=sin(ni*3.1416/n_max_x); n_z = n_max_z*n_para; n_y= n_max_y*n_para; n_cr= 0.5+0.5*n_para; n_cg=0.5+0.5*sin( (ni/n_max_x+1/3)*3.1416); n_cb=0.5+0.5*sin( (ni/n_max_x+2/3)*3.1416);  p1={ni, n_y, -n_z}; p2={-ni, n_y, n_z}; $JdrawPoint(p1, 0.0, n_cg, n_cb, n_r); $JdrawPoint(p2, n_cr, 0.0, n_cb, n_r);}

Page 18: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 19: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Applications--Colorful Circle

for(ni=5; [ni<=360]; ni=ni+5) { p21:JRotate(ni, 1.0, 0.0, 0.0)->pt1; n_cr= 0.5+0.5*sin(3.1416*(ni/180+2/3)); n_cg= 0.5+0.5*sin(3.1416*ni/180); n_cb=0.5+0.5*sin(3.1416*(ni/180+1/3)); $JdrawPoint(pt1, n_cr, n_cg, n_cb, 0.06); $JdrawLine(p0, pt1, n_cr, n_cg, n_cb, 0.04); }

Page 20: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 21: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 22: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Applications--Body Center Structure –NaCl

//Initial B type Points g2= < > ;n0=-n_bond+n_bond/2;for(ni=n0; [ni<=n_bond]; ni=ni+n_bond){ for(nj=n0; [nj<=n_bond]; nj=nj+n_bond){ for(nk=n0; [nk<=n_bond];nk=nk+n_bond){ p_b1={ni, nk, nj}; g2:JAppend(p_b1)->g2; } }} //End of for

Page 23: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 24: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Applications--Face Center Structure – CsCl

Page 25: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Applications--S3 Space Group Structure –Silicon

/***Draw Lines in a lattice ***Double for loop***/g_total:JgetSize( )->n_total;$JprintLine(n_total);for(ni=0; [ni<n_total]; ni=ni+5) { g_total:JgetPoint(ni)->p_center; for(nj=ni+1; [nj<=(ni+4)]; nj=nj+1) { g_total:JgetPoint(nj)->ptemp; $JdrawLine(p_center, ptemp, 1.0, 0.0, 0.0, n_r2); } }//End

Page 26: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 27: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 28: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 29: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.
Page 30: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Application--Amino Acids –Aspartic acid

Page 31: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Application--Amino Acids –Aspartic acid-

Conformations

Page 32: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Application--Amino Acids –Aspartic acid---Backbone Rotomer

Page 33: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Software Process and Testing

Phase I: Lexer, Parser test 1

Phase II: Tree Walker test 2

Phase III: Point, Group, Matrix Tree Walker test 3

Phase IV: Graphic Interface test 4

Phase V: Overall Maintenance test 5- Regression Test

Page 34: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Lessons from jGTL Project

• Compiler Implementation

• Difficulties: Symbol Table, List Tree walker, Language standardization

• Error Handle

• Team Work

Page 35: Z. Zhu, S. Ordonez, C. Kasten, May 20003. Language Overview jGTL is a high-level interpreter language. Basic Language functions are implemented in jGTL.

Thank you!