parsifal-47 / sisal-js

Javascript interpreter for sisal
BSD 2-Clause "Simplified" License
3 stars 0 forks source link

Add constant arrays, streams and unions #1

Open parsifal-47 opened 10 years ago

parsifal-47 commented 10 years ago

current version (as described in BNF) seems to be not really useful so I decided to use Sisal 2.0 arrays as the base. Related article is "A formal semantics for Sisal arrays" by Isabelle Attali et al

according to BNF array constant should look like: array _optional_arrayid [_optional_arraytype] {_optional_first_index; _optional_array_list}

in Sisial 3.0 description document ";" is replaced by "!" and multidimensional array is always array of arrays unlike Sisal 2.0 where you can create multidimensional arrays, so it is more usable to keep Sisal 2.0 notation: array type [_size_descriptor: _array_part_list] as described in referred article

parsifal-47 commented 10 years ago

_array_part_list represent array parts separated by ";" if there is only one part -- it should be something like 1,2,3. If not, something like 8.. : [1,2,3] or [1,2,3] : 8 (for three-dimensional array). Or it can be "otherwise". Of course there are lot situations when the definition syntax will be correct but ambiguous or meaningless. for further examples check out the article

parsifal-47 commented 10 years ago

currently only array[integer] [1:1,2,3] one-dimension arrays are implemented, more to be done