Archived
1
0
Commit Graph

93 Commits

Author SHA1 Message Date
Jacob Alexander
fd106b77f2 Adding basic Travis-CI tests to kll compiler
- Just sanity checks to make sure all the system modules load and there are no syntax errors
2016-09-27 17:17:42 -07:00
Jacob Alexander
dabeb2270e Fix for Python 3 incompatibility with os.cpu_count 2016-09-27 16:23:28 -07:00
Jacob Alexander
db89fd4830 Initial pixel hard-coded template
- As the KLL compiler adds more features the kiibohdPixelmap.c will become more auto-generated
2016-09-18 00:49:55 -07:00
Jacob Alexander
a008e03b22 Adding support for pixelmap output and backporting features to 0.3d
- Enables support for running both kll 0.3d and 0.5c at the same time
- Adds output support for generatedPixelmap.c
- Adds a --version to 0.3d
2016-09-11 12:40:10 -07:00
Jacob Alexander
44addcf031 Merge branch 'master' into dev 2016-09-11 11:10:00 -07:00
Jacob Alexander
f610d0fb15 KLL Compiler Re-Write
This was many months of efforts in re-designing how the KLL compiler should work.
The major problem with the original compiler was how difficult it was to extend language wise.
This lead to many delays in KLL 0.4 and 0.5 being implemented.

The new design is a multi-staged compiler, where even tokenization occurs over multiple stages.
This allows individual parsing and token regexes to be expressed more simply without affect other expressions.

Another area of change is the concept of Contexts.
In the original KLL compiler the idea of a cache assigned was "hacked" on when I realized the language was "broken" (after nearly finishing the compiler).
Since assignment order is generally considered not to matter for keymappings, I created a "cached" assignment where the whole file is read into a sub-datastructure, then apply to the master datastructure.
Unfortunately, this wasn't really all that clear, so it was annoying to work with.
To remedy this, I created KLL Contexts, which contain information about a group of expressions.
Not only can these groups can be merged with other Contexts, they have historical data about how they were generated allowing for errors very late in processing to be pin-pointed back to the offending kll file.

Backends work nearly the same as they did before.
However, all call-backs for capability evaluations have been removed.
This makes the interface much cleaner as Contexts can only be symbolically merged now.
(Previously datastructures did evaluation merges where the ScanCode or Capability was looked up right before passing to the backend, but this required additional information from the backend).

Many of the old parsing and tokenization rules have been reused, along with the hid_dict.py code.

The new design takes advantage of processor pools to handle multithreading where it makes sense.
For example, all specified files are loaded into ram simulatenously rather than sparingly reading from.
The reason for this is so that each Context always has all the information it requires at all times.

kll
- Program entry point (previously kll.py)
- Very small now, does some setting up of command-line args
- Most command-line args are specified by the corresponding processing stage

common/channel.py
- Pixel Channel container classes

common/context.py
- Context container classes
- As is usual with other files, blank classes inherit a base class
- These blank classes are identified by the class name itself to handle special behaviour
- And if/when necessary functions are re-implemented
- MergeConext class facilitates merging of contexts while maintaining lineage

common/expression.py
- Expression container classes
  * Expression base class
  * AssignmentExpression
  * NameAssociationExpression
  * DataAssociationExpression
  * MapExpression
- These classes are used to store expressions after they have finished parsing and tokenization

common/file.py
- Container class for files being read by the KLL compiler

common/emitter.py
- Base class for all KLL emitters
- TextEmitter for dealing with text file templates

common/hid_dict.py
- Slightly modified version of kll_lib/hid_dict.py

common/id.py
- Identification container classes
- Used to indentify different types of elements used within the KLL language

common/modifier.py
- Container classes for animation and pixel change functions

common/organization.py
- Data structure merging container classes
- Contains all the sub-datastructure classes as well
- The Organization class handles the merge orchestration and expression insertion

common/parse.py
- Parsing rules for funcparserlib
- Much of this file was taken from the original kll.py
- Many changes to support the multi-stage processing and support KLL 0.5

common/position.py
- Container class dealing with physical positions

common/schedule.py
- Container class dealing with scheduling and timing events

common/stage.py
- Contains ControlStage and main Stage classes
  * CompilerConfigurationStage
  * FileImportStage
  * PreprocessorStage
  * OperationClassificationStage
  * OperationSpecificsStage
  * OperationOrganizationStage
  * DataOrganziationStage
  * DataFinalizationStage
  * DataAnalysisStage
  * CodeGenerationStage
  * ReportGenerationStage
