On Nov 26, 2007 1:57 PM, Timo Ernst <[EMAIL PROTECTED]> wrote:
> Henry Minsky wrote:
> > There are some older design documents around which I will try to dig up
> > for you.
>
> That would be awesome :)
>
> > There are basically two phases in the Interface Compiler (also called
> > the "tag compiler"):
>
> I though the Interface Compiler consists actually of the Tag Compiler
> and the Script Compiler and is not the Tag Compiler itself? (According
> to http://www.openlaszlo.org/lps4/docs/developers/architecture.html#d0e412)
>
> > Attribute values which declare constraints are
> > annotated so that the script compiler will find and add constraint
> > dependencies for them.
> > The javascript which the tag compiler produces is mostly nested lists
> > containing all the information
> > needed to instantiate classes and views with their nested parent/child
> > nesting relationships.
>
> Could you explain this a bit more detailed to me?
> My english is horrible :)
>
There is some older reference material in the source tree under the
directory docs/src/internal, you
should look at the compiler.html and script-compiler.html files in particular.
An example of the basic transformation will make it clearer:
This code
<view name="foo">
<view width="50" height="50" bgcolor="red"/>
<text y="50">This is some text</text>
</view>
compiles into this javascript
LzInstantiateView({attrs: {name: "foo"},
children: [{attrs: {bgcolor: 0xff0000
,height: 50
,width: 50
}, name: "view"}, {attrs: {font:
"Verdana,Vera,sans-serif"
,fontsize: 11
,fontstyle: "plain"
,text: "This is some text", y: 50
}, name: "text"}], name: "view"}, 3);
This is simply a (potentially deep) nested list containing the child
view hierarchy, with attributes attached.
In the case of methods and event handlers, these are also passed in as
attribute values which are functions.
You can try out for yourself if you run the command line compiler with
the --script option:
lzc --script foo.lzx
that will output the javascript which is passed to the script compiler.
There are some internal transformations done inside the script
compiler on the javascript,
in particular to handle constraint functions, but also to convert
Javascript 2.0 class declarations
into Javascript 1.0 -compatible code.
> Thanks for your help so far.
> I really appreciate it.
>
> Timo
>
> --
>
>
> http://www.timo-ernst.net
>
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]