Giff Language Specification - Owen2k6/GoOS GitHub Wiki
-
Identifiers:
A–Z a–z 0–9 _ .
(dot allowed). Case-insensitive when used as property keys. -
Numbers: decimal integers, may be negative (e.g.,
-12
,640
). -
Strings: single or double quotes. Supports escapes:
\n \r \t \\ \" \'
. -
Punctuation:
{ } = : ; , ( ) + - * / % $
. -
Comments:
//
to end of line. -
Hash words:
#word
(reserved for potential future directives; currently parsed as values where accepted).
Top level accepts multiple window
blocks:
window MyWin { ... }
window Another { ... }
Inside a window
or panel
block you may place controls, events, and properties:
- Controls:
label
,input
,button
,image
,listbox
,panel
. - Events:
onLoad { ... }
,onClose { ... }
(window only),onClick
,onChange
,onSelect
. - Properties:
key = value
orkey : value
orkey value
. End with optional;
.
A value may be:
-
String:
"text"
or'text'
-
Number:
320
-
Identifier:
true
,false
,white
,center
(treated as text tokens) -
Hash word:
#something
The parser writes properties into a dictionary of strings, then specific parsers convert to int
, bool
, or colour
.
Accepted truthy/falsey strings for boolean properties:
-
true
,1
→ true -
false
,0
→ false (Comparison is case-insensitive.)
background
/ backgroundColour
/ textColour
accept:
- Named:
white
,black
,lightgray|lightgrey
,gray|grey
,transparent
. - Hex:
#RRGGBB
orRRGGBB
.
For labels you may centre horizontally via any of:
centre
, centrex
, center
, centerx
(case-insensitive) → true|false
.