forked from grammarware/grammarware.github.io
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added missing (non-generated) Zoo and Tank files
- Loading branch information
1 parent
7963ed6
commit a9158e6
Showing
657 changed files
with
308,395 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf"> | ||
<bgf:production> | ||
<nonterminal>program</nonterminal> | ||
<bgf:expression> | ||
<plus> | ||
<bgf:expression> | ||
<nonterminal>function</nonterminal> | ||
</bgf:expression> | ||
</plus> | ||
</bgf:expression> | ||
</bgf:production> | ||
<bgf:production> | ||
<nonterminal>function</nonterminal> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<nonterminal>ID</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<plus> | ||
<bgf:expression> | ||
<nonterminal>ID</nonterminal> | ||
</bgf:expression> | ||
</plus> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>=</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>expr</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<plus> | ||
<bgf:expression> | ||
<nonterminal>NEWLINE</nonterminal> | ||
</bgf:expression> | ||
</plus> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
</bgf:production> | ||
<bgf:production> | ||
<nonterminal>expr</nonterminal> | ||
<bgf:expression> | ||
<choice> | ||
<bgf:expression> | ||
<nonterminal>binary</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>apply</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>ifThenElse</nonterminal> | ||
</bgf:expression> | ||
</choice> | ||
</bgf:expression> | ||
</bgf:production> | ||
<bgf:production> | ||
<nonterminal>binary</nonterminal> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<nonterminal>atom</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<star> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<nonterminal>ops</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>atom</nonterminal> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
</star> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
</bgf:production> | ||
<bgf:production> | ||
<nonterminal>apply</nonterminal> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<nonterminal>ID</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<plus> | ||
<bgf:expression> | ||
<nonterminal>atom</nonterminal> | ||
</bgf:expression> | ||
</plus> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
</bgf:production> | ||
<bgf:production> | ||
<nonterminal>ifThenElse</nonterminal> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<terminal>if</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>expr</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>then</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>expr</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>else</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>expr</nonterminal> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
</bgf:production> | ||
<bgf:production> | ||
<nonterminal>atom</nonterminal> | ||
<bgf:expression> | ||
<choice> | ||
<bgf:expression> | ||
<nonterminal>ID</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>INT</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<terminal>(</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>expr</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>)</terminal> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
</choice> | ||
</bgf:expression> | ||
</bgf:production> | ||
<bgf:production> | ||
<nonterminal>ops</nonterminal> | ||
<bgf:expression> | ||
<choice> | ||
<bgf:expression> | ||
<terminal>==</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>+</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>-</terminal> | ||
</bgf:expression> | ||
</choice> | ||
</bgf:expression> | ||
</bgf:production> | ||
</bgf:grammar> |
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,22 @@ | ||
program: | ||
function+ | ||
function: | ||
ID ID+ "=" expr NEWLINE+ | ||
expr: | ||
binary | ||
apply | ||
ifThenElse | ||
binary: | ||
atom (ops atom)* | ||
apply: | ||
ID atom+ | ||
ifThenElse: | ||
"if" expr "then" expr "else" expr | ||
atom: | ||
ID | ||
INT | ||
"(" expr ")" | ||
ops: | ||
"==" | ||
"+" | ||
"-" |
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,14 @@ | ||
program = function+ ; | ||
function = ID ID+ '=' expr NEWLINE+ ; | ||
expr = binary ; | ||
expr = apply ; | ||
expr = ifThenElse ; | ||
binary = atom (ops atom)* ; | ||
apply = ID atom+ ; | ||
ifThenElse = 'if' expr 'then' expr 'else' expr ; | ||
atom = ID ; | ||
atom = INT ; | ||
atom = '(' expr ')' ; | ||
ops = '==' ; | ||
ops = '+' ; | ||
ops = '-' ; |
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,43 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf" xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Browsable FL Concrete Syntax Grammar</title><style type="text/css"> | ||
.label, .sel { color: green; } | ||
.marked { background-color: #FFE5B4;} | ||
.nt { color: blue; font-weight: bold; } | ||
.t { color: red; font-style:italic; } | ||
.meta { color: green; font-style:italic; font-family: Roman, "Times New Roman", serif; } | ||
.b { text-align: right; font-style:italic;} | ||
.date { font-size: small; } | ||
pre | ||
{ | ||
border: 1px solid black; | ||
border-spacing: 2px; | ||
border-collapse: collapse; | ||
background-color: #ECECEC; | ||
} | ||
</style></head><body><h1>Browsable FL Concrete Syntax Grammar</h1><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="CC-BY"></img></a><p>Extracted and/or recovered by <strong><a href="http://grammarware.net">Vadim Zaytsev</a></strong>, see <a href="http://slps.sourceforge.net/tank/">Grammar Tank</a> for details. <br></br>Source used for this grammar: Ralf Lämmel, <code>FL.g</code> (17 May – 16 July 2008) </p><h2>Summary</h2><ul><li>Number of production rules: <strong>8</strong></li><li>Number of top alternatives: <strong>14</strong></li><li>Number of defined nonterminal symbols: <strong>8</strong></li><li>Root nonterminal symbols: —</li><li>Other top nonterminal symbols: <strong>1</strong>: <code><a href="#program" class="nt">program</a></code></li><li>Bottom nonterminal symbols: <strong>3</strong>: <code><a href="#ID" class="nt">ID</a>, <a href="#NEWLINE" class="nt">NEWLINE</a>, <a href="#INT" class="nt">INT</a></code></li><li>Number of used terminal symbols: <strong>9</strong></li><li>Special terminal symbols: <strong>6</strong>: <code class="t">"=", "(", ")", "==", "+", "-"</code></li><li>Keywords: <strong>3</strong>: <code class="t">"if", "then", "else"</code></li></ul><h2>Syntax</h2><pre><a class="nt" name="program">program</a>: | ||
<a class="nt" href="#function">function</a><span class="meta">+</span> | ||
</pre><pre><a class="nt" name="function">function</a>: | ||
<span class="meta">id</span> <span class="meta">id</span><span class="meta">+</span> <span class="t">"="</span> <a class="nt" href="#expr">expr</a> <a class="nt" href="#NEWLINE">NEWLINE</a><span class="meta">+</span> | ||
</pre><pre><a class="nt" name="expr">expr</a>: | ||
<a class="nt" href="#binary">binary</a> | ||
<a class="nt" href="#apply">apply</a> | ||
<a class="nt" href="#ifThenElse">ifThenElse</a> | ||
</pre><pre><a class="nt" name="binary">binary</a>: | ||
<a class="nt" href="#atom">atom</a> (<a class="nt" href="#ops">ops</a> <a class="nt" href="#atom">atom</a>)<span class="meta">*</span> | ||
</pre><pre><a class="nt" name="apply">apply</a>: | ||
<span class="meta">id</span> <a class="nt" href="#atom">atom</a><span class="meta">+</span> | ||
</pre><pre><a class="nt" name="ifThenElse">ifThenElse</a>: | ||
<span class="t">"if"</span> <a class="nt" href="#expr">expr</a> <span class="t">"then"</span> <a class="nt" href="#expr">expr</a> <span class="t">"else"</span> <a class="nt" href="#expr">expr</a> | ||
</pre><pre><a class="nt" name="atom">atom</a>: | ||
<span class="meta">id</span> | ||
<a class="nt" href="#INT">INT</a> | ||
<span class="t">"("</span> <a class="nt" href="#expr">expr</a> <span class="t">")"</span> | ||
</pre><pre><a class="nt" name="ops">ops</a>: | ||
<span class="t">"=="</span> | ||
<span class="t">"+"</span> | ||
<span class="t">"-"</span> | ||
</pre><hr></hr><div class="b"> | ||
Maintained by Dr. <a href="http://grammarware.net/">Vadim Zaytsev</a> a.k.a. @<a href="http://twitter.com/grammarware">grammarware</a>. | ||
Last updated: 16/09/2011. | ||
</div></body></html> |
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,38 @@ | ||
@contributor{bgf2src automated exporter - SLPS} | ||
module Antlr | ||
|
||
syntax Program | ||
= | ||
Function+ | ||
; | ||
syntax Function | ||
= | ||
ID ID+ "=" Expr NEWLINE+ | ||
; | ||
syntax Expr | ||
= Binary | ||
| Apply | ||
| IfThenElse | ||
; | ||
syntax Binary | ||
= | ||
Atom (Ops Atom)* | ||
; | ||
syntax Apply | ||
= | ||
ID Atom+ | ||
; | ||
syntax IfThenElse | ||
= | ||
"if" Expr "then" Expr "else" Expr | ||
; | ||
syntax Atom | ||
= ID | ||
| INT | ||
| "(" Expr ")" | ||
; | ||
syntax Ops | ||
= "==" | ||
| "+" | ||
| "-" | ||
; |
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,27 @@ | ||
module Main | ||
|
||
exports | ||
sorts | ||
Program Function Expr Binary Apply IfThenElse Atom Ops | ||
context-free syntax | ||
Function+ -> Program | ||
|
||
ID ID+ "=" Expr NEWLINE+ -> Function | ||
|
||
Binary | ||
| Apply | ||
| IfThenElse -> Expr | ||
|
||
Atom (Ops Atom)* -> Binary | ||
|
||
ID Atom+ -> Apply | ||
|
||
"if" Expr "then" Expr "else" Expr -> IfThenElse | ||
|
||
ID | ||
| INT | ||
| "(" Expr ")" -> Atom | ||
|
||
"==" | ||
| "+" | ||
| "-" -> Ops |
Oops, something went wrong.