The Slang® Language Specification

Slang 1st Edition

Michael Adelmann

2017-01-07


Table of Contents

1. Introduction
1.1. Introduction of Slang
1.2. Example Programs
2. Grammars
2.1. Context-Free Grammars
2.2. The Lexical Grammar
2.3. The Syntactic Grammar
2.4. Grammar Notation
3. Lexical Structure
3.4. Line Terminators
3.5. Input Elements and Tokens
3.6. White Space
3.7. Comments
3.8. Identifiers
3.9. Keywords
3.10. Literals
3.10.1. Integer Literals
3.10.2. Floating-Point Literals
3.10.3. Boolean Literals
3.10.5. String Literals
3.10.6. Escape Sequences for Character and String Literals
3.10.7. The Null Literal
3.11. Separators
3.12. Operators
4. Types, Values, and Variables
4.1. The Kinds of Types and Values
4.2. Primitive Types and Values
4.2.1. Integral Types and Values
4.2.2. Integer Operations
4.2.3. Floating-Point Types, Formats, and Values
4.2.4. Floating-Point Operations
4.2.5. The boolean Type and boolean Values
5. Names
5.1. Declarations
5.2. Names and Identifiers
5.3. Scope of a Declaration
5.4. Access Control
5.5. Fully Qualified Names and Canonical Names
6. Objects
6.1. Object Declarations
6.1.1. Object Modifiers
6.1.2. Generic Objects and Type Parameters
6.1.3. Inner Objects and Enclosing Instances
6.1.4. Supertypes and Subtypes
6.1.6. Object Body and Member Declarations
6.2. Object Members
6.3. Field Declarations
6.4. Method Declarations
6.4.1. Formal Parameters
6.4.2. Method Signature
6.4.3. Method Modifiers
6.4.4. Generic Methods
6.4.5. Method Result
6.4.6. Method Throws
6.4.7. Method Body
6.4.8. Inheritance, Overriding, and Hiding
6.4.9. Overloading
6.5. Member Type Declarations
6.6. Instance Initializers
6.7. Static Initializers
6.8. Constructor Declarations
6.6.1. Formal Parameters
6.8.2. Constructor Signature
6.8.3. Constructor Modifiers
6.8.4. Generic Constructors
6.8.5. Constructor Throws
6.8.6. The Type of a Constructor
6.8.7. Constructor Body
6.8.8. Constructor Overloading
6.8.9. Default Constructor
6.8.10. Preventing Instantiation of an Object
7. Interfaces
7.1. Interface Declarations
7.1.1. Interface Modifiers
7.1.2. Generic Interfaces and Type Parameters
7.1.3. Superinterfaces and Subinterfaces
7.2. Method Declarations
7.2.1. Inheritance and Overriding
7.2.1.1. Overriding (by Instance Methods)
7.2.1.2. Requirements in Overriding
7.2.1.3. Inheriting Methods with Override-Equivalent Signatures
7.2.2. Overloading
8. Enum Types
8.1. Enum Constants
8.2. Enum Body Declarations
9. Exceptions
9.1. The Kinds and Causes of Exceptions
9.1.1. The Kinds of Exceptions
9.1.2. The Causes of Exceptions
9.3. Run-Time Handling of an Exception