(0eac2258042268282f6e86e6bbcf2442e1f65afa)
#include <translator.h>
#include "lupdate.h"
#include <QtCore/qhash.h>
#include <QtCore/qlist.h>
#include <QtCore/qstring.h>
#include <QtCore/qtextstream.h>
#include <QtCore/qstack.h>
#include <cctype>
#include <cerrno>
#include <cstdio>
#include <cstring>
Go to the source code of this file.
|
enum | Token {
Tok_Eof
, Tok_class
, Tok_def
, Tok_return
,
Tok_tr
, Tok_trUtf8
, Tok_translate
, Tok_Ident
,
Tok_Comment
, Tok_Dot
, Tok_String
, Tok_LeftParen
,
Tok_RightParen
, Tok_Comma
, Tok_None
, Tok_Integer
,
Tok_Eof
, Tok_class
, Tok_def
, Tok_return
,
Tok_tr
, Tok_trUtf8
, Tok_translate
, Tok_Ident
,
Tok_Comment
, Tok_Dot
, Tok_String
, Tok_LeftParen
,
Tok_RightParen
, Tok_Comma
, Tok_None
, Tok_Integer
} |
|
enum class | StringType {
NoString
, String
, FormatString
, RawString
,
NoString
, String
, FormatString
, RawString
} |
|
enum | Token {
Tok_Eof
, Tok_class
, Tok_def
, Tok_return
,
Tok_tr
, Tok_trUtf8
, Tok_translate
, Tok_Ident
,
Tok_Comment
, Tok_Dot
, Tok_String
, Tok_LeftParen
,
Tok_RightParen
, Tok_Comma
, Tok_None
, Tok_Integer
,
Tok_Eof
, Tok_class
, Tok_def
, Tok_return
,
Tok_tr
, Tok_trUtf8
, Tok_translate
, Tok_Ident
,
Tok_Comment
, Tok_Dot
, Tok_String
, Tok_LeftParen
,
Tok_RightParen
, Tok_Comma
, Tok_None
, Tok_Integer
} |
|
enum class | StringType {
NoString
, String
, FormatString
, RawString
,
NoString
, String
, FormatString
, RawString
} |
|
|
static int | getCharFromFile () |
|
static int | peekCharFromFile () |
|
static void | startTokenizer (const QString &fileName, int(*getCharFunc)(), int(*peekCharFunc)()) |
|
static bool | parseStringEscape (int quoteChar, StringType stringType) |
|
static Token | parseString (StringType stringType=StringType::NoString) |
|
static QByteArray | readLine () |
|
static Token | getToken (StringType stringType=StringType::NoString) |
|
static bool | match (Token t) |
|
static bool | matchStringStart () |
|
static bool | matchString (QByteArray *s) |
|
static bool | matchEncoding (bool *utf8) |
|
static bool | matchStringOrNone (QByteArray *s) |
|
static bool | matchExpression () |
|
static bool | parseTranslate (QByteArray *text, QByteArray *context, QByteArray *comment, bool *utf8, bool *plural) |
|
static void | setMessageParameters (TranslatorMessage *message, int lineNo) |
|
static void | parse (Translator &tor, ConversionData &cd, const QByteArray &initialContext={}, const QByteArray &defaultContext={}) |
|
bool | loadPython (Translator &translator, const QString &fileName, ConversionData &cd) |
|
◆ ContextPair
◆ ContextStack
◆ StringType [1/2]
Enumerator |
---|
NoString | |
String | |
FormatString | |
RawString | |
NoString | |
String | |
FormatString | |
RawString | |
Definition at line 34 of file python.cpp.
◆ StringType [2/2]
Enumerator |
---|
NoString | |
String | |
FormatString | |
RawString | |
NoString | |
String | |
FormatString | |
RawString | |
Definition at line 34 of file python.cpp.
◆ Token [1/2]
Enumerator |
---|
Tok_Eof | |
Tok_class | |
Tok_def | |
Tok_return | |
Tok_tr | |
Tok_trUtf8 | |
Tok_translate | |
Tok_Ident | |
Tok_Comment | |
Tok_Dot | |
Tok_String | |
Tok_LeftParen | |
Tok_RightParen | |
Tok_Comma | |
Tok_None | |
Tok_Integer | |
Tok_Eof | |
Tok_class | |
Tok_def | |
Tok_return | |
Tok_tr | |
Tok_trUtf8 | |
Tok_translate | |
Tok_Ident | |
Tok_Comment | |
Tok_Dot | |
Tok_String | |
Tok_LeftParen | |
Tok_RightParen | |
Tok_Comma | |
Tok_None | |
Tok_Integer | |
Definition at line 28 of file python.cpp.
◆ Token [2/2]
Enumerator |
---|
Tok_Eof | |
Tok_class | |
Tok_def | |
Tok_return | |
Tok_tr | |
Tok_trUtf8 | |
Tok_translate | |
Tok_Ident | |
Tok_Comment | |
Tok_Dot | |
Tok_String | |
Tok_LeftParen | |
Tok_RightParen | |
Tok_Comma | |
Tok_None | |
Tok_Integer | |
Tok_Eof | |
Tok_class | |
Tok_def | |
Tok_return | |
Tok_tr | |
Tok_trUtf8 | |
Tok_translate | |
Tok_Ident | |
Tok_Comment | |
Tok_Dot | |
Tok_String | |
Tok_LeftParen | |
Tok_RightParen | |
Tok_Comma | |
Tok_None | |
Tok_Integer | |
Definition at line 28 of file python.cpp.
◆ getCharFromFile()
static int getCharFromFile |
( |
| ) |
|
|
static |
◆ getToken()
Definition at line 293 of file python.cpp.
References getChar, parseString(), Tok_Comma, Tok_Dot, Tok_Eof, Tok_Ident, Tok_Integer, Tok_LeftParen, Tok_RightParen, yyCh, yyCommentLen, yyCurLineNo, yyIdent, yyLineNo, yyParenDepth, and yyStringLen.
Referenced by match(), matchEncoding(), matchExpression(), matchString(), matchStringStart(), and parseTranslate().
◆ loadPython()
◆ match()
static bool match |
( |
Token | t | ) |
|
|
static |
◆ matchEncoding()
static bool matchEncoding |
( |
bool * | utf8 | ) |
|
|
static |
◆ matchExpression()
static bool matchExpression |
( |
| ) |
|
|
static |
◆ matchString()
◆ matchStringOrNone()
◆ matchStringStart()
static bool matchStringStart |
( |
| ) |
|
|
static |
◆ parse()
◆ parseString()
◆ parseStringEscape()
static bool parseStringEscape |
( |
int | quoteChar, |
|
|
StringType | stringType ) |
|
static |
◆ parseTranslate()
◆ peekCharFromFile()
static int peekCharFromFile |
( |
| ) |
|
|
static |
◆ readLine()
◆ setMessageParameters()
◆ startTokenizer()
static void startTokenizer |
( |
const QString & | fileName, |
|
|
int(* | getCharFunc )(), |
|
|
int(* | peekCharFunc )() ) |
|
static |
Definition at line 125 of file python.cpp.
References buf, getChar, peekChar, yyCh, yyContextStack, yyContinuousSpaceCount, yyCountingIndentation, yyCurLineNo, yyFileName, yyIndentationSize, yyInPos, and yyParenDepth.
◆ buf
◆ extraComments
◆ getChar
static int(* getChar)() |
( |
| ) |
|
|
static |
◆ ids
◆ peekChar
static int(* peekChar)() |
( |
| ) |
|
|
static |
◆ PythonMagicComment
◆ tokens
◆ yyCh
◆ yyComment
◆ yyCommentLen
static size_t yyCommentLen |
|
static |
◆ yyContextStack
◆ yyContinuousSpaceCount
static int yyContinuousSpaceCount |
|
static |
◆ yyCountingIndentation
static bool yyCountingIndentation |
|
static |
◆ yyCurLineNo
◆ yyFileName
◆ yyIdent
◆ yyIndentationSize
static int yyIndentationSize |
|
static |
◆ yyInFile
◆ yyInPos
◆ yyLineNo
◆ yyParenDepth
◆ yyString
◆ yyStringLen
static size_t yyStringLen |
|
static |
◆ yyTok