Drew is an implementation of DML language specification.
DML is a lightweight UI description language.
Drew's basic idea is similar to QML.
However, drew has simpler grammar than QML, lighter than Javascript, and, much cheaper than QT.
QML is a combination of Javascript, QML language, and QT.
Drew is a combination of Lua script, DML language, and GTK.
./configure
make
sudo make install
If you want to create the debian package, do as follows
make deb
example/hello.drew
or
drew example/hello.drew
If you want to see the debug messages, do as follows
example/hello.drew -d
or
drew example/hello.drew -d
If you want to see the debug messages and verbose messages, do as follows
example/hello.drew -v
or
drew example/hello.drew -v
If you want to see the help screen, do as follows
drew -h
or
drew --help
DML(Drew Meta Language) is a UI description language.
Following form is a description of DML in e-BNF.
INTEGER := [0-9]+
FLOATING := IEEE759 floating point
CODE := '{' [ . | \n ]* '}'
STRING := ".*"
SYMBOL := [._]*
BOOL := true | false
VALUE := BOOL | STRING | FLOATING | INTEGER
TUPLE := SYMBOL ':' VALUE
LIST := SYMBOL '[' VALUE* ']'
SCRIPT := SYMBOL '(' SYMBOL* ')' CODE
DICTIONARY := SYMBOL '{' [ TUPLE | LIST | DICTIONARY ]* '}'
DML := meta_sentence gui_sentence
meta_sentence := version ':' FLOATING | profile ':' STRING
gui_sentence := '_on_init' window_sentence
window_sentence := window { window_content }
window_content := border : INTEGER | _on_destroy SCRIPT | _before_destroy SCRIPT | button_sentence
button_sentence := button { button_content }
button_content := label : STRING | _on_click SCRIPT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
The window sentence represents the window widget in the graphic widget library.
border(property) : sets the thickness of the window.
_before_destroy : is called before the window is closed. if it returns true, the winodw will not close. Otherwise, it closes.
_on_destroy : is called when the window is closed.
The button sentence represents the button widget in the graphic widget library.
label : sets the caption of the button.
_on_click : is called when the button is clicked.
quit : quit the DML application
verbose : log verbose message on cerr. It works only when drew is executed with -v or --verbose argument
debug : log debug message on cerr. It works only when drew is executed with -d or --debug argument
print : print the arguments to cout.
Drew is under MIT license.
Drew Scheneman, my first English teacher who taught me English in English