Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Hashbang

WiP.Hashbang History

Hide minor edits - Show changes to output

2010-04-14 14:42 by benjk -
Changed line 9 from:
!!!Requirement
to:
!!!Lexer Requirement
2010-04-14 14:40 by benjk -
Changed line 11 from:
Any Modula-2 lexer shall examine the first two characters of the first line of a Modula-2 program source file. If these two characters are @@#!@@ then it shall ignore the first line of the file entirely and begin lexing the file in the second line instead.
to:
Any Modula-2 lexer shall examine the first two characters of the first line of a Modula-2 program source file and if they are @@#@@ and @@!@@ respectively then it shall ignore the first line of the file entirely and begin lexing the file in the second line instead.
2010-04-14 14:38 by benjk -
Added lines 1-11:
!!!Objective

The objective of this feature is to allow Modula-2 program sources to conform to the Hashbang or Shebang convention on Unix operating systems.

!!!Hashbang convention

On Unix like operating systems, the program loader considers any text file whose first two characters are @@#!@@ (called Hashbang or Shebang) to be an executable script. The program loader interprets the character sequence following the hashbang as a pathname to the interpreter that can interpret and execute the script. It will then try to invoke the interpreter specified in the path and pass the script as an argument.

!!!Requirement

Any Modula-2 lexer shall examine the first two characters of the first line of a Modula-2 program source file. If these two characters are @@#!@@ then it shall ignore the first line of the file entirely and begin lexing the file in the second line instead.