APT Language Structure
The APT language was originally developed in the line of the FORTRAN computer language which was the most common language used by scientists in early 1950s. It consists of series of statements that utilize a syntax similar to FORTRAN language using a number of keywords formed similar to their English equivalents. For example, the vocabulary word CIRCLE means a definition for a circle geometry. Some of the vocabulary words that we will be using in this course for developing the programs are given below with a simple explanation. They will be further expanded later.
Geometry
ARC : Circular pattern for multiple point definition
ATANGL : At an angle of measured from positive X-axis direction
CANON : Canonical information for geometry
CCLW : Counter clockwise direction
CENTER : Center of a circle
CIRCLE : Geometry definition of a circle
CLW : Clockwise direction
DECR : Decrementing the numbering
ELLIPS : Ellipse geometry definition
GCONIC : General conic geometry definition
HYPERB : Hyperbola geometry definition
IN : Inside as a modifier used with geometry definition
INCR : Incrementing the numbering
INTOF : Intersection of two curves
LARGE : A circle with larger radius
LEFT : Geometry to be seen towards the left as a geometry modifier
LINE : Geometry definition of a Line
LINEAR : Linear pattern for multiple point definition
MATRIX : Geometry definition of a matrix transformation of geometry
MIRROR : Geometric transformation modifier
OUT : Outside as a modifier used with geometry definition
PARLEL : Parallel to as a modifier used with geometry definition
PATERN : Geometry definition of a pattern for multiple points
PLANE : Geometry definition of a plane surface
POINT : Geometry definition of a point used for drilling operations
RADIUS : Radius of a given circle
RANDOM : Random pattern for multiple point definition without any known symmetry
RIGHT : Geometry to be seen towards the right as a geometry modifier
RTHETA : For polar coordinates with radius first followed by angle
SMALL : A circle with smaller radius
TANTO : Tangent to
THETAR : For polar coordinates with angle first followed by radius
THRU : Through as a modifier used in pattern definitions to specify the point numbers.
TRANSL : Geometric transformation modifier for translation
VECTOR : Geometry definition of a vector
XAXIS : X-axis to be used as a line
XCOORD : X-coordinate value
XLARGE : The point with larger X-coordinate value
XSMALL : The point with smaller X-coordinate value
XYPLAN : XY plane used with polar coordinates
XYROT : Rotation about the Z-axis (in X-Y plane)
YAXIS : Y-axis to be used as a line
YCOORD : Y-coordinate value
YLARGE : The point with larger Y-coordinate value
YSMALL : The point with smaller Y-coordinate value
YZPLAN : YZ plane used with polar coordinates
ZSURF : Z surface as a plane having the same Z-coordinate value for all points
ZXPLAN : ZX plane used with polar coordinates
Some of the above are termed as Major words that actually describe a class of geometry definition. Examples are Point, Line, Circle, Matrix, etc. The others are called as minor words that could be used to classify a major word to come to the exact definition. These are normally used to classify the data being supplied for a given geometry definition. For example, to define a line as parallel to another line already defined as follows:
LIN3 = LINE / PNT1, PARLEL, LIN2
LIN3 is a new line that is passing through an already defined point PNT1 and parallel to another already defined line LIN2.
The syntax of statements as used can be noticed from the above statement. The geometric elements can be given with identification symbols, which can be formed by the programmer up to a maximum of six characters. They can be formed using English alphabets and numerals with the starting always an alphabet. They should not be same as the vocabulary words.
A slash is used to divide a statement into two sections. To the left of the slash are the MAJOR words, and to the right are the words, symbols and/or scalars that modify the word on the left of the slash so as to give it a complete and precise meaning or definition, e.g. CIRCLE / CENTER, PNT3, RADIUS, 20. A comma is used as a separator between the elements in a statement generally to the right of the slash. An equals sign is used for assigning an entity to a symbolic name.
In addition to the geometry statements an APT program consists of motion, postprocessor and compilation control statements.