[Grace-core] Parsing ambiguity

Andrew P. Black black at cs.pdx.edu
Tue Jul 1 15:47:18 PDT 2014


I have stubbled over this too.  As comparison operator, in minigrace, < and > must be surrounded by spaces.  I don’t believe that this is in the spec.

Why do we use < and > to delimit some arguments and ( and ) to delimit others?    Why not use a single mechanism and syntax for all arguments?

	Andrew


On 1 Jul 2014, at 0:12, James Noble <kjx at ecs.vuw.ac.nz> wrote:

> On 1/07/2014, at 19:08 pm, Marco Servetto <marco.servetto at gmail.com> wrote:
> 
>> so, is grace syntax space sensitive? in what way?
> 
> an horrible way.
> 
> Like Java and C++, in practice we use ad-hoc rules to distinguish "<" and ">" as operators or as angle brackets around generics.
> 
> We're also space sensitive regarding indentation of course, in particular when writing
> foo(x)
> bar(y)
> vs
> foo(x)
>   bar(y)
> 
> my grammar currently accepts these (or not)
> but I don't give any assurances about what the parse is..
> 
>> testProgramOn "run(a < B, C > 1)" wrongly "009tim-a"
>> testProgramOn "a < B, C > 1" wrongly "009tim-b"
>> testProgramOn "a<B,C>(1)" correctly "009tim-c"
>> testProgramOn "run(a < B, C >(1))" correctly "009tim-d"
> 
> J
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core




More information about the Grace-core mailing list