On Sun, 2006-09-10 at 20:07 -0400, Peter Tanski wrote:

> 
> Thanks for the insight.  Felix must also perform a little semantic
> analysis while parsing 

It does. Well not 'semantic' analysis, but it does analyse
the syntax before chosing which AST node to emit. For example

        endl;
        endl ();

are *syntactically* equivalent. This isn't a type thing, rather:

        match expr with
        | apply(a,b) -> apply(a,b)
        | x -> apply(x,())

is used. Thus, the transform also applies to macros.

This transformation isn't "sound" in some sense,
because there's no way to write 'x' and have 'x'
come out: it relies on the fact that the statement:

        expr;

is never well formed unless it is a procedure application.
The transform could break if this invariant were invalidated
by some other change.

> because function names (though prefixed with 'fun') and certain
> keywords, such as 'list' and 'typeclass' are appended with
> square-bracketed material:
> 
> 
> fun f[T1,T2] 
> typeclass[T1,T2]
> list[int]
> 

list isn't a keyword :)

unqualified names are encoded by

        `AST_name (sr,name,ts)

where

        sr is the line/column position
        name is a string of the identifier
        ts is a list of types

Thus

        fred

is actually encoded in Ocaml as

        `AST_name (some_loc, "fred",[])

where [] is an empty list. This is an atomic form in expressions:

        x[int,long]

is an atom. ALL names can be subscripted, everything is
first order polymorphic.

Sometimes the parser won't accept subscripts, and sometimes
the subscripts have to be an empty list, but the AST term
always allows them (for names in expressions). Definitions
are different.





-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to