equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the utils of the Qt Toolkit. |
7 ** This file is part of the utils of the Qt Toolkit. |
8 ** |
8 ** |
49 QString CppGenerator::copyrightHeader() const |
49 QString CppGenerator::copyrightHeader() const |
50 { |
50 { |
51 return QLatin1String( |
51 return QLatin1String( |
52 "/****************************************************************************\n" |
52 "/****************************************************************************\n" |
53 "**\n" |
53 "**\n" |
54 "** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\n" |
54 "** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).\n" |
55 "** All rights reserved.\n" |
55 "** All rights reserved.\n" |
56 "** Contact: Nokia Corporation (qt-info@nokia.com)\n" |
56 "** Contact: Nokia Corporation (qt-info@nokia.com)\n" |
57 "**\n" |
57 "**\n" |
58 "** This file is part of the QtCore module of the Qt Toolkit.\n" |
58 "** This file is part of the QtCore module of the Qt Toolkit.\n" |
59 "**\n" |
59 "**\n" |
455 void CppGenerator::generateDecl (QTextStream &out) |
455 void CppGenerator::generateDecl (QTextStream &out) |
456 { |
456 { |
457 out << "class " << grammar.table_name << endl |
457 out << "class " << grammar.table_name << endl |
458 << "{" << endl |
458 << "{" << endl |
459 << "public:" << endl |
459 << "public:" << endl |
460 << " enum {" << endl; |
460 << " enum VariousConstants {" << endl; |
461 |
461 |
462 foreach (Name t, grammar.terminals) |
462 foreach (Name t, grammar.terminals) |
463 { |
463 { |
464 QString name = *t; |
464 QString name = *t; |
465 int value = std::distance (grammar.names.begin (), t); |
465 int value = std::distance (grammar.names.begin (), t); |