Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a parser for QML-format files [closed]

I need to do some static analysis of QML-format files (wiki), but I can't find any parsers for them. The only way I see is to reuse source code of the Qt Declarative module or write my own parser. I can't find anything on the web. Can anyone point me to some tool, converter to XML or Perl/Python module to easily parse elements from QML files?

Thanks a lot for your help!

like image 583
linuxbuild Avatar asked Mar 25 '11 23:03

linuxbuild


People also ask

How do I open a QML file?

If you cannot open your QML file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a QML file directly in the browser: Just drag the file onto this browser window and drop it.

What are QML files?

A QML document is a string which conforms to QML document syntax. A document defines a QML object type. A document is generally loaded from a ". qml" file stored either locally or remotely, but can be constructed manually in code.

Is QML compiled?

QML is compiled to an optimized bytecode-like stream and the JavaScript expressions pass through an optimized evaluator for simple expressions.

How do I add QML to QT?

Creating and Running QML Projects For simple UI files such as this one, select File > New File or Project > Application (Qt Quick) > Qt Quick Application - Empty from within Qt Creator. Pressing the green Run button runs the application. You should see the text Hello, World! in the center of a red rectangle.


1 Answers

The parser in qt-declarative is in src/qml/qml/parser, and a big part of it is generated with qlalr (same place as the previous link, but with qlalr instead of qtdeclarative). You might want also to look at the parser used in qt-creator src/libs/qmljs/parser which is derived from the qt-declarative one.

like image 80
Fawzi Mohamed Avatar answered Oct 08 '22 04:10

Fawzi Mohamed