entities and syntax clarification

entities and syntax clarification

The text mentions javascript and also the XML entities " and " Is the parser expected to handle these entities or are these just by way of example/clarification/obfuscation?
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 &#65 for 'A'.
What is allowed within a string?Will quotes appear within strings? Are entities within strings allowed?
Finally, great to see specific mention of signed types - what's the minimum range of integers that should be supported? Similarly for real types, is 32-bit or 64-bit real type required?

9 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Also, is the solution expected to handle newline and tab characters within quoted strings? or the \t, \n, \r ... escape sequences?

Which, if any, of the following are valid and what is the expected result?

var s1 = "abc\ndef\n\tghi";
var s2 = "abc
def
	ghi";

For that matter, what is the input encoding? ASCII? UTF-8? UTF-16?

I assumed that ASCII would be the encoding and that string literal escapes or entities (other than those mentioned) would not be recognized. It seems very odd to have valid statements like:var x = "abc";var y = &#34abc";Shouldn't that be """ ?I wonder if the PDF was just trying to make it clear what character was expected and not literally expecting us to use these variations.

What are the valid contents of a string?Since semicolon is the end of line terminator, is that legal in a string?

Hi,
Keeping it simple, characters in a string could be in the following range: [a...z], [A...Z], [0,9]. Hope this clarifies.

The string should be enclosed in double quotes ("). No support is expected of any XML entities.

Also, space is allowed in a string.

Thanks
-Rama

That clears things up.
Thanks Rama.

Welcome :-)... our intent is that you get a parallel parser implemented and focus on that instead of worrying about such nuances of syntax (which I agree are important). Happy coding!

Thanks
-Rama

Just to make things clearer, the problem specs tried to make it clear what character was expected. As Rama mentions in this thread, just ASCII code 34.No escape characters for the strings. We don't want to have a full printf implementation.Cheers,Gaston

Gastón C. Hillar

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi