Skip to content
QML Parser For mruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mrblib
test
LICENSE
README.adoc
mrbgem.rake
test-non-mruby.rb

README.adoc

mruby-qml-parse

mruby-qml-parse is a parser for Qt’s .qml files for ruby or mruby.

This project is primarily targeted for use with mruby and with QML files which may use an alternative scripting language other than javascript (which is what the official Qt implementation uses).

Example Pseudo-QML (example.qml):

Rectangle {
    id: window

    property string fooVar: "foo"
    property bool   barVar: true

    Structure { id: structure }
    Model     { id: model }

    function fn(args) {
        puts args
        structure.method()
    }
}

To get the IR representation:

parser      = Parser.new
parse_tree  = parser.load_qml_from_file("example.qml")
ir_conv     = ProgIR.new(parse_tree[0])
ir          = ir_conv.IR

This parser provides a lightweight means of converting the IR representation to a mruby instance via the ProgVM class, but the support provided by mruby-qml-spawn should be preferred.

License

This software is written by Mark McCurry and is provided under the MIT license. For more information please read the included LICENSE.

You can’t perform that action at this time.