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
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 3<br />
Syntax<br />
This chapter describes the syntax of the <strong>TASM</strong> language. <strong>The</strong> syntax described in this<br />
section covers two types of syntax - plain-text syntax and XML syntax. <strong>The</strong> syntax<br />
used in the <strong>TASM</strong> toolset is referred to as the ”plain-text” syntax, which is a format<br />
that can be expressed using formal language constructs, such as a context-free<br />
grammar. This syntax resembles the syntax of popular programming languages. <strong>The</strong><br />
plain-text syntax is also the input format for the compiler and the parser. <strong>The</strong> plain-text<br />
format will also be used to store the content of a <strong>TASM</strong> specification on the file system.<br />
<strong>The</strong> XML syntax contains the same content as the plain-text syntax. However, using<br />
XML provides benefits for translation into another language (e.g. the input language of<br />
the model-checker UPPAAL) to interoperate with outside tools. Furthermore, the use<br />
of XML syntax enables easy creation of specification documents in a readable format,<br />
such as HTML. <strong>The</strong> attributes of both types of syntax are explained in more details in<br />
their respective sections. This chapter contains three sections. Section 3.1 explains the<br />
basic components of the syntax, such as types, operators, reserved words, and comments.<br />
Section 3.2 details the plain-text syntax, using a formal grammar expressed in<br />
Backus-Naur Form (BNF). Section 3.3 explains the XML syntax, using XML syntax<br />
trees.<br />
3.1 Basic Syntax<br />
This section explains the basic syntactical constructs of the <strong>TASM</strong> language. More<br />
specifically, this section gives the rules for constructing names, gives the list of reserved<br />
keywords, the list of operators, and the general typing rules. Semantical topics, such as<br />
operator precedence are given formally in Chapter 4. <strong>The</strong> concepts introduced in this<br />
section are applicable to both the plain-text syntax and the XML syntax.<br />
3.<strong>1.1</strong> Notational Conventions<br />
<strong>The</strong> following notational conventions are used in this section and subsequent sections.<br />
• Each abstract type uses the prefix T ASM<br />
35