Kaydet (Commit) f7f97dad authored tarafından jan iversen's avatar jan iversen

update genlang, activated lex calls.

All lex files no longer have a special namespace, instead
yylex --> <foo>lex
and therefore unique for the linker.

Also corrected command line argument handler.

Change-Id: Idfdec97bd43f3be8d2b217b9aac1bd74b202dc93
üst b3443e16
......@@ -30,7 +30,6 @@ $(eval $(call gb_Executable_add_exception_objects,genlang,\
l10ntools/source/gL10nMem \
l10ntools/source/gConvProp \
l10ntools/source/gConv \
l10ntools/source/gConvDB \
l10ntools/source/gConvPo \
l10ntools/source/gConvSrc \
l10ntools/source/gConvXrm \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef GCONDN_HXX
#define GCONDN_HXX
#include "gConv.hxx"
class convert_db : public convert_gen
{
public:
convert_db(l10nMem& crMemory);
~convert_db();
private:
static const int NUMFIELD = 16;
std::string msFields[NUMFIELD];
int miSize;
void execute() override;
bool collectLine();
};
#endif
......@@ -21,7 +21,6 @@
#include "gL10nMem.hxx"
#include "gConv.hxx"
#include "gConvDB.hxx"
#include "gConvPo.hxx"
#include "gConvProp.hxx"
#include "gConvSrc.hxx"
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <string>
#include <vector>
#include "gL10nMem.hxx"
#include "gConvDB.hxx"
convert_db::convert_db(l10nMem& crMemory) : convert_gen(crMemory) {}
convert_db::~convert_db() {}
void convert_db::execute()
{
std::string newKey;
int i;
msSourceBuffer += '\n';
miSize = msSourceBuffer.size() -1;
miLineNo = 0;
while (collectLine()) {
newKey = msFields[4];
if (msFields[5].size())
newKey += "." + msFields[5];
if (msFields[3].size())
newKey += "." + msFields[3];
for (; (i = msFields[1].find('\\')) != (int)std::string::npos;)
msFields[1][i] = '/';
// handle en-US or lang
mcMemory.loadEntryKey(miLineNo, msFields[1], newKey, msFields[10], msFields[10], false);
}
}
bool convert_db::collectLine()
{
int i, iStart;
bool bLineEnd;
++miLineNo;
for (i = 0; i < NUMFIELD; ++i)
msFields[i].clear();
if (miSourceReadIndex >= miSize)
return false;
for (i = 0, bLineEnd = false, iStart = miSourceReadIndex; !bLineEnd; ++miSourceReadIndex) {
if (msSourceBuffer[miSourceReadIndex] == '\r' ||
msSourceBuffer[miSourceReadIndex] == '\n' ||
miSourceReadIndex == miSize)
bLineEnd = true;
if (msSourceBuffer[miSourceReadIndex] == '\t' || bLineEnd) {
if (i >= NUMFIELD) {
l10nMem::showError("TOO many fields", miLineNo);
}
msFields[i++] = msSourceBuffer.substr(iStart, miSourceReadIndex - iStart);
iStart = miSourceReadIndex +1;
}
}
return true;
}
......@@ -131,12 +131,13 @@ void convert_po::handleNL()
extern int polex(void);
void convert_po::execute()
{
if (mbMergeMode)
throw l10nMem::showError("Merge not implemented");
// PoWrap::yylex();
polex();
startLook();
}
......
......@@ -43,10 +43,10 @@ convert_src::~convert_src()
{}
extern int srclex(void);
void convert_src::execute()
{
// SrcWrap::yylex();
srclex();
}
......
......@@ -48,6 +48,7 @@ convert_tree::~convert_tree()
extern int treelex(void);
void convert_tree::execute()
{
std::string sLang;
......@@ -77,7 +78,7 @@ void convert_tree::execute()
}
// run analyzer
// TreeWrap::yylex();
treelex();
// dump last line
copySourceSpecial(nullptr,3);
......
......@@ -28,10 +28,10 @@ convert_ulf::convert_ulf(l10nMem& crMemory) : convert_gen(crMemory) {}
convert_ulf::~convert_ulf() {}
extern int ulflex(void);
void convert_ulf::execute()
{
// UlfWrap::yylex();
ulflex();
}
......
......@@ -38,13 +38,14 @@ convert_xcs::~convert_xcs()
extern int xcslex(void);
void convert_xcs::execute()
{
if (mbMergeMode)
throw l10nMem::showError("Merge not implemented");
// currently no .xcs files generate en-US translation, so stop trying
// XcsWrap::yylex();
xcslex();
}
......
......@@ -37,9 +37,10 @@ convert_xcu::~convert_xcu()
extern int xculex(void);
void convert_xcu::execute()
{
// XcuWrap::yylex();
xculex();
}
......
......@@ -47,6 +47,7 @@ convert_xhp::~convert_xhp()
extern int xhplex(void);
void convert_xhp::execute()
{
std::string sLang;
......@@ -75,7 +76,7 @@ void convert_xhp::execute()
}
// run analyzer
// XhpWrap::yylex();
xhplex();
// dump last line
copySourceSpecial(nullptr,3);
......
......@@ -40,9 +40,10 @@ convert_xrm::~convert_xrm()
extern int xrmlex(void);
void convert_xrm::execute()
{
//// XrmWrap::yylex();
xrmlex();
// write last part of file.
if (mbMergeMode)
......
This diff is collapsed.
#!/bin/bash
find . -name \*.hrc > filelist_hrc.txt
find . -name \*.src > filelist_src.txt
find . -name \*.po > filelist_po.txt
find . -name \*.pot > filelist_pot.txt
find . -name \*.tree > filelist_tree.txt
find . -name \*.ulf > filelist_ulf.txt
find . -name \*.xcu > filelist_xcu.txt
find . -name \*.xhp > filelist_xhp.txt
find . -name \*.xrm > filelist_xrm.txt
find . -name \*.properties > filelist_properties.txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment