DOC PREVIEW
Columbia COMS W4115 - TASL - TRAVEL ASSIST SCRIPTING LANGUAGE

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

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 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 10 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 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

TRAVEL ASSIST SCRIPTING LANGUAGE (TASL)Language Reference ManualYogi Saxena ([email protected])1 IntroductionThere are several websites that offer a web based interface to get quotes for air fare, accommodation and other services such as rental cars. The user is required to enter several pieces information related to his/her travel plans such as dates, destination and quantity. This information is not stored and the user is required to re enter when he starts a new search. Most of the users are looking for the cheapest fare for their travel. This may require multiple searches with a combination of different dates and/or destinations. The TASL language attempts to provide a simple scripting language that would make it easier for the travelers to do their search. The user input will be stored and used for periodic searches carried out at a pre-defined interval. If the results of the search match the user defined criteria then the results could be stored in a file and/or the user could be alerted via email.2 Lexemes2.1 IdentifiersIdentifiers refer to or identify function names, data objects, class names etc. They consist of a string of characters such as one or more uppercase or lower case alphabets and numbers. The first character of an identifier must start with an alphabet. Upper case and lower case letters are treated differently. Keywords are reserved identifiers and cannot be re defined.2.2 KeywordsThe following reserved identifiers are used as keywords:boolean int void ifelse function while breakreturn search repeat emailfor float modify deletereserve2.3 NumbersA number is a string of digits and a decimal point. The types of Numbers supported in thelanguage are Integer and float. An Integer consists of a sequence of digits. A floating point number consists of an integer part, a decimal point and a fraction part.Example: 10, 100.00, 250.002.4 StringString is a sequence of zero or more characters. String literals are character strings surrounded by double quotes (“EWR”). String literals can include any valid character, including white-space characters and character escape sequences.2.5 OperatorsAn operator is a token that specifies an operation on at least one operand, and yields some result (a value, designator, side effect or some combination). Operands are expressions or constants.The following are the operators used in TASL.+ - / * == = > < & |3 Data TypesThe language defines the following data types:Numeric: Integer represents date and quantity, float represents price. True or False: These represent Boolean values.4 Declarations4.1 General declarationAll objects must be declared before use. The general syntax of a declaration is as follows:type-specifier init-declarator-list(opt);init-declarator-list:declaratorinit_declarator-list, declaratorThe type specifiers can be int, float or boolean.4.2 ArraysArrays can be declared with square brackets [ ]. The following is the syntax for declaring an array.type-specifier declarator [constant-expression-list(opt)];the type-specifier can be int or float.5 Functions5.1 Function TypesA function has the derived type “function returning type”. The type can be a data type except array or a function type. A function that does not return any value is referred to as a void function.Functions can be defined in the following ways:1) A function definition can create a function designator, define its parameters and their types, defined the type of its return value and construct the body of the function.2) A function declaration specifies the properties of a function defined elsewhere.5.2 Function DefinitionsA function definition includes the body of the function. Function definitions can appear in any order, and can be referenced in one or more source files. Function definitions cannot be nested.A function definition has the following syntax:function-definition:declaration-specifiers (opt) declarator declaration-list(opt) compound-statementdeclaration specifiersThe declaration-specifiers (type qualifier and type-specifier) can be listed in any order.Type specifiers are: int, float and boolean.Example:main ( ) {search “EWR” “SFO” 10182007 10242007 2if ( Results( ) ) {email([email protected]);}}boolean function Results( ) {if ( FARE[0] < desiredValue) {return true;}return false;}5.3 Function DeclarationsFor all functions if the function definition is located after the calling function, the function must be declared before calling it.5.4 Function Parameters and ArgumentsThe functions exchange information by means of parameters and arguments. The term parameter refers to any declaration within the parentheses following the function name in a function declaration or definition. The term argument refers to any expression within the parenthesis of a function call.The following rules apply to the parameters and arguments:1) The number of arguments in a function call must be the same as the number of parameters declared by the function definition. 2) The maximum number of arguments (and corresponding parameters) is 50 for a single function.3) Arguments are separated by commas. The comma is not an operator in this context and the arguments can be evaluated by the compiler in any order.4) Arguments are passed by value. 5) Modifying a parameter does not modify the corresponding argument passed by the function call.5.5 Function invocation and returnFunction Call:A function call can be a single statement followed by a “;”.Return Statement:The return statement is used to return from the function at the point the return statement is specified. Return statements can return a value. The return statement is terminated by a “;”.5.6 Built-In Functions5.6.1 print()Sends the output to the screen5.6.2 load()File I/O functions.5.6.3 email ([email protected])Emails the results to the supplied email id.6 Expressions and Operators6.1 Primary ExpressionsSimple expressions are called primary expressions; they denote values. Primary expressions include previously declared identifiers, constants, string literals and parenthesized expressions.Primary expressions have the following syntax:primary expression: identifier constant strings ( expression )6.1.1 IdentifierAn identifier is a primary expression provided it is declared as designating an object or a function6.1.2 ConstantA constant is a primary expression. Its type depends on its form (ie either boolean or int or float).6.1.3 ExpressionA parenthesized expression


View Full Document

Columbia COMS W4115 - TASL - TRAVEL ASSIST SCRIPTING LANGUAGE

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 TASL - TRAVEL ASSIST SCRIPTING LANGUAGE
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 TASL - TRAVEL ASSIST SCRIPTING LANGUAGE 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 TASL - TRAVEL ASSIST SCRIPTING LANGUAGE 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?