InputCommon: Add a new ExpressionParser to replace the old hack language

This contains a new, hand-written expression parser to replace the old
hack language based on string munging. The new approach is a simple
AST-based evaluation approach, instead of the "list of operations"
infix-based hack that there was before.

The new language for configuration has support for parentheses, and
counts "!" as a unary operator instead of the binary "NOT OR" operator
it was before. A simple example:

  (X & Y) | !B

Explicit device references, and complex device names ("Right Y+") are
handled with backticks and colons:

  (`SDL/0/6 axis joystick:Right X+` & `DInput/0/Keyboard Mouse:A`)

The basic editor UI that inserts tokens has not been updated to reflect
the new language.
This commit is contained in:
Jasper St. Pierre
2013-06-13 23:09:55 -04:00
parent 877106b027
commit 6246f6e815
7 changed files with 634 additions and 130 deletions

View File

@ -167,6 +167,7 @@
<ClCompile Include="Src\ControllerEmu.cpp" />
<ClCompile Include="Src\ControllerInterface\ControllerInterface.cpp" />
<ClCompile Include="Src\ControllerInterface\Device.cpp" />
<ClCompile Include="Src\ControllerInterface\ExpressionParser.cpp" />
<ClCompile Include="Src\ControllerInterface\DInput\DInput.cpp" />
<ClCompile Include="Src\ControllerInterface\DInput\DInputJoystick.cpp" />
<ClCompile Include="Src\ControllerInterface\DInput\DInputKeyboardMouse.cpp" />
@ -180,6 +181,7 @@
<ClInclude Include="Src\ControllerEmu.h" />
<ClInclude Include="Src\ControllerInterface\ControllerInterface.h" />
<ClInclude Include="Src\ControllerInterface\Device.h" />
<ClInclude Include="Src\ControllerInterface\ExpressionParser.h" />
<ClInclude Include="Src\ControllerInterface\DInput\DInput.h" />
<ClInclude Include="Src\ControllerInterface\DInput\DInputJoystick.h" />
<ClInclude Include="Src\ControllerInterface\DInput\DInputKeyboardMouse.h" />