[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: concrete syntax problems in arch spec and views



Dear Frederic
 
> Are you sure that Christophe's approach is wrong ?? The current set
> of precedence rules for terms are to be applied whatever the current
> local environment is, and ordinary function application has the highest
> priority, higher than the one of mixfix application.

Cristophe's approach is such a sense wrong that (sub)terms of the following
form "f(x)" are always recognized as possible function application. I
tested his
parser in june. Maybe he made a new version already?
 
> Therefore, I would say that "f(x)" is to be recognized at parsing time as
a
> potential function application, the fact that "f" does exist or not (with
> the adequate signature) being checked during "static semantics" checks ?

I fully disagree. It is possible to do a correct recognisition at parsting
time
(see my mixfix parser in ASF+SDF). As far as I recall  the problem 
in Chris. parser is that he favours "f(x)" to much as an function
application.
As you have shown are there some situations where "f(x)" is a single
constant
f and a parenthesized constant x.

In my opinion the parsing of mixfix terms w.r.t. the structure of the
operations
is not a part of static semantics. The mixfix terms are parsed and grouped
correctly
w.r.t. their operationname, number of placeholders. 
After the grouping we can do static semantics and thus check whether the
sorts
are matched corretly. 

I hereby stress that the parsing (grouping) of mixfix terms is quite 
time-expontential and can grow in some cases extremly fast.    
Doing this during static semantics can be a waste of time, if grouping is
impossible.

beste regards
Bjarke