[new compiler] Initial support for group properties

This implements support for "font.pixelSize: 24" for example. The representation
in the compile data structure is so that font.pixelSize is short-hand for

font {
    pixelSize: 24
}

which means that inside the braces is a complete object initializer. For that
initializer we create a dedicated CompiledData::Object, which however has its
type name empty. When populating the outer instance then, the "font" property
is read as QQmlValueType (a QObject) and instead of creating a new QObject we
use that value type as instance to run the rest of the QML object initializer
(everything in braces).

Change-Id: Ic0a37ac77ab88f582546b9c09a3d06a07726420b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Add support for id properties

Change-Id: Idb4a0ad06f6cbe5d040da075a8f43d067a27ebc4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Cleanup: Fold CompiledData::Value into CompiledData::Binding

Value isn't needed anywhere else

Change-Id: Ib12d85332a6096e6232a790a7e6fd63961329e3b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix function and binding expression setup

Binding expressions and QML used to be set up so that they were written
as function closure:

    (function(...) {
      expression here
    })

and then evaluated inside qml scope. With the new setup we do that closure
setup manually now.

For that we have to define a dummy outter "context scope" function in the
codegen, that will later be used to look up the context ids.

Change-Id: I0656419d67a1728451fcd46f402b03979f118b0b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Avoid type reference lookups with empty strings

For example when declaring

    signal mySignal(string blah)

then we don't need to try to "resolve" the type "string".

Change-Id: I80924ebf244c6b8e2827d19f9c78faf93031fe15
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Initial implementation of signal handler support

Signal handlers start out in the parser as binding expressions. A new
SignalHandlerConverter converts the bindings then so that the expression is
turned into a function declaration where the function parameters match the
parameters of the signal.

Change-Id: I3ea5aa3b80a6ee3b095c6841c63c3e3bb0b47e4f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Add support for finalization callbacks

This is needed for Component.onCompleted (the signal emission) as well
as the private finalization callback API in QQmlEngine, used by QtQuick.

The creator - similar to the VME - tracks the attached properties object
of QQmlComponent through a linked list.

Change-Id: I8ada94009a7ce2078feefd359485657626c300fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Initial support for attached properties

Attached properties are implemented similarly to group properties, except that
the object operated on isn't a QQmlValueType from a property (i.e. font) but the
QObject that implements the attached properties.

Change-Id: If73751162c191c65512ca1bddadd6270e6e33793
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Implement remaining literal binding value assignments

Ported over the code from genLiteralAssignment and testLiteralAssignment
to converting the AST type (string, bool, number) to the expected property
meta-type.

Change-Id: I709b97efdd741dbc4217ee0b9712de58dd32b82d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix timing of binding enabling

Enabling bindings right before emitting Component.onComplete

Change-Id: I4cc330f5e59b326368c617f16a7d4fd51b6c50db
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Cleanup attached and group property determination

Determine when a qualified identifier signifies an attached property or a group
property in one place and set the Binding::Type accordingly.

This simplifies the object builder code, too.

Change-Id: I9f572441e9b5b43338752b848649fbd507cabe4c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Implement setting object properties

This includes assigning to interface properties, variants that hold QObject
pointers and regular QObject <> QObject assignments (assuming that they are
compatible)

Change-Id: Icd82c672e6899c6bfeb7f0ec758a81f8b70275ab
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Add initial support for assigning single objects to list properties

Just like in the old VME, setting a value to a list property appends instead of
replacing.

Change-Id: Ie70bf45c6badba6cac09248dc2e41ec6a6a7538b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Finish support for initializing list properties

Setting a value on a list property is always just appending to the list instead
of replacing it. Based on that, initializing list properties with multiple
items is done with one binding per item to the same list property. So

    myList: [ Item{}, Item{} ]

is mapped to

    myList: Item {}
    myList: Item {}

Change-Id: Iadc048ab3a8d73ac824aa6b2ae5dec33731fa362
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Cleanups

Make the v4 context to use for binding expressions/functions/signal handlers
a member variable instead of a function parameter, as it doesn't change
frequently.

Change-Id: I8a73bbc3f37c116d29172d5c935c66ecf2f67a38
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Cleanups

Collect code for collecting errors and string access for different compile
passes (vme creation, qobject creation) in a QQmlCompilePass base class.

Change-Id: Ib2119e730ce7d3181599ba29da12273f041f2b70
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix function-local variable declarations

Make sure to call defineFunction with FunctionCode as compile mode when
compiling functions or signal handler functions, to assign an index to local
variables.

Change-Id: I8948840dba68ce6293a87c55d3386df69d5f6a5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix id parsing

    id: foo;

produces a statement on the right hand side that includes the semicolon.
Strip it off - reduce expression statements similar to setBindingValue.

Change-Id: I22a02ce364a309b4364476166402f8284e01ef98
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Improve error handling and sanity checking for object ids

Disallow properties called id.foo.bar as well as id: Object {}

Change-Id: I3e31875a5863b5b4d4f9f7dd6c74d337eea3dfb2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Initial support for components

We use a dedicated pass through the objects in QV4::CompiledData::QmlUnit to determine
which objects are QQmlComponents. We remember their object indices as well as to which
component other objects belong to (if any).

Change-Id: I97929c57e2ccb2fd380d612002d128359c4bc253
Reviewed-by: Lars Knoll <lars.knoll@digia.com>