mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
deal with FIXME in utilities CMake file
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
1ad5d9937a
commit
4b9d639984
31 changed files with 110 additions and 11 deletions
|
@ -1,6 +1,3 @@
|
|||
# FIXME: most utils are not namespaces aware
|
||||
add_definitions(-DQT_NAMESPACE_COMPAT)
|
||||
|
||||
add_subdirectory(fixnonlatin1)
|
||||
add_subdirectory(lexgen)
|
||||
add_subdirectory(normalize)
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
****************************************************************************/
|
||||
#include <QtCore/QtCore>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
// Scans files for characters >127 and replaces them with the \nnn octal representation
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
|
||||
#include <QFile>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
ConfigFile::SectionMap ConfigFile::parse(const QString &fileName)
|
||||
{
|
||||
QFile f(fileName);
|
||||
|
@ -97,3 +99,5 @@ ConfigFile::SectionMap ConfigFile::parse(QIODevice *dev)
|
|||
}
|
||||
return sections;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include <QMap>
|
||||
#include <QVector>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
struct ConfigFile
|
||||
{
|
||||
struct Entry
|
||||
|
@ -69,5 +71,7 @@ struct ConfigFile
|
|||
static SectionMap parse(QIODevice *dev);
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // CONFIGFILE_H
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
|
||||
#include <QFile>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
void Function::printDeclaration(CodeBlock &block, const QString &funcNamePrefix) const
|
||||
{
|
||||
block << (iline ? "inline " : "") << signature(funcNamePrefix) << (iline ? QLatin1String(" {") : QLatin1String(";"));
|
||||
|
@ -530,3 +532,4 @@ QString Generator::generate()
|
|||
return header + klass.declaration() + klass.definition();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
#include "nfa.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class LineStream
|
||||
{
|
||||
private:
|
||||
|
@ -210,4 +212,6 @@ private:
|
|||
QVector<TransitionSequence> charFunctionRanges;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
|
||||
#include "configfile.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if 1
|
||||
typedef int InputType;
|
||||
|
||||
|
@ -102,4 +104,6 @@ struct Config
|
|||
ConfigFile::SectionMap configSections;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // GLOBAL_H
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
#include <QFileInfo>
|
||||
#include <QDateTime>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
struct Symbol
|
||||
{
|
||||
QString token;
|
||||
|
|
|
@ -40,8 +40,11 @@
|
|||
****************************************************************************/
|
||||
#include "nfa.h"
|
||||
#include <QSet>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
NFA NFA::createSingleInputNFA(InputType input)
|
||||
{
|
||||
NFA result;
|
||||
|
@ -245,7 +248,6 @@ void NFA::debug()
|
|||
}
|
||||
|
||||
// helper
|
||||
QT_BEGIN_NAMESPACE
|
||||
typedef QSet<int> DFAState;
|
||||
|
||||
// that's a bad hash, but it's good enough for us
|
||||
|
@ -257,7 +259,6 @@ inline uint qHash(const DFAState &state)
|
|||
val |= qHash(s);
|
||||
return val;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
DFA NFA::toDFA() const
|
||||
{
|
||||
|
@ -507,4 +508,4 @@ DFA DFA::minimize() const
|
|||
return *this;
|
||||
}
|
||||
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
|
||||
#include "global.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
typedef QHash<InputType, int> TransitionMap;
|
||||
|
||||
struct State
|
||||
|
@ -115,5 +117,7 @@ public:
|
|||
QVector<State> states;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // NFA_H
|
||||
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
#include "re2nfa.h"
|
||||
#include "tokenizer.cpp"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
RE2NFA::RE2NFA(const QMap<QString, NFA> ¯os, const QSet<InputType> &maxInputSet, Qt::CaseSensitivity cs)
|
||||
: macros(macros), index(0), errorColumn(-1), maxInputSet(maxInputSet), caseSensitivity(cs)
|
||||
{
|
||||
|
@ -545,3 +547,4 @@ QString RE2NFA::lexemUntil(Token t)
|
|||
return lexem;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include "nfa.h"
|
||||
#include <QSet>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class RE2NFA
|
||||
{
|
||||
public:
|
||||
|
@ -104,5 +106,7 @@ private:
|
|||
Qt::CaseSensitivity caseSensitivity;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // RE2NFA_H
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
// auto generated. DO NOT EDIT.
|
||||
class RegExpTokenizer
|
||||
{
|
||||
|
@ -235,3 +238,5 @@ int RegExpTokenizer::lex()
|
|||
return token;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
@ -44,12 +44,13 @@
|
|||
#include <qmetaobject.h>
|
||||
#include <qstring.h>
|
||||
#include <qtextstream.h>
|
||||
|
||||
#include <qdebug.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
static bool printFilename = true;
|
||||
static bool modify = false;
|
||||
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
|
|
@ -48,6 +48,8 @@
|
|||
#include <iostream>
|
||||
#include "compress.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#define QLALR_NO_CHECK_SORTED_TABLE
|
||||
|
||||
struct _Fit: public std::binary_function<int, int, bool>
|
||||
|
@ -284,3 +286,5 @@ void Compress::operator () (int *table, int row_count, int column_count)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
#include <QtCore/QVector>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Compress
|
||||
{
|
||||
public:
|
||||
|
@ -49,4 +51,6 @@ public:
|
|||
QVector<int> check;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // COMPRESS_H
|
||||
|
|
|
@ -46,6 +46,8 @@
|
|||
#include "lalr.h"
|
||||
#include "recognizer.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QString CppGenerator::copyrightHeader() const
|
||||
{
|
||||
return QLatin1String(
|
||||
|
@ -736,3 +738,5 @@ void CppGenerator::generateImpl (QTextStream &out)
|
|||
}
|
||||
out << "};" << endl << endl;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include "lalr.h"
|
||||
#include "compress.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Grammar;
|
||||
class Automaton;
|
||||
class Recognizer;
|
||||
|
@ -87,4 +89,6 @@ private:
|
|||
QVector<int> defgoto;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // CPPGENERATOR_H
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
#include "lalr.h"
|
||||
#include "dotgraph.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
DotGraph::DotGraph(QTextStream &o):
|
||||
out (o)
|
||||
{
|
||||
|
@ -100,3 +102,5 @@ void DotGraph::operator () (Automaton *aut)
|
|||
out << "}" << endl;
|
||||
out << endl << endl << "}" << endl;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
#include <QTextStream>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Automaton;
|
||||
|
||||
class DotGraph
|
||||
|
@ -49,4 +51,6 @@ private:
|
|||
QTextStream &out;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // DOTGRAPH_H
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
|
||||
#include "grammar_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
const char *const grammar::spell [] = {
|
||||
"end of file", "identifier", "string literal", "%decl", "%expect", "%expect-lr", "%impl", "%left", "%merged_output", "%nonassoc",
|
||||
"%parser", "%prec", "%right", "%start", "%token", "%token_prefix", ":", "|", ";", 0,
|
||||
|
@ -121,3 +123,4 @@ const int grammar::action_check [] = {
|
|||
-1, -1, -1, 8, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1};
|
||||
|
||||
QT_END_NAMESPACE
|
|
@ -34,6 +34,10 @@
|
|||
#ifndef GRAMMAR_P_H
|
||||
#define GRAMMAR_P_H
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class grammar
|
||||
{
|
||||
public:
|
||||
|
@ -106,6 +110,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // GRAMMAR_P_H
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#define QLALR_NO_DEBUG_LOOKAHEADS
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QTextStream qerr (stderr, QIODevice::WriteOnly);
|
||||
QTextStream qout (stdout, QIODevice::WriteOnly);
|
||||
|
||||
|
@ -71,7 +72,6 @@ bool operator < (StatePointer a, StatePointer b)
|
|||
{
|
||||
return &*a < &*b;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
bool Read::operator < (const Read &other) const
|
||||
{
|
||||
|
@ -782,3 +782,5 @@ void Automaton::dump (QTextStream &out, const Lookback &lp)
|
|||
{
|
||||
out << "(" << id (lp.state) << ", " << lp.nt << ")";
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
|
@ -125,6 +125,8 @@
|
|||
|
||||
#include <cstdlib>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Recognizer: protected $table
|
||||
{
|
||||
public:
|
||||
|
@ -185,6 +187,8 @@ protected:
|
|||
QString _M_current_value;
|
||||
bool _M_no_lines;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
:/
|
||||
|
||||
/.
|
||||
|
@ -234,6 +238,8 @@ protected:
|
|||
#include <cstring>
|
||||
#include <cctype>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Recognizer::Recognizer (Grammar *grammar, bool no_lines):
|
||||
tos(0),
|
||||
stack_size(0),
|
||||
|
@ -796,4 +802,6 @@ case $rule_number: {
|
|||
return false;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
./
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QPair>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Rule;
|
||||
class State;
|
||||
class Grammar;
|
||||
|
@ -474,21 +476,19 @@ private:
|
|||
int _M_includes_dfn;
|
||||
};
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
bool operator < (Name a, Name b);
|
||||
bool operator < (StatePointer a, StatePointer b);
|
||||
bool operator < (ItemPointer a, ItemPointer b);
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QTextStream &operator << (QTextStream &out, const Name &n);
|
||||
QTextStream &operator << (QTextStream &out, const Rule &r);
|
||||
QTextStream &operator << (QTextStream &out, const Item &item);
|
||||
QTextStream &operator << (QTextStream &out, const NameSet &ns);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
// ... hmm
|
||||
extern QTextStream qerr;
|
||||
extern QTextStream qout;
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // LALR_H
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
#define QLALR_NO_DEBUG_TABLE
|
||||
#define QLALR_NO_DEBUG_DOT
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
static void help_me ()
|
||||
{
|
||||
qerr << "Usage: qlalr [options] [input file name]" << endl
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
#include "lalr.h"
|
||||
#include "parsetable.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
ParseTable::ParseTable (QTextStream &o):
|
||||
out (o)
|
||||
{
|
||||
|
@ -125,3 +127,5 @@ void ParseTable::operator () (Automaton *aut)
|
|||
out << endl;
|
||||
}
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
#include <QTextStream>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Automaton;
|
||||
|
||||
class ParseTable
|
||||
|
@ -49,4 +51,6 @@ private:
|
|||
QTextStream &out;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // PARSETABLE_H
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
#include <cstring>
|
||||
#include <cctype>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Recognizer::Recognizer (Grammar *grammar, bool no_lines):
|
||||
tos(0),
|
||||
stack_size(0),
|
||||
|
@ -486,3 +488,4 @@ case 43: {
|
|||
return false;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
|
||||
#include <cstdlib>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Recognizer: protected grammar
|
||||
{
|
||||
public:
|
||||
|
@ -105,4 +107,6 @@ protected:
|
|||
bool _M_no_lines;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // RECOGNIZER_H
|
||||
|
|
Loading…
Add table
Reference in a new issue