cristianadam / QLALR-Example

QLALR Adventures · Code Sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License GPL v2.1

QLALR-Example

This is an (improved) example for using QLALR.

Back in the time, when Qt was owned by Nokia, they did a howto for QLALR. This can be found here:

Unfortunately, the full code source of the example, originally called "qq33-qlalr.zip" is hard to find (you can still get it from here: https://doc.qt.io/archives/qq/). This is why I created this repository.

What is it?

This code example is meant to understand how QLALR works, as there is no documentation for it...

The most important file is plover.g. This file can be compiled with qlalr that will produce

  • CommandParser.hpp et CommandParser.cpp
  • parser_p.h et parser.cpp

These files are already given here so you can see what is produced, without having to run qlalr yourself.

The source code here is the same as the one provided in the original example, with the following changes:

Compile

To compile, you can run the steps described in the file COMPILE:

qlalr --no-debug --no-lines plover.g
qmake
make

Note that qlalr has already been run here, so you don't have to do it. The produced files are part of this repository for the example sake.

qlalr is part of the default Qt installation since QtBase 5.3. You can find it in the Qt installation folder, in the subfolder bin/qlalr or bin/qlalr.exe for Windows, next to qmake.

About

QLALR Adventures · Code Sample

License:GNU Lesser General Public License v2.1


Languages

Language:C++ 71.9%Language:GAP 26.4%Language:QMake 1.7%