Commit Graph

101 Commits

Author SHA1 Message Date
Jordan Woyak
fd07ae8cec ExpressionParser: Move FunctionExpression type definitions into another file. 2019-10-11 18:12:16 -05:00
Jordan Woyak
d4f9b8c4ef ExpressionParser: Allow unary functions to be used without parens around the argument. e.g. !Up 2019-10-11 17:31:09 -05:00
Jordan Woyak
2a377e35ed ExpressionParser: Make function names case sensitive. 2019-10-11 17:31:09 -05:00
Jordan Woyak
2b0297489f ExpressionParser: Rename some functions and return a syntax error on trailing tokens. 2019-10-11 17:31:09 -05:00
Jordan Woyak
258832b1e8 ExpressionParser: Change function argument syntax to something more c++-like. 2019-10-11 17:31:09 -05:00
Jordan Woyak
ccac3f1e49 ExpressionParser: Fix negative literals and support unary minus operator. 2019-10-11 17:31:07 -05:00
Jordan Woyak
7cf903a209 ExpressionParser: Suppport N-ary functions. Arguments are read LISP style. N atoms are read after the function name. Added "if" function and made the "while" function more sensible with an arity of 2. Removed the ugly binary conditional operator. 2019-10-11 17:16:05 -05:00
Jordan Woyak
4dd078568b ExpressionParser: Replace the timer literal with a timer function that increases from 0.0 to 1.0 and resets after N seconds. e.g. (!timer 2.0) is a 2 second timer. Fixed parsing of unary expressions so things like (! ! 1.0) work. 2019-10-11 17:14:45 -05:00
Jordan Woyak
785eb14432 ExpressionParser: Clean up string lexing and support numeric literals without tick delimiter: e.g. 0.75 2019-10-11 17:14:45 -05:00
Jordan Woyak
fa75ab404f ExpressionParser: operator precedence. 2019-10-11 17:14:45 -05:00
Jordan Woyak
46c0ae7d1f ExpressionParser: Add !while loop unary expression. Limited to 10000 reps to prevent infinite loops. Rhs is re-evaluated until it is < 0.5. Added comma operator, which behaves like it does in c++. Added subration operator. 2019-10-11 17:14:45 -05:00
Jordan Woyak
2c89b60298 ExpressionParser: cleanup. 2019-10-11 17:14:45 -05:00
Jordan Woyak
58efc93ed4 ExpressionParser: Conditional operator. A binary op that evals the rhs if lhs > 0.5 else 0.0. 2019-10-11 17:14:45 -05:00
Jordan Woyak
718efce1dc ExpressionParser: Add less-than and greater-than operators. 2019-10-11 17:14:45 -05:00
Jordan Woyak
e896835f86 ExpressionParser: Renamed ControlFinder to ControlEnvironment. Added support for variables and assignment operator. ControlExpression objects now reference a matching input and output so the two can me mixed in any expression. (you can set rumble directly from inputs) 2019-10-11 17:14:32 -05:00
Jordan Woyak
1efcf861ea ExpressionParser: Add mod operator, sin function, and timer "constant" which can be used for auto-fire and oscillators. 2019-10-11 17:13:58 -05:00
Jordan Woyak
a8f3e9585f ExpressionParser: Expand ! symbol to allow for named unary functions. Added !toggle function which toggles on/off with each activation of its inner expression. 2019-10-11 17:13:58 -05:00
Jordan Woyak
bf63f85d73 ExpressionParser: Add multiplication and division operators. (division by zero evaluates as zero). Don't clamp result of addition operator. Clamping will be done later. 2019-10-11 17:13:58 -05:00
Jordan Woyak
f3192ca06d ExpressionParser: Add support for literals. 2019-10-11 17:13:58 -05:00
Lioncash
ec60027f56 InputCommon: Use nested namespace specifiers where applicable 2019-06-17 16:51:41 -04:00
Techjar
ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
spycrab
61350b3d98 Core/Host: Allow frontends to block inputs 2019-03-21 13:16:21 +01:00
Jordan Woyak
c389d68186 ControllerInterface/DolphinQt: Make mapping "all devices" way less hacky. 2019-03-03 18:39:02 -06:00
Jordan Woyak
48b69ca018 ControllerInterface: Input detection improvements. 2019-03-03 18:36:16 -06:00
Filip Gawin
49fe9f5db1 Use empty instead of size 2019-02-13 00:03:49 +01:00
Jordan Woyak
d5df56c677 ControllerInterface: Make CoalesceExpression not set the inactive child's value (rumble) to 0. This caused rumble to not enable when a control expression was both a valid "bareword" and "complex" expression. 2018-12-22 11:17:05 -06:00
Connor Roth
3e4725f390 THis fixes issue #08 and #16, the rumble test and slider 2018-04-19 17:48:55 -04:00
spycrab
40bb9974f2 Reformat all the things! 2018-04-12 21:28:39 +02:00
Michael M
294b1895ef ExpressionParser: std::move() tokens vector to parser 2017-09-14 12:53:36 -07:00
Michael M
31f1c06226 ControlReference: don't reparse expression when references are updated 2017-09-14 12:53:35 -07:00
Michael M
c332580b83 ControlReference/ExpressionParser: separate parsing from binding 2017-09-14 12:53:35 -07:00
Michael M
ba87a50338 ExpressionParser: add FallbackExpression node type 2017-09-14 12:53:35 -07:00
Michael M
7e74961eb1 ExpressionParser: expose ExpressionNode directly 2017-09-14 12:53:35 -07:00
Michael M
85301e2bae ParseStatus: replace NoDevice with EmptyExpression 2017-09-14 12:53:35 -07:00
Michael M
754efd75c5 ExpressionParser: remove DummyExpression 2017-09-14 12:53:35 -07:00
Michael M
f1ff1e3d08 ExpressionParser: clean up ControlExpression 2017-09-14 12:53:35 -07:00
Michael M
3df945f8d0 ExpressionParser: replace bare pointers with unique_ptrs 2017-09-14 12:53:35 -07:00
Michael M
bbb7c17235 ExpressionParser: use internal ParseResult struct instead of out-params 2017-09-14 12:53:35 -07:00
Michael M
d2821e14fa ParseExpression: return a std::pair 2017-09-14 12:53:34 -07:00
Michael Maltese
0019c34c73 DolphinWX: fix input bitmaps not working when background input is off 2017-07-12 00:12:07 -07:00
mimimi085181
b6ada2b633 Disable Background Input when Background Input is disabled
Only remaining issue is that clicking on the titlebar of the window, to give it focus, is already interpreted as input. But clicking on the window in the task bar, or using alt tab works to get back, without causing an input event.
2017-06-30 16:17:29 +02:00
Lioncash
05872336a9 ExpressionParser: Rename ParseStatus' Success member to Successful
This clashes with X11's preprocessor define named Success (because using
non-prefixed lowercase identifiers in C was apparently a fantastic idea
at some point), causing compilation errors.
2017-04-02 06:13:18 -04:00
Lioncash
d104e5e916 ExpressionParser: Convert parse state enum into an enum class 2017-02-28 05:07:21 -05:00
Lioncash
f0203157d4 ExpressionParser: Const-correctness changes 2017-02-26 02:09:34 -05:00
Lioncash
98145d2160 ControllerEmu: Add const to UpdateReferences() first reference parameter
None of these parameters are modified.
2017-02-11 00:31:49 -05:00
Lioncash
68dcb0f195 ControlReference: Add missing virtual destructor
ControllerEmu::Control instances have a unique_ptr<ControlReference>
member, which is passed either an InputReference or OutputReference.

Without this virtual destructor, deleting a derived class through a
pointer to the base class is undefined behavior.
2017-02-10 13:58:44 -05:00
Michael Maltese
2d51bf579f ControlReference: put parsed_expression in a unique_ptr 2017-02-07 22:59:29 -08:00
Michael Maltese
492d5b6ac7 ControlReference: hide parse_error behind GetParseStatus() 2017-02-07 22:59:26 -08:00
Michael Maltese
9a632ea7b9 ControlReference: hide is_input behind function 2017-02-07 22:59:21 -08:00
Michael Maltese
813a725f68 ControlReference: move function bodies out of header 2017-02-07 22:59:14 -08:00
Michael Maltese
a509f56116 InputCommon: Extract ControlReference from ControllerInterface
Better separation of concerns. Relegates `ControllerInterface` to
enumerating input controls, and the new `ControlReference` deals with
combining inputs and configuration expression parsing.
2017-02-07 22:59:10 -08:00