Hi all,

as I'm currently working hard on making the Java code generation strongly 
typed, I ran into a problem:
For typeSwitches we can't infer the types of the switch case constants as the 
inputs were expressions.

A quick search resulted in the fact, that not a single time were we actually 
using expressions, in all cases the input were variable literals.

So Sebastian and I refactored the code-gen and the mspec parsers to now only 
allow variable literals as inputs. The only obvious change this brings, is that 
now no longer the expression-ticks are allowed.

Second change is that constant fields had "expressions" as values. However this 
is actually not correct as constant fields can only have constants (If in java 
we had a const field with an expression, it wouldn't compile).
So we also changed constant fields to only allow valueLiterals, which are 
eigher bool, numeric (int or float), string or hexadecimal values. Now here 
also the expression ticks need to be omitted.

With these changes, I can now infer the type of a discriminator value and then 
correctly output the constant value (Like adding the "L" suffix to uint32 hex 
constants) ... this is what I'm going to work on next.

Hopefully after that's done, I'll be able to finish the PROFINET driver. 
(Famous last words)

Chris

Reply via email to