To help us all solve the same problem, I'm submitting this as a syntax. I mix lexical and syntactic, and imply that whitespace is ignored between tokens. I also assume */ is higher than +-. Please comment.john
You have this niceThreading Challenge forum, which is easy to get to, but to get a copy of the rules for the particular challenge you have several click hoop jumps to find the rules. Can you please place in each threading challenge forum a sticky thread containing current and revised rules for that challenge. Example:
Official rules (PDF):http://software.intel.com/file/m/36890
The .PDF filerules state the line termination character is semicolon (;) and makes no reference as to what constitutes an inputline, in particularis it CR, LF, CRLF or the aformentioned are considered whitespace. Meaning
var x=50;var y=10
; var z = 9;
is valid input. I will have to assume since this is not mentioned that this is left as an implementation detail
Note, in your "Valid keywords and functions" table, section "var", lines 3 and 4, column Examples has
var decimal =
Can we get more specifics on input encoding? There is some mention of "entities" regaridng quotes. Does that mean UTF-8 is possible? UTF-16 with BOM? HTML or XML entity codes other than quote?
int i = 5 / 2;
var i = 5 / 2;
gives us i = 2.5.Which of these is valid?
1) Is it possible to define a variable and initialize it later?
For example, var x;
x = 1;
2) Can type of variable change after its first definition?
For example, var i = 1;
i = 2;
i = 2.0;
i = "i";
What is definition of value mentioned in, for example, string(variableName | value)? Are value and expression same? It looks like that value can take the form 32 * 12 * multiplier.
What can be value of right hand side of arithmetic = operator?
there are various errors that may occur - syntax errors, type coercion errors (using a number where a string is expected), arithmetic errors (divide by 0), and possibly others (overflow?)I guess the error message, line number etc. is written to stderr. What output is expected to be written to the output file when these errors occur? Is the output ignored, oor should it contain all output statements up to the point of the line that is in error?
If entities are to be recognised, is it just specifically these two, or should all XML entities and character references be recognised, e.g. & and other character refereneces, say A for 'A'.
What is allowed within a string?Will quotes appear within strings? Are entities within strings allowed?
do we have to deal with arbitrary precision numbers