• 沒有找到結果。

Types limit the values that a variable can hold or that an expression can produce, limit the operations supported on those values, and determine the meaning of the operations. Strong typing helps detect errors at compile time [12, 13]. The Interfacing Script Language separates data types into:

-Identifiers that are used to refer the system’s internal variables used to reference the GUIs of the target applications

-Constants that have a binding time that occurs statically prior to compilation thus containing pre-defined values that cannot be reassigned

-Operators that are the key non-terminal symbols used to decide the pattern of expansion of the parsing routes. Providing commands the flexibility that allows their use to deal with multiple interaction situations (Expansion Paths)

-Separators and Terminators, being the elements used by the lexical analysis process as a guide to break down the command input stream by collecting characters into logical groupings known as lexemes[13]

In the following subsections, we elaborate each one of these data types as well as their common use in the language.

4.2.1 Identifiers

In this section variables which can be performed a binding during runtime are introduced. These variables can be changed during the course of execution through dynamic binding by means of assignments.

Square

It is a graphical reference that is introduced by the user to associate locations of static interaction zones. A variable of type square is associated to a location (integer, integer) and a graphic rectangle in the system.

Instance limit: from 0 to 999 (excluding instances created in grids)

Coordinate

A graphical square reference used in grids that is auto-generated by the system. The type coordinate is associated to a location (integer, integer) and a graphic rectangle in the system.

Instance limit: from 0 to 999

Actor

The actor type is composed of a location (integer, integer) and a graphical label (string) in the system and is used for the reference to dynamic content of applications. .

Instance limit: from 0 to 999

ActorProfile

An actor profile is the entity that actors are organized by. It is defined by the user prior to actor creation. Actors when created are auto-assigned into their corresponding profiles.

Instance limit: from 0 to 999

App

Represents the name of a target application (String) and is introduced by the user.

Instance limit: unlimited (limited by computing power)

Stage

It is used to reference the different GUIs used in an application and is used as the entity to organize and group sets of squares.

Instance limit: from 0 to 999

Grid

The Grid type corresponds to user-defined grids that represent a collection of objects of type square in the system. Grids are used to add reference through localization to GUIs.

Instance limit: from 0 to 999

Number

The number type maps directly to integers and are used to specify coordinates and revolutions of command loops.

Instance limit: unlimited (limited by computing power)

Text

Dictation text (string) spoken by the user and is used to emulate typing on the keyboard.

Instance limit: unlimited (limited by computing power)

4.2.2 Constants

In this section variables which have a binding time that occurs prior to runtime are introduced.

These variables are constants, with predefined values assigned through static binding that cannot be reassigned during the course of execution.

Direction

Holds predefined constant values of: North, South, East, West, Northeast, Northwest, Southeast, and Southwest. Direction type is used in conjunction with the drag and move commands to specify cursor orientation.

Pattern

Hold constant values that are predefined by the system that represents geometric moving patterns. Used for dragging the cursor in a predefined manner by executing a batch of instructions that represents the moving pattern.

Distance

The distance constant holds predefined constant values of: very short, short, normal, long, very long. The distance constant is used for moving and dragging of the cursor, restricting the length of a mouse movement.

Speed

The speed constant holds predefined and constant values of: very slow, slow, fast, and very fast.

The speed constant is used when moving or dragging the cursor, restricting the speed of a mouse movement.

clickType

The clickType constant specifies the type of click to perform when the click command is invoked, it holds predefined values of rightclick, doubleclick , and leftclick.

Boolean

Holds the predefined values of true or false and it’s used with the commands showGrid, setDrop, setVisualAide and usingActor.

VisList

Used for referencing the system’s visual-aided lists that contain a listing of available stages, grids, squares, actors, applications and actor profiles.

4.2.3 Operators

Operators are the base that our syntactic analysis process utilizes to produce its leftmost derivations as it traces the parse tree structure in a top-down manner (section 4.4.2). They are the key non-terminal symbols that are used to when deciding pattern of expansion of the parsing routes [13].

Our system makes use of three different operators that are the to, by and loop operators, bellow is an overview of them and how they are used in the interfacing script language.

Operator to

The “to” operator is used in conjunction with action and assignment statements to specify assignment of locations to identifiers.

The use of to operator is restricted for commands move, drag, and set, for the use with right operands of data type square, coordinate and distance, and for the use with left operands of data type actor, squares or coordinates or null.

Operator by

The “by” operator is used for assigning modes to its left operand. It is used in conjunction with action statements to specify desired speed, distance, moving pattern, and click type commands.

The use of “by” operator is restricted for commands move and drag, for the use with left operands of data type direction, square, coordinate or actor, and for the use with right operands of data type distance ,clickType, and pattern.

Operator loop

The “loop” operator allows for looping a command an specific number (number type) of times.

Its left operand is always a command. Its right operand is the number of times to loop the command, if not stated its default is set to one loop.

The loop operator is restricted for the use with right operands of data type number.

4.2.4 Separators and Terminators

The following elements are used by the lexical analysis process as a guide to break down the input stream by collecting characters into logical groupings known as lexemes [13].

Terminator then

The terminator then is used for conjunction of statements and delimits one statement from the others.

Syntax

[stmt]Æ(then)Æ[stmt]Æ

dragActor actor x to coordinate y then click square x

“dragActor actor1 to 10,4 then click rotate”

Here two action statements (dragActor, click) are delimited by then.

Terminator times

The terminator “times” specifies the end of a loop command, and it is placed after the number identifier.

Syntax

[stmt]Æ(loop)Æ(times)Æ

drag direction x by distance y loop number times “drag south by very long then loop 2 times”

Here the drag command gets executed number times

Separator Comma

The separator “comma” separates x and y values of a coordinate identifier.

Example

dragActor actor x to coordinate y

“dragActor tree to 2,9”

In the coordinate 2,9 the comma separates the left value(2) which is interpreted as an x and the right value(9) which is interpreted as a y.

4.2.5 Reserved Words

The following list of words are reserved by this language definition, the use of them as values of identifiers will create conflicts and an exception with its respective error message will be displayed by the system.

send

clearConsole undoPhrase

$

to by loop

Double spacing (will be interpreted as single) then

times

4.2.6 Input Element Classification

The allowed input elements of the language definition are classified into white space and tokens.

Tokens are further classified into the following types:

Identifier

Command Statement

Separator Operator

相關文件