Contents | Prev | Next The T Language Specification
Spring 2005


The T Language Specification

Table of Contents

1 Lexical Structure

1.1 Line Terminators
1.2 Input Elements and Tokens
1.3 White Space
1.4 Comments
1.5 Identifiers
1.6 Keywords
1.7 Literals
1.7.1 Integer Literals
1.7.2 The Null Literal
1.8 Separators
1.9 Operators

2 Types, Values, and Variables

2.1 The Kinds of Types and Values
2.2 Primitive Types and Values
2.2.1 Integral Values
2.2.2 Integer Operations
2.3 Reference Types and Values
2.3.1 Objects
2.3.2 The Class Object
2.3.4 When Reference Types Are the Same
2.4 Where Types Are Used
2.5 Variables
2.5.1 Variables of Primitive Type
2.5.2 Variables of Reference Type
2.5.3 Kinds of Variables
2.5.4 final Variables
2.5.5 Initial Values of Variables
2.5.6 Types and Classes

3 Conversions and Promotions

3.1 Kinds of Conversion
3.1.1 Identity Conversions
3.1.2 Widening Reference Conversions
3.1.3 Narrowing Reference Conversions
3.1.4 Forbidden Conversions
3.2 Assignment Conversion
3.3 Method Invocation Conversion

4 Names

4.1 Declarations
4.2 Names and Identifiers
4.3 Scope of a Declaration
4.3.1 Shadowing Declarations
4.3.2 Obscured Declarations
4.4 Determining the Meaning of a Name
4.4.1 Syntactic Classification of a Name According to Context
4.4.2 Reclassification of Contextually Ambiguous Names
4.4.3 Meaning of Type Names
4.4.3.1 Simple Type Names
4.4.3.2 Qualified Type Names
4.4.4 Meaning of Expression Names
4.4.4.1 Simple Expression Names
4.4.4.2 Qualified Expression Names
4.4.5 Meaning of Method Names
4.4.5.1 Simple Method Names
4.4.5.2 Qualified Method Names

5 Classes

5.1 Class Declaration
5.1.1 Superclasses and Subclasses
5.1.2 Class Body and Member Declarations
5.2 Class Members
5.3 Field Declarations
5.3.1 Initialization of Fields
5.4 Method Declarations
5.4.1 Formal Parameters
5.4.2 Method Signature
5.4.3 Method Body
5.4.4 Inheritance and Overriding
5.4.4.1 Overriding (by Instance Methods)
5.4.4.2 Inheriting Methods with the Same Signature
5.4.5 Overloading
5.5 Constructor Declarations
5.5.1 Formal Parameters
5.5.2 Constructor Signature
5.5.3 Constructor Body
5.5.3.1 Explicit Constructor Invocations
5.5.4 Constructor Overloading
5.5.5 Default Constructor
5.6 Destructor Declarations
5.6.1 Destructor Signature
5.6.2 Destructor Body
5.6.3 Default Destructor

6 Arrays

6.1 Array Types
6.2 Array Variables
6.3 Array Creation
6.4 Array Access
6.5 Array Members
6.6 Run-Time Types for Arrays
6.7 Run-time Type Checking
6.8 Array Deletion

7 Blocks and Statements

7.1 Main Block
7.2 Blocks
7.3 Statements
7.4 The Empty Statement
7.5 Expression Statements
7.6 The if-then-else Statement
7.7 The while Statement
7.8 The return Statement
7.9 The delete Statement
7.10 The out Statement

8 Expressions

8.1 Evaluation, Denotation, and Result
8.2 Variables as Values
8.3 Type of an Expression
8.4 Expressions and Run-Time Checks
8.5 Evaluation Order
8.5.1 Evaluate Left-Hand Operand First
8.5.2 Evaluate Operands before Operation
8.5.3 Evaluation Respects Parentheses and Precedence
8.5.4 Argument Lists are Evaluated Left-to-Right
8.5.5 Evaluation Order for Other Expressions
8.6 Primary Expressions
8.6.1 Lexical Literals
8.6.2 Class Literals
8.6.3 this
8.6.4 Parenthesized Expressions
8.7 Class Instance Creation Expressions
8.7.1 Determining the Class being Instantiated
8.7.2 Determining Enclosing Instances
8.7.3 Choosing the Constructor and its Arguments
8.7.4 Run-time Evaluation of Class Instance Creation Expressions
8.8 Array Creation Expressions
8.8.1 Run-time Evaluation of Array Creation Expressions
8.8.2 Example: Array Creation Evaluation Order
8.8.3 Example: Array Creation and Out-of-Memory Detection
8.9 Field Access Expressions
8.9.1 Field Access Using a Primary
8.9.2 Accessing Superclass Members using super
8.10 Method Invocation Expressions
8.10.1 Compile-Time Step 1: Determine Class or Interface to Search
8.10.2 Compile-Time Step 2: Determine Method Signature
8.10.2.1 Find Methods that are Applicable and Accessible
8.10.2.2 Choose the Most Specific Method
8.10.3 Runtime Evaluation of Method Invocation
8.10.3.1 Compute Target Reference (If Necessary)
8.10.3.2 Evaluate Arguments
8.10.3.3 Locate Method to Invoke
8.10.3.4 Create Frame
8.11 Array Access Expressions
8.11.1 Runtime Evaluation of Array Access
8.11.2 Examples: Array Access Evaluation Order
8.12 Unary Operators
8.12.1 Unary Minus Operator -
8.12.2 Logical Complement Operator !
8.13 Arithmetic Operators
8.13.1 Multiplicative Operators
8.13.1.1 Multiplication Operator *
8.13.1.2 Division Operator /
8.13.2 Additive Operators
8.14 Relational Operators
8.14.1 Numerical Comparison Operators < and >
8.15 Equality Operator
8.15.1 Numerical Equality Operator
8.15.2 Reference Equality Operator
8.16 Assignment Operator
8.17 Run-Time Errors

9 LALR(1) Grammar (yacc file)


Contents | Prev | Next The T Language Specification
Spring 2005

...