Added all the syntax editor files from Moises.

This is the version that he sent to me on Fri, Apr 11, 2008 at 2:42 PM. I'm not sure if this is the latest version.
This commit is contained in:
bjorn
2008-06-16 17:42:20 +00:00
parent f117eb95c3
commit a0d29773a6
9 changed files with 2382 additions and 25 deletions

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="gflib.js"></script>
<script type="text/javascript" src="editorGrammar.js"></script>
<script type="text/javascript" src="grammar.js"></script>
<script type="text/javascript" src="gfjseditor.js"></script>
<title>Web-based Syntax Editor</title>
</head>
<body onload="mkEditor('editor', Literals)" onkeydown="hotKeys(event)">
<div id="editor">
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

BIN
lib/javascript/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

1252
lib/javascript/gfjseditor.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
var Literals = new GFGrammar(new GFAbstract("Exp",{Name: new Type(["String"], "Exp"), Welcome: new Type(["Exp"], "Exp")}),{LiteralsEng: new GFConcrete({Name: function(cs){return new Arr(Literals.concretes["LiteralsEng"].rule("_0", cs));}, Welcome: function(cs){return new Arr(new Seq(new Str("Welcome"), new Str(","), Literals.concretes["LiteralsEng"].rule("_0", cs)));}, _0: function(cs){return cs[0].sel(new Int(0));}, Exp: function(cs){return new Arr(cs[0]);}, Int: function(cs){return new Arr(cs[0]);}, Float: function(cs){return new Arr(cs[0]);}, String: function(cs){return new Arr(cs[0]);}}, new Parser("Exp",[new Rule(1, new FunApp("Welcome",[new Arg(0)]),[1],[[new Terminal("Welcome"), new Terminal(","), new ArgProj(0, 0)]]), new Rule(1, new FunApp("Name",[new Arg(0)]),[-1],[[new ArgProj(0, 0)]])],{Exp:[1], Float:[-3], Int:[-2], String:[-1], _Var:[-4]}))});

BIN
lib/javascript/minus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
lib/javascript/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

234
lib/javascript/style.css Normal file
View File

@@ -0,0 +1,234 @@
body {
font-family:arial,helvetica,sans-serif;
font-size:12px;
background-color: white;
}
#wrapper {
width:740px;
height:520px;
margin:auto 50px;
border:1px solid gray;
padding:10px;
}
#absFrame {
width:250px;
height:250px;
padding:10px;
border:1px solid gray;
float:left;
white-space: nowrap;
}
#conFrame {
width:436px;
height:250px;
margin-left:10px;
padding:10px;
border:1px solid gray;
float:left;
white-space: normal;
overflow:auto;
}
#actFrame {
width:250px;
height:170px;
margin-top:10px;
padding:10px;
border:1px solid gray;
float:left;
overflow:auto;
}
#refFrame {
width:436px;
height:170px;
margin-left:10px;
margin-top:10px;
padding:10px;
border:1px solid gray;
float:left;
overflow:auto;
}
#messageFrame {
width:506px;
height:15px;
margin-top:10px;
margin-right:10px;
padding:10px;
border:1px solid gray;
float:left;
overflow:hidden;
}
#clipboardFrame {
width:180px;
height:15px;
margin-top:10px;
padding:10px;
border:1px solid gray;
float:left;
overflow:auto;
}
#tree {
left: -10px;
top: -10px;
width: 230px;
height: 250px;
margin: 0px;
padding: 10px;
overflow: auto;
}
ul {
position: relative;
list-style: none;
margin-left: 20px;
padding: 0px;
}
li {
position: relative;
}
img.tree-menu {
margin-right: 5px;
}
a.tree:link, a.tree:visited, a.tree:active {
color: black;
background-color: white;
text-decoration: none;
margin-right:10px;
}
a.tree:hover {
color: blue;
background-color: white;
text-decoration: underline;
margin-right:10px;
}
a.treeSelected:link, a.treeSelected:visited, a.treeSelected:active {
color: white;
background-color: #3366CC;
text-decoration: none;
margin-right:10px;
}
a.treeSelected:hover {
color: white;
background-color: #3366CC;
text-decoration: underline;
margin-right:10px;
}
a.treeGray:link, a.treeGray:visited, a.treeGray:active {
color: silver;
background-color: white;
text-decoration: none;
margin-right:10px;
}
a.treeGray:hover {
color: silver;
background-color: white;
text-decoration: none;
margin-right:10px;
}
table.action, table.refinement, table.wrapper, table.tree, table.language {
margin: 0px;
padding: 0px;
border-style: none;
border-collapse: collapse;
border-spacing: 0px;
}
tr.selected {
color: white;
background-color: #3366CC;
}
tr.unavailable, tr.closed {
color: silver;
background-color: white;
}
tr.unavailable:hover {
color: silver;
background-color: #3366CC;
}
tr.action, tr.refinement, tr.wrapper, tr.tree {
color: black;
background-color: white;
}
tr.action:hover, tr.refinement:hover, tr.wrapper:hover, tr.tree:hover {
color: white;
background-color: #3366CC;
}
td.action {
width: 220px;
margin: 0px;
padding: 0px;
}
td.refinement, td.wrapper, td.tree {
width: 515px;
margin: 0px;
padding: 0px;
}
td.hotKey {
width: 30px;
margin: 0px;
padding: 0px;
text-align: right;
}
td.language {
color: black;
background-color: white;
}
td.language:hover {
color: blue;
background-color: white;
text-decoration: underline;
}
td.selected {
color: white;
background-color: #3366CC;
}
td.selected:hover {
color: white;
background-color: #3366CC;
text-decoration: underline;
}
p {
margin-bottom: 40px;
text-align: justify;
}
span.normal {
color: black;
background-color: white;
text-decoration: none;
}
span.selected {
color: white;
background-color: #3366CC;
text-decoration: none;
}