DOC PREVIEW
Columbia COMS W4115 - Google Earth Script Language Language Reference Manual

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

COMS W4115 Programming Languages and Translators Google Earth Script Language Language Reference Manual 10/18/2006 Carlos Icaza [email protected] Darrell Tang [email protected] Wei Chung Hsu [email protected]. Language Conventions 1 .1. Comments This is same as C/C++/Java comment format. We support 2 kinds of comments. First one is multi-lines comments that starts from “/*” and end at “*/”. Second one is single-line comment that start from “//” until the end of this line. 1.2. Identifiers (Variable, Function, and Object names) We use the identifiers to name variables, functions and objects. The identifier is a terminal in our grammar. The following is our identifier rule: letter: _|A|B|...|Z|a|...|z digit: 0|1|...|9 identifier: letter ( letter | digit )* 1 .3. Numbers A number could be an integer or floating point. It consists of digits and optional decimal point “.” as well as digits. In order to make our language simple, we don’t support exponent number now. number: (digit)+ (. (digit)+ )? 1 .4. Strings A string is a sequence of characters enclosed by double quotes. Basically, the character here means the 256 types of character in ASCII code. String: “ (character)* “ 1 .5. NULL GECL has NULL value which is same as C/C++. 1.6. Operators = % -- %= <= + || += == . - && -= > * ! *= < / ++ /= >= 1.7. Keywords IS string While false int Km m Nm mil polygon struct Coord Dist dir square If Break Return float else continue NULL Boolean for true circle Hexagon pentagon rectangle octagon semicircle perspective coord overlay lookat folder LOOKS_AT Print line feet1.8. Tokens to terminate or separate blocks { } ( ) , [ ] ; 2. Types/Objects In GECL, we use type followed by object name to allocate an object, and we process this object by this object name. There are several type keywords GECL support which is list in chapter 1.7. These objects can be allocated like a standard type (i.e.: object myObject; ), but require either the IS keyword or assignment operator to be defined. 2.1. dist Defines a length, that can be given in miles, meters, kilometers feet and nautical miles. Instantiated and manipulated like an int. 2.2. dir Defines a bearing in degrees. Used to create a new coord object by moving from another. 2.3. coord The basic geographic object from which all others are built. Defines latitude, longitude an elevation of a specific geographical point. 2.6. point Creates a basic ‘pop up’ point at a certain coord, with title, comments and URL for links or for loading photos. 2.5. Struct This is the most important type in GECL used to construct a 3D object which could be a building, a car or a polygon. 2.6. Place This is the type to allocate a placemark object. The placemark consists of several struct objects, overlays and so on, grouped so as to be related to perspective and folder objects 2.7 Overlay This is the type to allocate an overlay object so that we could specify the area we are going to look at with coordinates, photo URL and rotation. 2.8. PerspectiveThis type specifies where and how the viewer will look at a struct, coord, overlay, line and place object. 2.9. Folder This type collects place, struct, point, line and overlay objects under a single GoogleEarth ‘folder’ for easy navigation between them. The object names will become the titles for these objects inside the folder, except for point, which specifies its own title. 2.10. Line This is the type to allocate a line object. The reason to have this object is because we want to have some line mark in the Google Earth instead of using pure 3D objects. 2.11. Array GECL has array data type which is pretty similar to C/C++/Java array data type. However, in order to make our language easier to implement and use, we only provide bounded array allocation, such as int a[10], which will allocated in the compiling time. 3. Expression Our GECL is a language that consists of several expressions. The expression could be a list of integers, a boolean number, an identifier or a function call. The following is our expression grammar. expr : int-lit | bool-lit | identifier | identifier = expr | var post-op | expr bin-op expr | if expr then expr else expr end | ( expr ) bool-lit : T | F int-lit : ( digit )+ bin-op : arith-op | rel-op | bool-op arith-op : + | - | * | / | % rel-op : == | < | > bool-op : ^ | | post-op : ++ | -- | ~~4. Statements Semicolon “;” is a statement terminator in GECL. Basically, statements are executed in sequence except specified control-flow statements. Statements can separate into several categories listed below. statement: expression-statement compound-statement interation-statement conditional-statement 4.1 Expression statement expression-statement: expressionopt ; An expression becomes a statement when it is followed by a semicolon. 4.1.1 Assign statement assign-statement: primary-expression assignment-operator expression ; Asssign-statements are the majority of expression statements. Basically, these statements assign the right side expression’s final value to left side. For example: foo = bar + 10 ; 4.2 Compound statement compound-statement: {declaration-listopt statement-listopt}; declaration-list: declaration declaration-list declaration statement-list statement statement-list A compound statement is composed of declarations and statements by put them into a pair of brackets. The body of a function definition is a compound statement. 4.3 Iteration statement iteration-statement: for (expressionopt ; expressionopt ; expressionopt ) statement Iteration statements use to loop a statement or a block of statements several times. In this for-loop statement, three expressions seperated by semicolon are all optional. The first expression which must have arithmetic type is evaluated once, and thus gives the initial state for the loop. The second expression is evaluated before each iteration, and if it becomes eqaul to zero (false), the iteration is terminate. The third expression is evalated after each iteration and thus gives a new state for the loop. 4.3.1 Break statementbreak-statement: break; Break statement only happens inside an iteration statement. It terminates inner-most iteration statement and gives the control to the next statement that following the interation statement. 4.3.2


View Full Document

Columbia COMS W4115 - Google Earth Script Language Language Reference Manual

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Download Google Earth Script Language Language Reference Manual
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Google Earth Script Language Language Reference Manual and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Google Earth Script Language Language Reference Manual 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?