-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3586 from szarnyasg/js-archive
Archive JS
- Loading branch information
Showing
53 changed files
with
4,274 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
function GenerateAggregateOrderBy(options = {}) { | ||
return [ | ||
Keyword("ORDER"), | ||
Keyword("BY"), | ||
GenerateOrderTerms() | ||
] | ||
} | ||
|
||
function GenerateAggregate(options = {}) { | ||
return Diagram([ | ||
AutomaticStack([ | ||
Expression("aggregate-name"), | ||
Keyword("("), | ||
Choice(0, [ | ||
Sequence([ | ||
Optional(Keyword("DISTINCT"), "skip"), | ||
OneOrMore(Sequence([ | ||
Expression() | ||
]), Keyword(",")), | ||
Optional(Expandable("order-by", options, "order-by", GenerateAggregateOrderBy)) | ||
]), | ||
new Skip() | ||
]), | ||
Keyword(")"), | ||
Optional(Sequence(GenerateFilterClause())), | ||
]) | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = GenerateAggregate(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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,34 @@ | ||
|
||
function GenerateCase(options = {}) { | ||
return Diagram([ | ||
Sequence([ | ||
Keyword("CASE"), | ||
Optional(Expression(), "skip"), | ||
OneOrMore(Sequence([ | ||
Keyword("WHEN"), | ||
Expression(), | ||
Keyword("THEN"), | ||
Expression() | ||
])), | ||
Optional(Sequence([ | ||
Keyword("ELSE"), | ||
Expression(), | ||
])), | ||
Keyword("END") | ||
]) | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = GenerateCase(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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,37 @@ | ||
|
||
function GenerateCast(options = {}) { | ||
return Diagram([ | ||
Choice(0,[ | ||
Sequence([ | ||
Choice(0, [ | ||
Keyword("CAST"), | ||
Keyword("TRY_CAST") | ||
]), | ||
Keyword("("), | ||
Expression(), | ||
Keyword("AS"), | ||
Expression("type-name"), | ||
Keyword(")") | ||
]), | ||
Sequence([ | ||
Expression(), | ||
Keyword("::"), | ||
Expression("type-name") | ||
]) | ||
]) | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = GenerateCast(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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,24 @@ | ||
|
||
function GenerateFunctions(options = {}) { | ||
return Diagram([ | ||
Sequence([ | ||
Expression(), | ||
Keyword("COLLATE"), | ||
Expression("collation-name") | ||
]) | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = GenerateFunctions(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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,47 @@ | ||
|
||
function GenerateBetween(options = {}) { | ||
return Diagram([ | ||
Choice(0, [ | ||
Sequence([ | ||
Expression(), | ||
Optional(Keyword("NOT"), "skip"), | ||
Keyword("BETWEEN"), | ||
Expression(), | ||
Keyword("AND"), | ||
Expression() | ||
]), | ||
Sequence([ | ||
Expression(), | ||
Keyword("IS"), | ||
Optional(Keyword("NOT"), "skip"), | ||
Keyword("NULL"), | ||
]) | ||
]) | ||
]) | ||
} | ||
|
||
function GenerateComparison(options = {}) { | ||
return Diagram([ | ||
Sequence([ | ||
Expression(), | ||
Expression("binary-operator"), | ||
Expression() | ||
]) | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram1").classList.add("limit-width"); | ||
document.getElementById("rrdiagram1").innerHTML = GenerateBetween(options).toString(); | ||
document.getElementById("rrdiagram2").classList.add("limit-width"); | ||
document.getElementById("rrdiagram2").innerHTML = GenerateComparison(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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 @@ | ||
|
||
function GenerateFunctions(options = {}) { | ||
return Diagram([ | ||
Sequence([ | ||
Expression("function-name"), | ||
Keyword("("), | ||
ZeroOrMore(Sequence([ | ||
Expression() | ||
]), Keyword(",")), | ||
Keyword(")") | ||
]) | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = GenerateFunctions(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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 @@ | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = GenerateIn(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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,51 @@ | ||
|
||
function GenerateLike(options = {}) { | ||
return Diagram([ | ||
Expression("string"), | ||
Optional(Keyword("NOT"), "skip"), | ||
Keyword("LIKE"), | ||
Expression("pattern"), | ||
Optional( | ||
Sequence([ | ||
Keyword('ESCAPE'), | ||
Expression('escape_character') | ||
]) | ||
) | ||
]) | ||
} | ||
|
||
function GenerateSimilarTo(options = {}) { | ||
return Diagram([ | ||
Expression("string"), | ||
Optional(Keyword("NOT"), "skip"), | ||
Keyword("SIMILAR"), | ||
Keyword("TO"), | ||
Expression("pattern") | ||
]) | ||
} | ||
|
||
function GenerateGlob(options = {}) { | ||
return Diagram([ | ||
Expression("string"), | ||
Keyword("GLOB"), | ||
Expression("pattern") | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram1").classList.add("limit-width"); | ||
document.getElementById("rrdiagram1").innerHTML = GenerateLike(options).toString(); | ||
document.getElementById("rrdiagram2").classList.add("limit-width"); | ||
document.getElementById("rrdiagram2").innerHTML = GenerateSimilarTo(options).toString(); | ||
document.getElementById("rrdiagram3").classList.add("limit-width"); | ||
document.getElementById("rrdiagram3").innerHTML = GenerateGlob(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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,33 @@ | ||
|
||
function GenerateLogicalFunctions(options = {}) { | ||
return Diagram([ | ||
Choice(0, [ | ||
Sequence([ | ||
Expression(), | ||
Choice(0, [ | ||
Keyword("AND"), | ||
Keyword("OR") | ||
]), | ||
Expression() | ||
]), | ||
Sequence([ | ||
Keyword("NOT"), | ||
Expression() | ||
]) | ||
]) | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = GenerateLogicalFunctions(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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 @@ | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram").classList.add("limit-width"); | ||
document.getElementById("rrdiagram").innerHTML = Diagram(GenerateStarClause(options)).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
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,36 @@ | ||
|
||
function GenerateScalarSubquery(options = {}) { | ||
return Diagram([ | ||
Keyword("("), | ||
Expression("select-node"), | ||
Keyword(")") | ||
]) | ||
} | ||
|
||
function GenerateExists(options = {}) { | ||
return Diagram([ | ||
Optional(Keyword("NOT"), "skip"), | ||
Keyword("EXISTS"), | ||
Keyword("("), | ||
Expression("select-node"), | ||
Keyword(")") | ||
]) | ||
} | ||
|
||
function Initialize(options = {}) { | ||
document.getElementById("rrdiagram1").classList.add("limit-width"); | ||
document.getElementById("rrdiagram1").innerHTML = GenerateScalarSubquery(options).toString(); | ||
document.getElementById("rrdiagram2").classList.add("limit-width"); | ||
document.getElementById("rrdiagram2").innerHTML = GenerateExists(options).toString(); | ||
document.getElementById("rrdiagram3").classList.add("limit-width"); | ||
document.getElementById("rrdiagram3").innerHTML = GenerateIn(options).toString(); | ||
} | ||
|
||
function Refresh(node_name, set_node) { | ||
options[node_name] = set_node; | ||
Initialize(options); | ||
} | ||
|
||
options = {} | ||
Initialize() | ||
|
Oops, something went wrong.