Archiviert
1
0
Dieses Repository ist archiviert. Du kannst Dateien ansehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.
kll/examples/leds.kll
Jacob Alexander 3cd55cf5a4 Updating KLL 0.5c lexer
- Added more complicated Animation definition expression
- Added 0.3d compiler lexer ignores (so it will still parse the 0.3d compatible sections of KLL 0.5)
- Improved funcparserlib/parser.py to include next token (if available) on NoParseError
2016-10-09 22:00:30 -07:00

81 Zeilen
2.4 KiB
Plaintext

Name = leds;
Author = "HaaTa (Jacob Alexander) 2016";
KLL = 0.5;
mydefine = "stuffs here";
mydefine2 = '"stuffs here"'; # For outputting c define strings
mynumber = 414;
# Array variables
myarray[] = elem0 elem1 "elem 2";
myarray[4] = test;
# Key Positioning
S120 <= x:20, rx:15;
S121 <= x:20, y:10, z:2, rx:15, ry:12, rz:39;
S[122-125] <= x:20, rx:15;
# Pixel Positioning
P19 <= x:21, rx:16;
P[20] <= x:20, rx:15;
P[21] <= x:20, y:10, z:2, rx:15, ry:12, rz:39;
P[22-25] <= x:20, rx:15;
# Pixel Channel Mapping
P[5](4:8, 5:8, 12:8) : None;
P[4](3:8) : S0x31;
P[12](40:8, 50:8, 120:8) : S59;
P[12](12:8, 13:8, 14:8) : S[40];
# Animation
A[BLEEdsing] <= loop:3,frame:2;
A[BLEEdsing2] <= loop,div:2;
# Animation Frames
A[BLEEdsing, 0] <= P[4](+32);
A[BLEEdsing, 1] <= P[4](42);
A[BLEEdsing, 2] <= P[4](-12);
A[BLEEdsing, 3] <= P[4](-:32);
A[BLEEdsing, 4] <= P[4](+:400);
A[BLEEdsing, 5] <= P[4](<<2);
A[BLEEdsing, 6] <= P[4](>>1);
A[BLEEdsing, 7-9] <= P[4](+32);
A[BLEEdsing, 10, 12] <= P[4](+32);
A[BLEEdsing, 11, 13-15] <= P[4-10](+32);
A[BLEEdsing2, 0] <= PL[0](127, 30, 40), P[5](20, 30, 40);
A[BLEEdsing2, 1] <= P[1-20,40](40,50,0x60);
A[BLEEdsing2, 2] <= P[c:0](40,50,0x60);
A[BLEEdsing2, 3] <= P[c:10%](40,50,0x60);
A[BLEEdsing2, 4] <= P[r:10%,c:20](40,50,0x60);
A[BLEEdsing2, 5] <= P[r:i+10%,c:i-20](40,50,0x60);
A[BLEEdsing2, 6] <= P[r:i+10%](40,50,0x60);
A[BLEEdsing2, 7] <= U["A"](40,50,0x60);
A[BLEEdsing2, 8] <= U"B"(40,50,0x60);
A[BLEEdsing2, 9] <= S120(40,50,0x60);
A[BLEEdsing2, 10] <= S[0x10](40,50,0x60);
A[RainbowFillInterp] <= start, interp:on;
A[RainbowFillInterp, 1] <= P[c:20%](255,255,0), P[c:40%](255,0,0), P[c:60%](127,0,255), P[c:80%](0,0,255);
A[RainbowFillInterp, 2] <= P[c:0%](0,255,0), P[c:20%](255,255,0), P[c:40%](255,0,0), P[c:60%](127,0,255), P[c:80%](0,0,255);
# Animation Triggers
myCapability => myFunc( myArg1 : 1, myArg2 : 4 );
A[BLEEdsing, 3] : myCapability( 0x8, 0x25 );
A[BLEEdsing, 4-6] : myCapability( 0x8, 0x25 );
A[BLEEdsing, 7, 9] : myCapability( 0x8, 0x25 );
A[BLEEdsing2] : myCapability( 0x8, 0x25 );
# Animation Results
S[0x37, 0x38] : A"BLEEdsing";
S0x39 : A"BLEEdsing", A"BLEEdsing2";
S0x40 : A[BLEEdsing];
S0x41 : A[BLEEdsing](loop:2);
S0x42 : A[BLEEdsing](loop:2,div:3);
S0x43 : PL[0](0xFF,0xFF,244) + P[1-3](20,40,60);
S0x44 : PL[0-2](0xFF,0xFF,244);
S0x44 : PL1(0xFF,0xFF,244);
S0x45 : PL[2](0x1F,0x2F,0x3F);
S0x46 : P[0](11,23,45);
S0x47 : P1(11,23,45);