- Each of these classes controls the life-cycle of each stage
- If multi-threading is desired, it must be handled within the class
  * The next stage will not start until the current stage is finished
- Errors are handled such that as many errors as possible are recorded before forcing an exit
  * The exit is handled at the end of each stage if necessary
- Command-line arguments for each stage can be defined if necessary (they are given their own grouping)
- Each stage can pull variables and functions from other stages if necessary using a name lookup
  * This means you don't have to worry about over-arching datastructures

emitters/emitters.py
- Container class for KLL emitters
- Handles emitter setup and selection

emitters/kiibohd/kiibohd.py
- kiibohd .h file KLL emitter
- Re-uses some backend code from the original KLL compiler

funcparserlib/parser.py
- Added debug mode control

examples/assignment.kll
examples/defaultMapExample.kll
examples/example.kll
examples/hhkbpro2.kll
examples/leds.kll
examples/mapping.kll
examples/simple1.kll
examples/simple2.kll
examples/simpleExample.kll
examples/state_scheduling.kll
- Updating/Adding rules for new compiler and KLL 0.4 + KLL 0.5 support
2016-09-01 23:48:13 -07:00
Jacob Alexander
1a078b2b94 Typo in Programmer's Dvorak
- KLL 0.3d doesn't support single quote expansion combos
- Small typo
2016-08-06 20:50:00 -07:00
Jacob Alexander
0e898827ca Initial version of Programmers Dvorak
http://www.kaufmann.no/roland/dvorak/
Requires blockKey capability

Caveats:
1) Requires US ANSI locale set on host computer
2) AltGr keys aren't working (needs to be based on a different locale)
3) Some shortcuts may not behave correctly due to Shift masking
2016-08-06 20:43:06 -07:00
Jacob Alexander
33a1654b97 Adding IRC link 2016-08-01 17:32:53 -07:00
Jacob Alexander
5865fd7b97 Added hint for beginners 2016-07-18 09:06:59 -07:00
Jacob Alexander
7c2848a6cd Fixing link to travis-ci 2016-07-17 14:35:01 -07:00
Jacob Alexander
e3aff084c4 Adding travis-ci indicator and updating info 2016-07-17 14:24:21 -07:00
Jacob Alexander
6135cbb832 Forcing UTF-8 when reading files
- I blame Ubuntu...
- Can't the world just get along and UTF-8 already?
2016-05-08 23:25:11 -07:00
Jacob Alexander
2eb41e3a13 Updating KLL to generate _KLL defines for upcoming firmware update
- Compatible with earlier Kiibohd firmware
2016-05-08 17:49:05 -07:00
Jacob Alexander
034927e13b Merge pull request #7 from cryham/check
Added check for too small stateWordSize (default 8) showing: Over 255…
2016-05-08 17:16:41 -07:00
CryHam
7df43b62bf added print stateWordSize from value when changing,
removed regular count prints
2016-05-08 09:07:06 +02:00
CryHam
9965ccb48e Added check for too small stateWordSize (default 8) showing: Over 255 trigger or result macros, changing stateWordSize to 16. 2016-05-07 21:53:32 +02:00
Jacob Alexander
323dd65d42 Adding a few more mouse tests 2016-03-21 23:06:27 -07:00
Jacob Alexander
d3e0c3d7a7 Adding support for relative movement mouse keys
- Includes kll.py cleanup
- Fixed negative number generation and parsing
2016-03-21 22:22:13 -07:00
Jacob Alexander
55ffc6bdc5 Adding basic mouse button test .kll file
- Will need to be updated for full KLL mouse support later
2016-03-21 00:41:49 -07:00
Jacob Alexander
c2a798f1cb First pass at parsing rules for KLL 0.4
(Yep, definitely started 0.5 first :P)

