-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
4,043 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<style> | ||
#toc img.logo { | ||
width: 100px; | ||
height: 100px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
margin-bottom: 10px; | ||
display: block; | ||
} | ||
</style> | ||
|
||
<script> | ||
document.addEventListener("DOMContentLoaded", () => { | ||
var image = document.createElement('img') | ||
image.setAttribute('src', '../../etc/logo/sail_logo_square.png') | ||
image.setAttribute('alt', 'Sail Logo') | ||
image.classList.add('logo') | ||
var toc = document.querySelector('#toc') | ||
if (toc) { | ||
toc.insertAdjacentElement('afterbegin', image) | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
This appendix contains a grammar for the Sail language that is | ||
automatically generated from the | ||
https://gallium.inria.fr/~fpottier/menhir[Menhir] parser definition. | ||
|
||
NOTE: This means that the grammar is stated in such a way that the | ||
parser generator can see it is free of LR shift/reduce and | ||
reduce/reduce conflicts, rather than being optimised for human | ||
readability. | ||
|
||
First, we need some lexical conventions: | ||
|
||
* `ID` is any valid Sail identifier | ||
* `OPERATOR` is any valid Sail operator, as defined in <<Operators>>. | ||
* `TYPE_VARIABLE` is a valid Sail identifier with a leading single quote `'`. | ||
* `NUMBER` is a non-empty sequence of decimal digits `[0-9]+`. | ||
* `HEXADECIMAL_LITERAL` is `0x[A-Ba-f0-9_]+` | ||
* `BINARY_LITERAL` is `0b[0-1_]+` | ||
* `STRING_LITERAL` is a Sail string literal. | ||
`$[ATTRIBUTE]` and `$LINE_DIRECTIVE` represent attributes and single | ||
line directives. Examples of line directives would be things like | ||
`$include`, `$ifdef` and so on. These start with a leading `$`, are | ||
followed by the directive name (which follows the same lexical rules | ||
as a Sail identifier), is followed by one or more spaces, then | ||
proceeds to the end of the line, with everything between the | ||
identifier and the line ending being the line directive's argument | ||
(with leading and trailing whitespace removed). An attribute starts | ||
with `$[` and ends with `]`, and in between consists of an attribute | ||
name, followed by at least one whitespace character, then any | ||
arbitrary sequence of characters that does not contain `]`. | ||
|
||
[source,sail] | ||
---- | ||
include::parser.txt[] | ||
---- |
Oops, something went wrong.