20.01.2015 Views

The TASM Language Reference Manual Version 1.1 - Synrc

The TASM Language Reference Manual Version 1.1 - Synrc

The TASM Language Reference Manual Version 1.1 - Synrc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 3.1: Reserved Keywords<br />

Keyword Meaning<br />

t<br />

Used for time annotations<br />

next Used in time annotations to denote a special value of time<br />

now Used to obtain the value of the global clock<br />

new Used to instantiate a machine template<br />

Integer Denotes the integer datatype<br />

Float Denotes the float datatype<br />

Boolean Denotes the boolean datatype<br />

False Denotes a constant in the boolean datatype<br />

True Denotes a constant in the boolean datatype<br />

and Denotes a logical connective<br />

or Denotes a logical connective<br />

not Denotes a unary operator<br />

skip Denotes the production of an empty update set<br />

else Denotes the special ”else rule”<br />

// Used to comment out a given line<br />

<strong>TASM</strong> also allows the definition of user-defined types, which are analogous to enumerations<br />

in most programming languages. However, user-defined types are not assigned<br />

integer values and are unordered. A user-defined type is a named type that can<br />

be used to provide readable options and type safety. More specifically, a user-defined<br />

type is a named type that contains one ore more named values. For example, we can<br />

define user-defined types to denote the status of a light status or the mode of an airplane:<br />

• light status = {ON, OFF}<br />

• airplane mode = {Idle, Taxi, Takeoff, Cruise, Landing}<br />

User-defined types are unordered sets of one or more elements where elements<br />

must be unique. Each member element is a <strong>TASM</strong>Name. Furthermore, the name of the<br />

type is a <strong>TASM</strong>Name.<br />

<strong>The</strong> <strong>TASM</strong> language is a strongly typed language, meaning that all variables are<br />

typed and that type-safety is enforced at compilation time. No type casting is allowed,<br />

even from F loat to Integer. Future versions of the language might allow type casting<br />

through functions supplied by the <strong>TASM</strong> language.<br />

3.1.4 Arithmetic Operators<br />

For Integer and F loat types, the <strong>TASM</strong> language provides the four basic arithmetic<br />

operators, applicable only to operands of the same type:<br />

• addition: +<br />

37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!