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.

• Constants are enclosed in single quotes (e.g. ’a’, ’1’, etc.), except where settheoric<br />

notation is used<br />

• <strong>The</strong> formal grammar uses the basic symbols from BNF (e.g., {}, [], , etc.)<br />

3.1.2 Names<br />

<strong>The</strong> use of names is crucial in the <strong>TASM</strong> language; every type of object (variables,<br />

types, resources, machines, etc.) is uniquely identified by its name. We define the<br />

generic abstract type T ASMName to express the restrictions on individual names.<br />

<strong>The</strong> type <strong>TASM</strong>Name is used in the rest of this document when a name has the listed<br />

restrictions. <strong>The</strong> <strong>TASM</strong> language also has a set of reserved keywords that cannot be<br />

used as names. <strong>The</strong> complete list of keywords is shown in table 3.1.<br />

• <strong>TASM</strong>Name is a string of characters<br />

• Each character of <strong>TASM</strong>Name can be either ’a’-’z’ or ’A’-’Z’ or ’ ’ or ’1’-’9’ or<br />

’-’<br />

• <strong>TASM</strong>Name must start with ’a’-’z’ or ’A’-’Z’<br />

• <strong>TASM</strong>Name has a length: 1-64<br />

• <strong>TASM</strong>Name is not a reserved keyword<br />

• <strong>TASM</strong>Name is case-sensitive<br />

• Each <strong>TASM</strong>Name is unique in a given <strong>TASM</strong> specification<br />

<strong>The</strong> restrictions on the uniqueness of <strong>TASM</strong>Name’s might seem restrictive, especially<br />

in the absence of namespaces, but imposing this restriction removes potential<br />

ambiguities.<br />

3.1.3 Types<br />

<strong>The</strong> <strong>TASM</strong> language contains only simple types. <strong>The</strong>re are no data structures, subtypes,<br />

or polymorphic types. <strong>The</strong> <strong>TASM</strong> language is also strongly typed; there are no dynamic<br />

types or type inference. All typing rules are enforced at compilation time and type<br />

safety is assured if a <strong>TASM</strong> specification compiles correctly. <strong>The</strong> <strong>TASM</strong> language<br />

supplies three default types:<br />

• Integers = {. . . , −1, 0, 1, . . .}<br />

• Floats = Rational Numbers (e.g., -<strong>1.1</strong>1, -0.5, 0.0, 10.45, etc.)<br />

• Booleans = {T rue, F alse}<br />

36

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

Saved successfully!

Ooh no, something went wrong!