Pages: 1
I need basic, simple libraries of the following:
• Comment tokens
• String tokens
• Syntax tokens (flow controllers like if)
• Properties, events, and methods
for as many languages as we can get. Specifically, I'm looking for:
• Squeak
• JavaScript
• Java
• PHP
• C
• Objective-C
• HTML (<> should be written as < and &rt)
Here's the syntax to share something:
if (lang == "language")
{
commentTokens = [["openCommentToken", "closeCommentToken"], ["openCommentToken", "closeCommentToken"]];
stringTokens = [["openStringToken", "closeStringToken"], ["openStringToken", "closeStringToken"]];
syntaxTokens = ["token 1", "token 2", "token 3"];
properties = ["token 1", "token 2", "token 3"];
}Please contribute!
—Hardmath123
EDIT: Here's a starter for JS:
if (lang=="JavaScript")
{
syntaxTokens = ["if", "else", "var", "function", "return", "this", "new", "true", "false", "while", "break", "case", "switch", "for", "document", "window", "String", "Array", "Object", "Window", "Math"];
numericalTokens = ["1","2","3","4","5","6","7","8","9","0"];
blockTokens = [["\"", "\""], ["\'", "\'"], ["@\"", "\""]];
commentTokens = [["/*", "*/"], ["//", "\n"]];
tempVars = prompt("Temporary variables?", "something, nothing, anything").split(", ");
properties=["getElementById", "getContext", "prototype", "constructor", "alert", "confirm", "prompt", "sqrt", "pow", "PI", "value", "innerHTML", "height", "width", "cols", "rows", "style", "onload", "onclick", "ondblclick", "onmouseover", "onmouseout", "onmousemove", "onmousedown", "onmouseup", "onkeyup", "onkeydown", "onkeypress", "onbeforeunload"];
}Or highlighted:
if (lang=="JavaScript")
{
syntaxTokens = ["if", "else", "var", "function", "return", "this", "new", "true", "false", "while", "break", "case", "switch", "for", "document", "window", "String", "Array", "Object", "Window", "Math"];
numericalTokens = ["1","2","3","4","5","6","7","8","9","0"];
blockTokens = [["\"", "\""], ["\'", "\'"], ["@\"", "\""]];
commentTokens = [["/*", "*/"], ["//", "\n"]];
tempVars = prompt("Temporary variables?", "something, nothing, anything").split(", ");
properties=["getElementById", "getContext", "prototype", "constructor", "alert", "confirm", "prompt", "sqrt", "pow", "PI", "value", "innerHTML", "height", "width", "cols", "rows", "style", "onload", "onclick", "ondblclick", "onmouseover", "onmouseout", "onmousemove", "onmousedown", "onmouseup", "onkeyup", "onkeydown", "onkeypress", "onbeforeunload"];
}
Last edited by Hardmath123 (2011-12-19 08:14:51)
Offline
Daffy22 wrote:
What language are you doing this in? Php?
JavaScript, actually. You should have been able to tell by the sample code!
Last edited by Hardmath123 (2011-12-19 08:15:34)
Offline
Pages: 1