- Not functional yet, do not use
2016-01-25 00:33:52 -08:00
Jacob Alexander
9110f81e97 First pass at parsing rules for KLL 0.5 2016-01-21 00:51:30 -08:00
Jacob Alexander
b6cf0f13a8 Adding support for kll 0.3d
- Adding brightness control hid extension http://www.usb.org/developers/hidpage/HUTRR41.pdf
- Adding next keyboard layout support http://www.usb.org/developers/hidpage/HUTRR56B_Application_Keyboard_Layout_Selector.pdf
2015-10-17 15:08:34 -07:00
Jacob Alexander
eddfdfeb89 Fixing partial map static layer compilation bug
- Processing order was not correct
2015-10-12 23:27:34 -07:00
Jacob Alexander
274dd6c17b Another error message cleanup 2015-10-12 22:59:12 -07:00
Jacob Alexander
25c836048e Adding better error messages for Tokenization and Parsing
- More msg, less stack trace
2015-10-12 22:42:32 -07:00
Jacob Alexander
c3ec73860d Updating hhkb2 definition to match recent symbolic name fix 2015-10-12 18:56:21 -07:00
Jacob Alexander
4c4bb41977 Cleanup 2015-10-11 22:25:03 -07:00
Jacob Alexander
a18ed32ca3 Adding aliases for international keys 2015-10-09 23:12:04 -07:00
Jacob Alexander
26437c35ad Fixing ascii string macro processing
- Fixing very old naming convention Brace to Bracket
- For now, accepting the old Brace names (will be deprecated at some point)
2015-10-07 20:05:44 -07:00
Jacob Alexander
f1bad4de4b Fixing AL and AC namespaced Consumer control media keys 2015-10-01 22:28:36 -07:00
Jacob Alexander
e381131176 Adding support for "Soft Replace" kll 0.3c
- Updated both FuncMaps to use Soft Replace
- Only used for layers, default and base maps are not affected by soft replace (works like a normal replace)
2015-09-30 00:04:30 -07:00
Jacob Alexander
57d01ed872 Adding layer rotation (next/prev) support
- Includes symbolic names
2015-09-28 20:00:22 -07:00
Jacob Alexander
cf5bba7039 Adding Lock and Latch symbolic names (e.g. Function)
- Like Function, these are not valid USB codes, but can be used to easily refer a particular key (no possible with exact name)

U"Lock1"  : layerLock( 1 );
U"Latch1" : layerLatch( 1 );
2015-09-20 14:45:42 -07:00
Jacob Alexander
8120771175 Typo 2015-09-18 00:25:18 -07:00
Jacob Alexander
a0b768211a Adding cabilities index to kll compiler
- Including remote reload example configuration
2015-09-18 00:09:17 -07:00
Jacob Alexander
99cd939f8a Fixing reference url 2015-08-21 20:43:04 -07:00
Jacob Alexander
381e0a37f5 Adding Infinity ErgoDox default layers and overlay 2015-08-21 19:36:03 -07:00
Jacob Alexander
60b08f8564 Updating Infinity layers now that media keys are fully working 2015-08-21 19:35:22 -07:00
Jacob Alexander
2b5a666b0b Adding colors associations to layers.
- All colors (except Fanta Orange) have been reduced by 75%
2015-08-18 10:45:57 -07:00
Jacob Alexander
6648cb507a Special function map used for LCD layer display hooks 2015-08-18 01:11:51 -07:00
Jacob Alexander
296fc5946c Adding convenience capability function declarations.
- This makes it easier to define capabilties in any C file
2015-08-18 01:09:52 -07:00
Jacob Alexander
5f8880d7ef Example kll map using CustomActions on MD1 2015-08-16 14:46:04 -07:00
Jacob Alexander
ea854aa95f Fixing '~' interpreting bug. 2015-08-16 14:41:19 -07:00
Jacob Alexander
80c948fa33 Adding WhiteFox layer 1 2015-08-16 12:28:32 -07:00
Jacob Alexander
114d666bd8 Adding support for Interconnect Nodes
- Required changing the ScanCode node datastructure
- Interconnect Id's must be stored until the end as it's not possible to calculate the max per node ScanCode until after all the assignments are complete
- Should make future additions more straight-forward (that require per ScanCode information to be stored)
2015-08-15 21:29:18 -07:00
Jacob Alexander
6456b05951 Merge branch 'master' of github.com:kiibohd/kll 2015-08-02 13:42:38 -07:00
Jacob Alexander
9107650076 Adding support for multi-line defines 2015-08-02 13:42:16 -07:00
Jacob Alexander
f3451f619c Updating url 2015-08-01 10:45:50 -07:00
Jacob Alexander
59a7455cd9 Converting templates to use pragma once 2015-07-25 16:11:24 -07:00