-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michael Schmidt <[email protected]>
- Loading branch information
1 parent
342a003
commit 1134bdf
Showing
14 changed files
with
287 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,19 @@ | ||
(function (Prism) { | ||
Prism.languages.bbj = { | ||
'comment': { | ||
pattern: /(^|[^\\:])rem\s+.*/i, | ||
lookbehind: true, | ||
greedy: true | ||
}, | ||
'string': { | ||
pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, | ||
greedy: true | ||
}, | ||
'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, | ||
'keyword': /\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|delete|dom|dread|dsz|else|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|private|process_events|protected|psz|public|read_resource|remove_callback|restore|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i, | ||
'function': /\b\w+(?=\()/, | ||
'boolean': /\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i, | ||
'operator': /<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i, | ||
'punctuation': /[.,;:()]/ | ||
}; | ||
}(Prism)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,63 @@ | ||
<h2>Routines example</h2> | ||
<pre><code> | ||
use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget | ||
use com.basiscomponents.db.ResultSet | ||
use com.basiscomponents.bc.SqlQueryBC | ||
|
||
declare auto BBjTopLevelWindow wnd! | ||
wnd! = BBjAPI().openSysGui("X0").addWindow(10, 10, 800, 600, "My First Grid") | ||
wnd!.setCallback(BBjAPI.ON_CLOSE,"byebye") | ||
|
||
gosub main | ||
process_events | ||
|
||
rem Retrieve the data from the database and configure the grid | ||
main: | ||
declare SqlQueryBC sbc! | ||
declare ResultSet rs! | ||
declare BBjGridExWidget grid! | ||
|
||
sbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("CDStore")) | ||
rs! = sbc!.retrieve("SELECT * FROM CDINVENTORY") | ||
|
||
grid! = new BBjGridExWidget(wnd!, 100, 0, 0, 800, 600) | ||
grid!.setData(rs!) | ||
return | ||
|
||
byebye: | ||
bye | ||
</code></pre> | ||
|
||
<h2>OOP example</h2> | ||
<pre><code> | ||
use java.util.Arrays | ||
use java.util.ArrayList | ||
use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget | ||
|
||
rem /** | ||
rem * This file is part of the MyPackage. | ||
rem * | ||
rem * For the full copyright and license information, please view the LICENSE | ||
rem * file that was distributed with this source code. | ||
rem */ | ||
rem /** | ||
|
||
class public Employee | ||
field public BBjNumber ID | ||
field public BBjString Name$ | ||
classend | ||
|
||
class public Salaried extends Employee implements Payable | ||
field public BBjNumber MonthlySalary | ||
method public BBjNumber pay() | ||
methodret #MonthlySalary | ||
methodend | ||
method public void print() | ||
print "Employee",#getID(),": ",#getName() | ||
print #pay():"($###,###.00)" | ||
methodend | ||
method public BBjNumber account() | ||
methodret 11111 | ||
methodend | ||
classend | ||
</code></pre> |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,13 @@ | ||
BBjAPI.FALSE | ||
BBjAPI.TRUE | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["boolean", "BBjAPI.FALSE"], | ||
["boolean", "BBjAPI.TRUE"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for booleans. |
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,25 @@ | ||
rem Single line comment | ||
|
||
rem /** | ||
rem * This file is part of the X plugin. | ||
rem * | ||
rem * For the full copyright and license information, please view the LICENSE | ||
rem * file that was distributed with this source code. | ||
rem */ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "rem Single line comment"], | ||
|
||
["comment", "rem /**"], | ||
["comment", "rem * This file is part of the X plugin."], | ||
["comment", "rem *"], | ||
["comment", "rem * For the full copyright and license information, please view the LICENSE"], | ||
["comment", "rem * file that was distributed with this source code."], | ||
["comment", "rem */"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
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,94 @@ | ||
abstract all argc begin bye callback case chn class classend ctl day delete dom dread dsz else | ||
endif err exitto extends fi field field for from gosub goto if implements interface interfaceend | ||
iol iolist let list load method methodend methodret on opts pfx private private process_events | ||
protected protected psz public public read_resource remove_callback restore rev seterr setesc sqlchn | ||
sqlunt ssn start static static swend switch sys then tim unt until void void wend where while use | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "abstract"], | ||
["keyword", "all"], | ||
["keyword", "argc"], | ||
["keyword", "begin"], | ||
["keyword", "bye"], | ||
["keyword", "callback"], | ||
["keyword", "case"], | ||
["keyword", "chn"], | ||
["keyword", "class"], | ||
["keyword", "classend"], | ||
["keyword", "ctl"], | ||
["keyword", "day"], | ||
["keyword", "delete"], | ||
["keyword", "dom"], | ||
["keyword", "dread"], | ||
["keyword", "dsz"], | ||
["keyword", "else"], | ||
|
||
["keyword", "endif"], | ||
["keyword", "err"], | ||
["keyword", "exitto"], | ||
["keyword", "extends"], | ||
["keyword", "fi"], | ||
["keyword", "field"], | ||
["keyword", "field"], | ||
["keyword", "for"], | ||
["keyword", "from"], | ||
["keyword", "gosub"], | ||
["keyword", "goto"], | ||
["keyword", "if"], | ||
["keyword", "implements"], | ||
["keyword", "interface"], | ||
["keyword", "interfaceend"], | ||
|
||
["keyword", "iol"], | ||
["keyword", "iolist"], | ||
["keyword", "let"], | ||
["keyword", "list"], | ||
["keyword", "load"], | ||
["keyword", "method"], | ||
["keyword", "methodend"], | ||
["keyword", "methodret"], | ||
["keyword", "on"], | ||
["keyword", "opts"], | ||
["keyword", "pfx"], | ||
["keyword", "private"], | ||
["keyword", "private"], | ||
["keyword", "process_events"], | ||
|
||
["keyword", "protected"], | ||
["keyword", "protected"], | ||
["keyword", "psz"], | ||
["keyword", "public"], | ||
["keyword", "public"], | ||
["keyword", "read_resource"], | ||
["keyword", "remove_callback"], | ||
["keyword", "restore"], | ||
["keyword", "rev"], | ||
["keyword", "seterr"], | ||
["keyword", "setesc"], | ||
["keyword", "sqlchn"], | ||
|
||
["keyword", "sqlunt"], | ||
["keyword", "ssn"], | ||
["keyword", "start"], | ||
["keyword", "static"], | ||
["keyword", "static"], | ||
["keyword", "swend"], | ||
["keyword", "switch"], | ||
["keyword", "sys"], | ||
["keyword", "then"], | ||
["keyword", "tim"], | ||
["keyword", "unt"], | ||
["keyword", "until"], | ||
["keyword", "void"], | ||
["keyword", "void"], | ||
["keyword", "wend"], | ||
["keyword", "where"], | ||
["keyword", "while"], | ||
["keyword", "use"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for keywords. |
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,19 @@ | ||
42 | ||
3.14159 | ||
2e8 | ||
3.4E-9 | ||
0.7E+12 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["number", "42"], | ||
["number", "3.14159"], | ||
["number", "2e8"], | ||
["number", "3.4E-9"], | ||
["number", "0.7E+12"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for numbers. |
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,21 @@ | ||
or xor not and > >= < <= + =* | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "or"], | ||
["operator", "xor"], | ||
["operator", "not"], | ||
["operator", "and"], | ||
["operator", ">"], | ||
["operator", ">="], | ||
["operator", "<"], | ||
["operator", "<="], | ||
["operator", "+"], | ||
["operator", "="], | ||
["operator", "*"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for operators. |
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,12 @@ | ||
, ; : ( ) . | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["punctuation", ","], | ||
["punctuation", ";"], | ||
["punctuation", ":"], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", "."] | ||
] |
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,13 @@ | ||
"" | ||
"fo""obar" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["string", "\"\""], | ||
["string", "\"fo\"\"obar\""] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for strings. |