10#include <QtCore/qcoreapplication.h>
11#include <QtCore/qfile.h>
12#include <QtCore/qstringlist.h>
13#include <QtCore/qdebug.h>
17#define QLALR_NO_DEBUG_TABLE
18#define QLALR_NO_DEBUG_DOT
24 qerr() <<
"Usage: qlalr [options] [input file name]" <<
Qt::endl
26 <<
" --help, -h\t\tdisplay this help and exit" <<
Qt::endl
27 <<
" --verbose, -v\t\tverbose output" <<
Qt::endl
28 <<
" --no-debug\t\tno debug information" <<
Qt::endl
29 <<
" --no-lines\t\tno #line directives" <<
Qt::endl
30 <<
" --dot\t\t\tgenerate a graph" <<
Qt::endl
31 <<
" --qt\t\t\tadd the Qt copyright header and Qt-specific types and macros" <<
Qt::endl
32 <<
" --exit-on-warn\texit with status code 2 on warning" <<
Qt::endl
37int main (
int argc,
char *argv[])
41 bool generate_dot =
false;
42 bool generate_report =
false;
43 bool no_lines =
false;
44 bool debug_info =
true;
45 bool qt_copyright =
false;
46 bool warnings_are_errors =
false;
51 if (
arg ==
"-h"_L1 ||
arg ==
"--help"_L1)
54 else if (
arg ==
"-v"_L1 ||
arg ==
"--verbose"_L1)
55 generate_report =
true;
57 else if (
arg ==
"--dot"_L1)
60 else if (
arg ==
"--no-lines"_L1)
63 else if (
arg ==
"--no-debug"_L1)
66 else if (
arg ==
"--qt"_L1)
69 else if (
arg ==
"--exit-on-warn"_L1)
70 warnings_are_errors =
true;
88 if (!
p.parse (file_name))
103 grammar.buildExtendedGrammar ();
121 else if (generate_report)
void setWarningsAreErrors(bool e)
void setDebugInfo(bool d)
void setCopyright(bool t)
std::list< QString > names
static QStringList arguments()
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & replace(qsizetype i, qsizetype len, QChar after)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString toLower() const &
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
RulePointer _M_current_rule
QString expand(const QString &text) const
QT_BEGIN_NAMESPACE QTextStream & qerr()
QTextStream & endl(QTextStream &stream)
Writes '\n' to the stream and flushes the stream.
QApplication app(argc, argv)
[0]