You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/02/19 17:26:27 UTC
svn commit: r1447794 - /openoffice/branches/l10n/main/l10ntools/source/
Author: jani
Date: Tue Feb 19 16:26:26 2013
New Revision: 1447794
URL: http://svn.apache.org/r1447794
Log:
update to new lex for .src
Modified:
openoffice/branches/l10n/main/l10ntools/source/gCon.cxx
openoffice/branches/l10n/main/l10ntools/source/gCon.hxx
openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx
openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConPolex.l
openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx
openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l
openoffice/branches/l10n/main/l10ntools/source/gConUlf.hxx
openoffice/branches/l10n/main/l10ntools/source/gConUlfWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConUlflex.l
openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx
openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l
openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx
openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConXculex.l
openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx
openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l
openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx
openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConXrmlex.l
openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx
openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx
openoffice/branches/l10n/main/l10ntools/source/gLang.hxx
Modified: openoffice/branches/l10n/main/l10ntools/source/gCon.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gCon.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gCon.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gCon.cxx Tue Feb 19 16:26:26 2013
@@ -58,7 +58,7 @@ convert_gen::convert_gen(const std::stri
// do we have an old object
if (convert_gen_impl::mcImpl)
- delete convert_gen_impl::mcImpl;
+ delete convert_gen_impl::mcImpl;
// find correct conversion class and create correct object
std::string sExtension = srSourceFile.substr(nInx+1);
@@ -101,7 +101,9 @@ void convert_gen::execute()
/********************** I M P L E M E N T A T I O N **********************/
convert_gen_impl::convert_gen_impl(l10nMem& crMemory)
- : mcMemory(crMemory)
+ : mcMemory(crMemory),
+ mbInError(false),
+ miLineNo(1)
{
}
@@ -122,7 +124,7 @@ void convert_gen_impl::prepareFile()
if (!inputFile.is_open())
- throw std::string("Could not open ")+msSourceFile;
+ throw showError("Cannot open file");
// get length of file:
mnSourceReadIndex = 0;
@@ -133,7 +135,7 @@ void convert_gen_impl::prepareFile()
// get size, prepare std::string and read whole file
inputFile.read((char *)msSourceBuffer.c_str(), msSourceBuffer.size());
if ((unsigned int)inputFile.gcount() != msSourceBuffer.size())
- throw std::string("cannot read whole file: "+msSourceFile);
+ throw showError("cannot read whole file");
inputFile.close();
}
@@ -170,35 +172,10 @@ void convert_gen_impl::lexRead(char *sBu
/********************** I M P L E M E N T A T I O N **********************/
-void convert_gen_impl::lineRead(bool *bEof, std::string& line)
-{
- // did we hit eof
- if (mnSourceReadIndex == -1 || mnSourceReadIndex >= (int)msSourceBuffer.size())
- {
- *bEof = true;
- mnSourceReadIndex = -1;
- return;
- }
-
- // find next newline
- int nNextLF = msSourceBuffer.find('\n', mnSourceReadIndex);
- if (nNextLF == (int)msSourceBuffer.npos)
- nNextLF = msSourceBuffer.size()+1;
-
- // copy std::string
- line = msSourceBuffer.substr(mnSourceReadIndex, nNextLF - mnSourceReadIndex);
- mnSourceReadIndex = nNextLF +1;
- *bEof = false;
- return;
-}
-
-
-
-/********************** I M P L E M E N T A T I O N **********************/
void convert_gen_impl::writeSourceFile(const std::string& line)
{
if (!line.size())
- return;
+ return;
std::cout << line;
// JIX
@@ -207,40 +184,7 @@ void convert_gen_impl::writeSourceFile(c
/********************** I M P L E M E N T A T I O N **********************/
-void convert_gen_impl::trim(std::string& sLine)
-{
- int nL;
-
- // remove leading spaces
- nL = sLine.find_first_not_of(" \t");
- if (nL != (int)std::string::npos)
- sLine.erase(0, nL);
-
- // remove trailing spaces
- nL = sLine.find_last_not_of(" \t");
- if (nL != (int)std::string::npos)
- sLine.erase(nL +1);
-}
-
-
-
-/********************** I M P L E M E N T A T I O N **********************/
-void convert_gen_impl::collectData(char *sText, int iLineNo)
-{
- miLineNo = iLineNo;
- msCollector += sText;
- if (msCollector[msCollector.size()-1] == '\n')
- {
- if (mbMergeMode)
- writeSourceFile(msCollector);
- msCollector.clear();
- }
-}
-
-
-
-/********************** I M P L E M E N T A T I O N **********************/
-std::string& convert_gen_impl::copySource(char *yyText, int iLineNo, bool bDoClear)
+std::string& convert_gen_impl::copySource(char *yyText, bool bSkipLeading, bool bDoClear)
{
int nL;
@@ -254,14 +198,22 @@ std::string& convert_gen_impl::copySourc
if (bDoClear)
msCollector.clear();
+ // remove leading blanks
+ if (bSkipLeading)
+ for (; msCopyText[0] == ' ' || msCopyText[0] == '\t'; )
+ msCopyText.erase(0,1);
+
// remove any CR
- for (;;)
+ for (nL = 0; nL < (int)msCopyText.size(); ++nL)
{
- nL = msCopyText.find("\r");
- if (nL == (int)std::string::npos)
- break;
-
- msCopyText.erase(nL, 1);
+ if (msCopyText[nL] == '\r')
+ {
+ msCopyText.erase(nL, 1);
+ --nL;
+ continue;
+ }
+ if (msCopyText[nL] == '\n')
+ ++miLineNo;
}
return msCopyText;
@@ -270,52 +222,8 @@ std::string& convert_gen_impl::copySourc
/********************** I M P L E M E N T A T I O N **********************/
-void convert_gen_impl::isolateText(std::string& sText, int iStart, int *iEnd, std::string& sResult, bool bEOL)
+std::string convert_gen_impl::showError(char *sText)
{
- int iCur;
-
-
- // Skip initial space
- for (; sText[iStart] == ' ' || sText[iStart] == '\t' || sText[iStart] == '='; ++iStart) ;
-
- // time to collecting text or word ?
- if (sText[iStart] == '\"')
- {
- for (iCur = ++iStart; sText[iCur] != '\0'; ++iCur)
- {
- // Escape next char
- if (sText[iCur] == '\\')
- {
- ++iCur;
- continue;
- }
- if (sText[iCur] == '\"')
- break;
- }
- *iEnd = iCur+1;
- }
- else
- {
- for (iCur = iStart; sText[iCur] != '\0'; ++iCur)
- {
- // Time to stop
- if (bEOL)
- {
- if (sText[iCur] == '\n')
- {
- if (sText[iCur-1] == '\\')
- --iCur;
- for (; sText[iCur-1] == ' ' || sText[iCur-1] == '\t'; --iCur) ;
- break;
- }
- }
- else
- if (sText[iCur] == '[' || sText[iCur] == ' ' || sText[iCur] == '\t' || sText[iCur] == '\n')
- break;
- }
- *iEnd = iCur;
- }
-
- // Update result
- sResult = sText.substr(iStart, iCur - iStart);
-}
+ std::cerr << "ERROR in " << msSourceFile << ":" << miLineNo << ": " << sText << std::endl;
+ return "ERROR";
+}
\ No newline at end of file
Modified: openoffice/branches/l10n/main/l10ntools/source/gCon.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gCon.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gCon.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gCon.hxx Tue Feb 19 16:26:26 2013
@@ -45,35 +45,33 @@ class convert_gen_impl
convert_gen_impl(l10nMem& crMemory);
- virtual ~convert_gen_impl();
+ virtual ~convert_gen_impl();
- // all converters MUST implement this function
+ // all converters MUST implement this function
virtual void execute() = 0;
- // generic variables
+ // generic variables
bool mbMergeMode;
std::string msSourceFile;
l10nMem& mcMemory;
std::string msCollector;
- int miLineNo;
+ int miLineNo;
- // utility functions for converters
- void lexRead (char *sBuf, int *nResult, int nMax_size);
- void lineRead(bool *bEof, std::string& line);
+ // utility functions for converters
+ void lexRead (char *sBuf, int *nResult, int nMax_size);
void writeSourceFile(const std::string& line);
- void trim(std::string& line);
- virtual void collectData(char *sCollectedText, int iLineNo);
- std::string& copySource(char *yyText, int iLineNo, bool bDoClear = true);
- void isolateText(std::string& sText, int iStart, int *iEnd, std::string& sResult, bool bEOL = false);
+ std::string showError(char *sText);
+ std::string& copySource(char *yyText, bool bSkipLeading = true, bool bDoClear = true);
-private:
+ private:
std::string msSourceBuffer, msCopyText;
+ bool mbInError;
int mnSourceReadIndex;
- void prepareFile();
+ void prepareFile();
- friend class convert_gen;
+ friend class convert_gen;
};
#endif
\ No newline at end of file
Modified: openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConPo.hxx Tue Feb 19 16:26:26 2013
@@ -39,8 +39,8 @@ class convert_po : public convert_gen_im
convert_po(l10nMem& crMemory);
~convert_po();
- void startCollectData(char *syyText, int iLineNo);
- void stopCollectData(char *syyText, int iLineNo);
+ void startCollectData(char *syyText);
+ void stopCollectData(char *syyText);
private:
void execute();
Modified: openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx Tue Feb 19 16:26:26 2013
@@ -58,9 +58,9 @@ void convert_po::execute()
/********************** I M P L E M E N T A T I O N **********************/
-void convert_po::startCollectData(char *syyText, int iLineno)
+void convert_po::startCollectData(char *syyText)
{
- std::string sCollectedText = copySource(syyText, iLineno);
+ std::string sCollectedText = copySource(syyText);
// mbCollectingData = true;
}
@@ -68,9 +68,9 @@ void convert_po::startCollectData(char *
/********************** I M P L E M E N T A T I O N **********************/
-void convert_po::stopCollectData(char *syyText, int iLineno)
+void convert_po::stopCollectData(char *syyText)
{
- std::string sCollectedText = copySource(syyText, iLineno);
+ std::string sCollectedText = copySource(syyText);
std::string useKey;
@@ -82,11 +82,11 @@ void convert_po::stopCollectData(char *s
std::string sNewLine;
int nL = cExtraLangauges.size();
- writeSourceFile(msCollector + sCollectedText);
+ writeSourceFile(msCollector + sCollectedText);
for (int i = 0; i < nL; ++i)
{
sNewLine = "<value xml:lang=\"" + cExtraLangauges[i]->msLanguage + "\">" +
- cExtraLangauges[i]->msText + "</value>";
+ cExtraLangauges[i]->msText + "</value>";
writeSourceFile(sNewLine);
}
}
Modified: openoffice/branches/l10n/main/l10ntools/source/gConPolex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConPolex.l?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConPolex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConPolex.l Tue Feb 19 16:26:26 2013
@@ -61,14 +61,14 @@
"<value xml:lang=\""[^\"]*\"[^>]*">" {
- LOCptr->startCollectData(yytext, genpo_lineno);
+ LOCptr->startCollectData(yytext);
}
"</value>" {
- LOCptr->stopCollectData(yytext, genpo_lineno);
+ LOCptr->stopCollectData(yytext);
}
.|\n {
- IMPLptr->collectData(yytext, genpo_lineno);
+ IMPLptr->copySource(yytext);
}
%%
Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx Tue Feb 19 16:26:26 2013
@@ -23,7 +23,6 @@
#include "gCon.hxx"
-
/*****************************************************************************
************************* G C O N S R C . H X X *************************
*****************************************************************************
@@ -39,24 +38,33 @@ class convert_src : public convert_gen_i
convert_src(l10nMem& crMemory);
~convert_src();
- void pushKey(char *syyText, int iLineNo);
- void popKey (char *syyText, int iLineNo);
- void pushNoKey(char *syyText, int iLineNo);
- void pushPlaceHolder(char *syyTex, int iLineNot);
- void registerHelpKey(char *syyText, int iLineNo);
- void registerIdentKey(char *syyText, int iLineNo);
-
- void saveData(char *syyText, int iLineNo);
- void saveItemList(char *syyText, int iLineNo);
- void startDefine(char *syyText, int iLineNo);
- void collectData(char *sCollectedText, int iLineNo);
-
+ void setValue (char *syyText);
+ void setLang (char *syyText, bool bEnUs);
+ void setId (char *syyText, bool bIde);
+ void setText (char *syyText);
+ void setName (char *syyText);
+ void setCmd (char *syyText);
+ void setMacro (char *syyText);
+ void setList (char *syyText);
+ void setListItem (char *syyText, bool bIsStart);
+ void setStringList (char *syyText);
+ void setNL (char *syyText, bool bMacro);
+ void startBlock (char *syyText);
+ void stopBlock (char *syyText);
+
private:
std::vector<std::string> mcStack;
- std::string msCollector;
- bool mbUseIdentifier;
- bool mbDoDefine;
-
+ std::string msValue;
+ std::string msName;
+ std::string msTextName;
+ std::string msSaveTextName;
+ bool mbEnUs;
+ bool mbExpectName;
+ bool mbExpectMacro;
+ bool mbExpectStringList;
+ bool mbAutoPush;
+ bool mbValuePresent;
+ int miListCount;
void execute();
};
#endif
\ No newline at end of file
Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx Tue Feb 19 16:26:26 2013
@@ -22,6 +22,7 @@
#include <iostream>
#include <fstream>
#include <cstdlib>
+#include <sstream>
#include <string.h>
@@ -35,9 +36,13 @@
/************ I N T E R F A C E I M P L E M E N T A T I O N ************/
convert_src::convert_src(l10nMem& crMemory)
- : convert_gen_impl(crMemory),
- mbUseIdentifier(false),
- mbDoDefine(false)
+ : convert_gen_impl(crMemory),
+ mbEnUs(false),
+ mbExpectName(false),
+ mbExpectMacro(false),
+ mbExpectStringList(false),
+ mbAutoPush(false),
+ mbValuePresent(false)
{}
convert_src::~convert_src()
{}
@@ -57,237 +62,203 @@ namespace SrcWrap
/********************** I M P L E M E N T A T I O N **********************/
void convert_src::execute()
{
- SrcWrap::genSrc_lex();
+ SrcWrap::yylex();
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::pushKey(char *syyText, int iLineno)
+void convert_src::setValue(char *syyText)
{
- std::string sKey, sText = copySource(syyText, iLineno);
- int nL;
+ if (mbExpectStringList)
+ {
+ std::stringstream ssBuf;
- // skip object type and isolate id
- isolateText(sText, 0, &nL, sKey);
- isolateText(sText, nL, &nL, sKey, true);
+ msTextName = msSaveTextName;
+ mbEnUs =
+ mbExpectName = true;
+ ssBuf << ++miListCount;
+ msName = ssBuf.str();
+ mcStack.pop_back();
+ mcStack.push_back(msName);
+ }
- mcStack.push_back(sKey);
- mbUseIdentifier = false;
+ msValue = copySource(syyText, false);
+ mbValuePresent = true;
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::popKey(char *syyText, int iLineno)
+void convert_src::setLang(char *syyText, bool bEnUs)
{
- copySource(syyText, iLineno);
+ copySource(syyText);
- // check for correct node/prop relations
- if (mcStack.size())
- mcStack.pop_back();
- mbUseIdentifier = false;
+ mbEnUs = bEnUs;
+ if (!bEnUs)
+ throw "no en-US source used";
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::pushNoKey(char *syyText, int iLineno)
+void convert_src::setId(char *syyText, bool bId)
{
- copySource(syyText, iLineno);
-
- mbUseIdentifier = true;
- mcStack.push_back("dummy");
+ copySource(syyText);
+ if (bId || !mcStack.back().size())
+ mbExpectName = mbAutoPush = true;
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::pushPlaceHolder(char *syyText, int iLineno)
+void convert_src::setText(char *syyText)
{
- copySource(syyText, iLineno);
-
- mbUseIdentifier = true;
- mcStack.push_back("dummy");
+ msTextName = copySource(syyText);
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::registerHelpKey(char *syyText, int iLineno)
+void convert_src::setName(char *syyText)
{
- std::string sKey, sText = copySource(syyText, iLineno);
- int nL;
-
- // do we expect a delayed key
- if (!mbUseIdentifier)
- return;
-
- // check if help is alone or before ident
- if (mcStack.back() != "dummy")
- return;
-
- // skip object type and isolate id
- isolateText(sText, 0, &nL, sKey);
- isolateText(sText, nL, &nL, sKey);
+ std::string useText = copySource(syyText);
- // put key on stack instead of dummy
- mcStack.pop_back();
- mcStack.push_back(sKey);
+ if (mbExpectName)
+ {
+ mbExpectName = false;
+ if (!mbAutoPush)
+ msName = useText;
+ else
+ {
+ if (mcStack.size())
+ mcStack.pop_back();
+ mcStack.push_back(useText);
+ }
+ }
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::registerIdentKey(char *syyText, int iLineno)
+void convert_src::setCmd(char *syyText)
{
- std::string sKey, sText = copySource(syyText, iLineno);
- int nL;
+ copySource(syyText);
+ mbExpectName = true;
+}
- // do we expect a delayed key
- if (!mbUseIdentifier)
- return;
- mbUseIdentifier = false;
- // skip object type and isolate id
- isolateText(sText, 0, &nL, sKey);
- isolateText(sText, nL, &nL, sKey);
- // put key on stack instead of dummy
- mcStack.pop_back();
- mcStack.push_back(sKey);
+/********************** I M P L E M E N T A T I O N **********************/
+void convert_src::setMacro(char *syyText)
+{
+ copySource(syyText);
+ mbExpectName =
+ mbExpectMacro =
+ mbAutoPush = true;
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::saveData(char *syyText, int iLineno)
+void convert_src::setList(char *syyText)
{
- std::string sObj, sKey, sUseText, sText = copySource(syyText, iLineno);
- int nL;
+ msSaveTextName = msTextName = copySource(syyText);
+ miListCount = 0;
+}
- // Is it a real text
- if (sText.find('\"') == std::string::npos)
- return;
-
- // locate key and extract it
- sKey.clear();
- for (nL = 0; nL < (int)mcStack.size(); ++nL)
- if (mcStack[nL] != "dummy")
- sKey += (sKey.size() ? "." : "") + mcStack[nL];
-
- // skip object type and isolate id
- isolateText(sText, 0, &nL, sObj);
- nL = sText.find('\"', nL);
- isolateText(sText, nL, &nL, sUseText);
- if (mbMergeMode)
- {
- // get all languages (includes en-US)
- std::vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
- std::string sNewLine;
- nL = cExtraLangauges.size();
- for (int i = 0; i < nL; ++i)
- {
- sNewLine = "<value xml:lang=\"" + cExtraLangauges[i]->msLanguage + "\">" +
- cExtraLangauges[i]->msText + "</value>";
- writeSourceFile(sNewLine);
- }
- }
- else
- mcMemory.setEnUsKey(sKey, sObj, sUseText);
+/********************** I M P L E M E N T A T I O N **********************/
+void convert_src::setStringList(char *syyText)
+{
+ msSaveTextName = msTextName = copySource(syyText);
+ mbExpectStringList = true;
+ miListCount = 0;
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::saveItemList(char *syyText, int iLineno)
+void convert_src::setNL(char *syyText, bool bMacro)
{
- std::string sObj, sKey, sUseText, sText = copySource(syyText, iLineno);
- int cnt, nL;
+ int nL;
+ std::string sKey;
- // locate key and extract it
- sKey.clear();
- for (nL = 0; nL < (int)mcStack.size(); ++nL)
- if (mcStack[nL] != "dummy")
- sKey += (sKey.size() ? "." : "") + mcStack[nL];
- // Locate object type
- isolateText(sText, 0, &nL, sObj);
+ copySource(syyText);
- // loop and find all texts
- for (cnt = 0, nL = 0; nL < (int)sText.size();)
+ if (msTextName.size() && mbValuePresent && mbEnUs)
{
- // Is it a real text
- nL = sText.find('\"', nL+1);
- if (nL == (int)std::string::npos)
- break;
- isolateText(sText, nL, &nL, sUseText);
- mcMemory.setEnUsKey(sKey, sObj, sUseText, ++cnt);
+ // locate key and extract it
+ sKey.clear();
+ for (nL = 0; nL < (int)mcStack.size(); ++nL)
+ if (mcStack[nL].size())
+ sKey += (sKey.size() ? "." : "") + mcStack[nL];
+
+ mcMemory.setEnUsKey(sKey, msTextName, msValue);
+ mbEnUs = false;
}
- if (mbMergeMode)
+ if (!bMacro && mbExpectMacro)
{
- // get all languages (includes en-US)
- std::vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
- std::string sNewLine;
- nL = cExtraLangauges.size();
-
- for (int i = 0; i < nL; ++i)
- {
- sNewLine = "<value xml:lang=\"" + cExtraLangauges[i]->msLanguage + "\">" +
- cExtraLangauges[i]->msText + "</value>";
- writeSourceFile(sNewLine);
- }
+ mcStack.pop_back();
+ mbExpectMacro = false;
}
+
+ mbValuePresent =
+ mbExpectName =
+ mbAutoPush = false;
+ msValue.clear();
+ msTextName.clear();
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::startDefine(char *syyText, int iLineno)
+void convert_src::startBlock(char *syyText)
{
- std::string sKey, sText = copySource(syyText, iLineno);
- int nL;
+ copySource(syyText);
+
+ mcStack.push_back(msName);
+ msName.clear();
+}
+
- // skip #define and get key
- isolateText(sText, 1, &nL, sKey);
- isolateText(sText, nL, &nL, sKey);
- mbDoDefine = true;
- // put key on stack
- mcStack.push_back(sKey);
+/********************** I M P L E M E N T A T I O N **********************/
+void convert_src::stopBlock(char *syyText)
+{
+ copySource(syyText);
+ // check for correct node/prop relations
+ if (mcStack.size())
+ mcStack.pop_back();
+ mbExpectStringList = false;
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_src::collectData(char *syyText, int iLineno)
+void convert_src::setListItem(char *syyText, bool bIsStart)
{
- int nL;
- bool doMacro;
+ copySource(syyText);
- msCollector += syyText;
- nL = msCollector.size()-1;
- if (msCollector[nL] == '\n')
+ if (bIsStart)
{
- doMacro = (nL > 1 && msCollector[nL -1] == '\\');
- if (mbMergeMode)
- writeSourceFile(msCollector);
-
- msCollector.clear();
-
- // Time to stop macro
- if (doMacro)
- return;
+ std::stringstream ssBuf;
- // drop key and stop macro
- if (mbDoDefine)
- {
- mbDoDefine = false;
- mcStack.pop_back();
- }
+ msTextName = msSaveTextName;
+ mbEnUs =
+ mbExpectName = true;
+ mbExpectName = true;
+ ssBuf << ++miListCount;
+ msName = ssBuf.str();
+ }
+ else
+ {
+ mbExpectName = false;
+ mcStack.pop_back();
+ mcStack.push_back(msName);
}
}
Modified: openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l Tue Feb 19 16:26:26 2013
@@ -49,163 +49,215 @@
/* --- The following options are for future use (maybe) */
/* yyclass= --> subClass yyFlexLexer to allow own functions */
/* c++ --> generate C++ classes */
-%option 8bit noyywrap never-interactive prefix="genSrc_"
+%option 8bit noyywrap never-interactive
+%array
%p 24000
%e 1200
%n 500
/*********************** H E L P E R M A C R O S ***********************/
-IDENT [a-zA-Z0-9_]
-PRE ^[ \t]*
-KEYPART [ \t]+{IDENT}+(.|\n)*"{"
-NOKEYPART ([ \t\n]+|[ \t\n]*"="[ \t\n]*)"{"
-REGKEYPART [ \t]*"="[ \t]*[a-zA-Z\"]+[^;]*
-GENSAVEPART [ \t]*"["[ \t]*"en-US"[ \t]*"]"[ \t]*"="
-SAVEKEYPART {GENSAVEPART}[^\n]*"\n"
-SAVEITEMPART {GENSAVEPART}[ \t]*[\\]*"\n"[ \t]*"{"[^\}]*"};"
+PRE ^[ \t]*
+SUF [ \t\r\n]
+SUFT [ \t\r\n\[]
+SPACE [ \t]*
+IDENT [a-zA-Z0-9_-]+
/******************* R U L E S D E F I N I T I O N S *******************/
%%
-{PRE}[bB][iI][tT][mM][aA][pP]{KEYPART} |
-{PRE}[bB][uU][tT][tT][oO][nN][iI][mM][aA][gG][eE]{KEYPART} |
-{PRE}[cC][aA][nN][cC][eE][lL][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[cC][hH][eE][cC][kK][bB][oO][xX]{KEYPART} |
-{PRE}[cC][oO][nN][tT][rR][oO][lL]{KEYPART} |
-{PRE}[cC][oO][mM][bB][oO][bB][oO][xX]{KEYPART} |
-{PRE}[eE][dD][iI][tT]{KEYPART} |
-{PRE}[eE][rR][rR][oO][rR][bB][oO][xX]{KEYPART} |
-{PRE}[fF][iI][xX][eE][dD][tT][eE][xX][tT]{KEYPART} |
-{PRE}[fF][iI][xX][eE][dD][lL][iI][nN][eE]{KEYPART} |
-{PRE}[fF][lL][oO][aA][tT][iI][nN][gG][wW][iI][nN][dD][oO][wW]{KEYPART} |
-{PRE}[hH][eE][lL][pP][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[iI][dD][lL][iI][sS][tT]{KEYPART} |
-{PRE}[iI][mM][aA][gG][eE]{KEYPART} |
-{PRE}[iI][mM][aA][gG][eE][lL][iI][sS][tT]{KEYPART} |
-{PRE}[iI][mM][aA][gG][eE][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[iI][mM][aA][gG][eE][rR][aA][dD][iI][oO][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[iI][nN][fF][oO][bB][oO][xX]{KEYPART} |
-{PRE}[iI][tT][eE][mM][lL][iI][sS][tT]{KEYPART} |
-{PRE}[lL][iI][sS][tT][bB][oO][xX]{KEYPART} |
-{PRE}[mM][eE][nN][uU]{KEYPART} |
-{PRE}[mM][eE][nN][uU][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[mM][eE][nN][uU][iI][tT][eE][mM]{KEYPART} |
-{PRE}[mM][eE][tT][rR][iI][cC][fF][iI][eE][lL][dD]{KEYPART} |
-{PRE}[mM][oO][dD][aA][lL][dD][iI][aA][lL][oO][gG]{KEYPART} |
-{PRE}[mM][oO][dD][eE][lL][eE][sS][sS][dD][iI][aA][lL][oO][gG]{KEYPART} |
-{PRE}[mM][uU][lL][tT][iI][lL][iI][nN][eE][eE][dD][iI][tT]{KEYPART} |
-{PRE}[nN][uU][mM][eE][rR][iI][cC][fF][iI][eE][lL][dD]{KEYPART} |
-{PRE}[oO][kK][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[pP][aA][gG][eE][iI][tT][eE][mM]{KEYPART} |
-{PRE}[pP][aA][gG][eE][lL][iI][sS][tT]{KEYPART} |
-{PRE}[pP][uU][sS][hH][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[qQ][uU][eE][rR][yY][bB][oO][xX]{KEYPART} |
-{PRE}[rR][aA][dD][iI][oO][bB][uU][tT][tT][oO][nN]{KEYPART} |
-{PRE}[rR][eE][sS][oO][uU][rR][cC][eE]{KEYPART} |
-{PRE}[sS][pP][iI][nN][fF][iI][eE][lL][dD]{KEYPART} |
-{PRE}[sS][tT][rR][iI][nN][gG]{KEYPART} |
-{PRE}[sS][tT][rR][iI][nN][gG][aA][rR][rR][aA][yY]{KEYPART} |
-{PRE}[tT][aA][bB][cC][oO][nN][tT][rR][oO][lL]{KEYPART} |
-{PRE}[tT][aA][bB][dD][iI][aA][lL][oO][gG]{KEYPART} |
-{PRE}[tT][aA][bB][pP][aA][gG][eE]{KEYPART} |
-{PRE}[tT][oO][oO][lL][bB][oO][xX]{KEYPART} |
-{PRE}[tT][oO][oO][lL][bB][oO][xX][iI][tT][eE][mM]{KEYPART} |
-{PRE}[tT][rR][iI][sS][tT][aA][tT][eE][bB][oO][xX]{KEYPART} |
-{PRE}[wW][aA][rR][nN][iI][nN][gG][bB][oO][xX]{KEYPART} |
-{PRE}[wW][iI][nN][dD][oO][wW]{KEYPART} {
- LOCptr->pushKey(yytext, genSrc_lineno);
-}
-
-
-
-{PRE}[bB][iI][tT][mM][aA][pP]{NOKEYPART} |
-{PRE}[bB][uU][tT][tT][oO][nN][iI][mM][aA][gG][eE]{NOKEYPART} |
-{PRE}[cC][aA][nN][cC][eE][lL][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[cC][hH][eE][cC][kK][bB][oO][xX]{NOKEYPART} |
-{PRE}[cC][oO][nN][tT][rR][oO][lL]{NOKEYPART} |
-{PRE}[cC][oO][mM][bB][oO][bB][oO][xX]{NOKEYPART} |
-{PRE}[eE][dD][iI][tT]{NOKEYPART} |
-{PRE}[eE][rR][rR][oO][rR][bB][oO][xX]{NOKEYPART} |
-{PRE}[fF][iI][xX][eE][dD][tT][eE][xX][tT]{NOKEYPART} |
-{PRE}[fF][iI][xX][eE][dD][lL][iI][nN][eE]{NOKEYPART} |
-{PRE}[fF][lL][oO][aA][tT][iI][nN][gG][wW][iI][nN][dD][oO][wW]{NOKEYPART} |
-{PRE}[hH][eE][lL][pP][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[iI][dD][lL][iI][sS][tT]{NOKEYPART} |
-{PRE}[iI][mM][aA][gG][eE]{NOKEYPART} |
-{PRE}[iI][mM][aA][gG][eE][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[iI][mM][aA][gG][eE][rR][aA][dD][iI][oO][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[iI][mM][aA][gG][eE][lL][iI][sS][tT]{NOKEYPART} |
-{PRE}[iI][nN][fF][oO][bB][oO][xX]{NOKEYPART} |
-{PRE}[iI][tT][eE][mM][lL][iI][sS][tT]{NOKEYPART} |
-{PRE}[lL][iI][sS][tT][bB][oO][xX]{NOKEYPART} |
-{PRE}[mM][eE][nN][uU]{NOKEYPART} |
-{PRE}[mM][eE][nN][uU][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[mM][eE][nN][uU][iI][tT][eE][mM]{NOKEYPART} |
-{PRE}[mM][eE][tT][rR][iI][cC][fF][iI][eE][lL][dD]{NOKEYPART} |
-{PRE}[mM][oO][dD][aA][lL][dD][iI][aA][lL][oO][gG]{NOKEYPART} |
-{PRE}[mM][oO][dD][eE][lL][eE][sS][sS][dD][iI][aA][lL][oO][gG]{NOKEYPART} |
-{PRE}[mM][uU][lL][tT][iI][lL][iI][nN][eE][eE][dD][iI][tT]{NOKEYPART} |
-{PRE}[nN][uU][mM][eE][rR][iI][cC][fF][iI][eE][lL][dD]{NOKEYPART} |
-{PRE}[oO][kK][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[pP][aA][gG][eE][iI][tT][eE][mM]{NOKEYPART} |
-{PRE}[pP][aA][gG][eE][lL][iI][sS][tT]{NOKEYPART} |
-{PRE}[pP][uU][sS][hH][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[qQ][uU][eE][rR][yY][bB][oO][xX]{NOKEYPART} |
-{PRE}[rR][aA][dD][iI][oO][bB][uU][tT][tT][oO][nN]{NOKEYPART} |
-{PRE}[rR][eE][sS][oO][uU][rR][cC][eE]{NOKEYPART} |
-{PRE}[sS][pP][iI][nN][fF][iI][eE][lL][dD]{NOKEYPART} |
-{PRE}[sS][tT][rR][iI][nN][gG]{NOKEYPART} |
-{PRE}[sS][tT][rR][iI][nN][gG][aA][rR][rR][aA][yY]{NOKEYPART} |
-{PRE}[tT][aA][bB][cC][oO][nN][tT][rR][oO][lL]{NOKEYPART} |
-{PRE}[tT][aA][bB][dD][iI][aA][lL][oO][gG]{NOKEYPART} |
-{PRE}[tT][aA][bB][pP][aA][gG][eE]{NOKEYPART} |
-{PRE}[tT][oO][oO][lL][bB][oO][xX]{NOKEYPART} |
-{PRE}[tT][oO][oO][lL][bB][oO][xX][iI][tT][eE][mM]{NOKEYPART} |
-{PRE}[tT][rR][iI][sS][tT][aA][tT][eE][bB][oO][xX]{NOKEYPART} |
-{PRE}[wW][aA][rR][nN][iI][nN][gG][bB][oO][xX]{NOKEYPART} |
-{PRE}[wW][iI][nN][dD][oO][wW]{NOKEYPART} {
- LOCptr->pushNoKey(yytext, genSrc_lineno);
-}
-
-[hH][eE][lL][pP][iI][dD]{REGKEYPART} {
- LOCptr->registerHelpKey(yytext, genSrc_lineno);
-}
-
-[iI][dD][eE][nN][tT][iI][fF][iI][eE][rR]{REGKEYPART} {
- LOCptr->registerIdentKey(yytext, genSrc_lineno);
-}
-
-[cC][uU][sS][tT][oO][mM][uU][nN][iI][tT][tT][eE][xX][tT]{SAVEKEYPART} |
-[mM][eE][sS][sS][aA][gG][eE]{SAVEKEYPART} |
-[qQ][uU][iI][cC][kK][hH][eE][lL][pP][tT][eE][xX][tT]{SAVEKEYPART} |
-[tT][eE][xX][tT]{SAVEKEYPART} |
-[tT][iI][tT][lL][eE]{SAVEKEYPART} {
- LOCptr->saveData(yytext, genSrc_lineno);
-}
-
-[iI][tT][eE][mM][lL][iI][sS][tT]{SAVEITEMPART} |
-[sS][tT][rR][iI][nN][gG][lL][iI][sS][tT]{SAVEITEMPART} {
- LOCptr->saveItemList(yytext, genSrc_lineno);
-}
-
-"}"[ ]*";" {
- LOCptr->popKey(yytext, genSrc_lineno);
-}
-
-"{" {
- LOCptr->pushPlaceHolder(yytext, genSrc_lineno);
-}
-
-"#define"[ \t]+[a-zA-Z_]+[ \t]+\\\n {
- LOCptr->startDefine(yytext, genSrc_lineno);
-}
-
-"#define"[^\\\n]+\n |
-"//".*\n |
-.|\n {
- LOCptr->collectData(yytext, genSrc_lineno);
+
+"/*" {
+ int i = 1;
+ for (;;)
+ {
+ while ((yytext[++i] = yyinput()) != '*') ;
+ if ((yytext[++i] = yyinput()) == '/')
+ break;
+ }
+ yytext[i] = '\0';
+
+ IMPLptr->copySource(yytext);
+}
+
+
+
+"//".*\n {
+ IMPLptr->copySource(yytext);
+}
+
+
+
+"\"" {
+ int i = 0;
+ for (; (yytext[++i] = yyinput()) != '\"';)
+ if (yytext[i] == '\\')
+ yytext[++i] = yyinput();
+ yytext[i] = '\0';
+
+ LOCptr->setValue(&yytext[1]);
+}
+
+
+
+{PRE}"{"{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->startBlock(yytext);
+}
+
+
+
+{PRE}"}"{SPACE}";"*{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->stopBlock(yytext);
+}
+
+
+
+{PRE}"<"{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setListItem(yytext, true);
+}
+
+
+
+">"{SPACE}";"{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setListItem(yytext, false);
+}
+
+
+
+\n {
+ LOCptr->setNL(yytext, false);
+}
+
+
+
+\\[\r]*\n {
+ LOCptr->setNL(yytext, true);
+}
+
+
+
+"["{SPACE}en-US{SPACE}"]" {
+ LOCptr->setLang(yytext, true);
+}
+
+
+
+"["{SPACE}{IDENT}{SPACE}"]" {
+ LOCptr->setLang(yytext, false);
+}
+
+
+
+{PRE}[bB][iI][tT][mM][aA][pP]{SUF} |
+{PRE}[bB][uU][tT][tT][oO][nN][iI][mM][aA][gG][eE]{SUF} |
+{PRE}[cC][aA][nN][cC][eE][lL][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[cC][hH][eE][cC][kK][bB][oO][xX]{SUF} |
+{PRE}[cC][oO][nN][tT][rR][oO][lL]{SUF} |
+{PRE}[cC][oO][mM][bB][oO][bB][oO][xX]{SUF} |
+{PRE}[eE][dD][iI][tT]{SUF} |
+{PRE}[eE][rR][rR][oO][rR][bB][oO][xX]{SUF} |
+{PRE}[fF][iI][xX][eE][dD][tT][eE][xX][tT]{SUF} |
+{PRE}[fF][iI][xX][eE][dD][lL][iI][nN][eE]{SUF} |
+{PRE}[fF][lL][oO][aA][tT][iI][nN][gG][wW][iI][nN][dD][oO][wW]{SUF} |
+{PRE}[hH][eE][lL][pP][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[iI][dD][lL][iI][sS][tT]{SUF} |
+{PRE}[iI][mM][aA][gG][eE]{SUF} |
+{PRE}[iI][mM][aA][gG][eE][lL][iI][sS][tT]{SUF} |
+{PRE}[iI][mM][aA][gG][eE][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[iI][mM][aA][gG][eE][rR][aA][dD][iI][oO][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[iI][nN][fF][oO][bB][oO][xX]{SUF} |
+{PRE}[lL][iI][sS][tT][bB][oO][xX]{SUF} |
+{PRE}[mM][eE][nN][uU]{SUF} |
+{PRE}[mM][eE][nN][uU][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[mM][eE][nN][uU][iI][tT][eE][mM]{SUF} |
+{PRE}[mM][eE][tT][rR][iI][cC][fF][iI][eE][lL][dD]{SUF} |
+{PRE}[mM][oO][dD][aA][lL][dD][iI][aA][lL][oO][gG]{SUF} |
+{PRE}[mM][oO][dD][eE][lL][eE][sS][sS][dD][iI][aA][lL][oO][gG]{SUF} |
+{PRE}[mM][uU][lL][tT][iI][lL][iI][nN][eE][eE][dD][iI][tT]{SUF} |
+{PRE}[nN][uU][mM][eE][rR][iI][cC][fF][iI][eE][lL][dD]{SUF} |
+{PRE}[oO][kK][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[pP][aA][gG][eE][iI][tT][eE][mM]{SUF} |
+{PRE}[pP][aA][gG][eE][lL][iI][sS][tT]{SUF} |
+{PRE}[pP][uU][sS][hH][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[qQ][uU][eE][rR][yY][bB][oO][xX]{SUF} |
+{PRE}[rR][aA][dD][iI][oO][bB][uU][tT][tT][oO][nN]{SUF} |
+{PRE}[rR][eE][sS][oO][uU][rR][cC][eE]{SUF} |
+{PRE}[sS][pP][iI][nN][fF][iI][eE][lL][dD]{SUF} |
+{PRE}[sS][tT][rR][iI][nN][gG]{SUF} |
+{PRE}[sS][tT][rR][iI][nN][gG][aA][rR][rR][aA][yY]{SUF} |
+{PRE}[tT][aA][bB][cC][oO][nN][tT][rR][oO][lL]{SUF} |
+{PRE}[tT][aA][bB][dD][iI][aA][lL][oO][gG]{SUF} |
+{PRE}[tT][aA][bB][pP][aA][gG][eE]{SUF} |
+{PRE}[tT][oO][oO][lL][bB][oO][xX]{SUF} |
+{PRE}[tT][oO][oO][lL][bB][oO][xX][iI][tT][eE][mM]{SUF} |
+{PRE}[tT][rR][iI][sS][tT][aA][tT][eE][bB][oO][xX]{SUF} |
+{PRE}[wW][aA][rR][nN][iI][nN][gG][bB][oO][xX]{SUF} |
+{PRE}[wW][iI][nN][dD][oO][wW]{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setCmd(yytext);
+}
+
+
+
+{PRE}[hH][eE][lL][pP][iI][dD]{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setId(yytext, false);
+}
+
+
+
+{PRE}[iI][dD][eE][nN][tT][iI][fF][iI][eE][rR]{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setId(yytext, true);
+}
+
+
+
+{PRE}[cC][uU][sS][tT][oO][mM][uU][nN][iI][tT][tT][eE][xX][tT]{SUFT} |
+{PRE}[mM][eE][sS][sS][aA][gG][eE]{SUFT} |
+{PRE}[qQ][uU][iI][cC][kK][hH][eE][lL][pP][tT][eE][xX][tT]{SUFT} |
+{PRE}[tT][eE][xX][tT]{SUFT} |
+{PRE}[tT][iI][tT][lL][eE]{SUFT} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setText(yytext);
+}
+
+
+
+{PRE}[iI][tT][eE][mM][lL][iI][sS][tT]{SUFT} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setList(yytext);
+}
+
+
+
+{PRE}[sS][tT][rR][iI][nN][gG][lL][iI][sS][tT]{SUFT} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setStringList(yytext);
+}
+
+
+
+{PRE}"#define"{SUF} {
+ yyless(strlen(yytext)-1);
+ LOCptr->setMacro(yytext);
+}
+
+
+
+{IDENT} {
+ LOCptr->setName(yytext);
+}
+
+
+
+. {
+ IMPLptr->copySource(yytext);
}
%%
Modified: openoffice/branches/l10n/main/l10ntools/source/gConUlf.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConUlf.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConUlf.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConUlf.hxx Tue Feb 19 16:26:26 2013
@@ -39,14 +39,14 @@ class convert_ulf : public convert_gen_i
convert_ulf(l10nMem& crMemory);
~convert_ulf();
- void setKey(char *syyText, int iLineNo);
- void setText(char *syyText, int iLineNo);
+ void setKey(char *syyText);
+ void setText(char *syyText);
private:
- std::string msKey;
+ std::string msKey;
void execute();
- void handleLines();
+ void handleLines();
};
#endif
\ No newline at end of file
Modified: openoffice/branches/l10n/main/l10ntools/source/gConUlfWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConUlfWrap.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConUlfWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConUlfWrap.cxx Tue Feb 19 16:26:26 2013
@@ -58,9 +58,9 @@ void convert_ulf::execute()
/********************** I M P L E M E N T A T I O N **********************/
-void convert_ulf::setKey(char *syyText, int iLineno)
+void convert_ulf::setKey(char *syyText)
{
- std::string sText = copySource(syyText, iLineno);
+ std::string sText = copySource(syyText);
// locate key (is any)
msKey = sText.substr(1,sText.size()-2);
@@ -69,17 +69,17 @@ void convert_ulf::setKey(char *syyText,
/********************** I M P L E M E N T A T I O N **********************/
-void convert_ulf::setText(char *syyText, int iLineno)
+void convert_ulf::setText(char *syyText)
{
- std::string useText, sText = copySource(syyText, iLineno);
+ std::string useText, sText = copySource(syyText);
int nL;
// isolate text
nL = sText.find("=");
if (nL == (int)std::string::npos)
- return;
- isolateText(sText, nL+1, &nL, useText);
+ return;
+//JIX isolateText(sText, nL+1, &nL, useText);
if (mbMergeMode)
{
@@ -88,8 +88,8 @@ void convert_ulf::setText(char *syyText,
std::string sNewLine;
nL = cExtraLangauges.size();
- // and all other languages for that key
- for (int i = 0; i < nL; ++i)
+ // and all other languages for that key
+ for (int i = 0; i < nL; ++i)
{
sNewLine = cExtraLangauges[i]->msLanguage + " = \"" +
cExtraLangauges[i]->msText +
Modified: openoffice/branches/l10n/main/l10ntools/source/gConUlflex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConUlflex.l?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConUlflex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConUlflex.l Tue Feb 19 16:26:26 2013
@@ -60,14 +60,14 @@
%%
"["[^\]]*"]" {
- LOCptr->setKey(yytext, genulf_lineno);
+ LOCptr->setKey(yytext);
}
"en-US"[ ]*"="[^\n]* {
- LOCptr->setText(yytext, genulf_lineno);
+ LOCptr->setText(yytext);
}
.|\n {
- IMPLptr->collectData(yytext, genulf_lineno);
+ IMPLptr->copySource(yytext);
}
%%
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx Tue Feb 19 16:26:26 2013
@@ -39,14 +39,14 @@ class convert_xcs : public convert_gen_i
convert_xcs(l10nMem& crMemory);
~convert_xcs();
- void setKey(char *syyText, int iLineNo);
- void unsetKey(char *syyText, int iLineNo);
- void startCollectData(char *syyText, int iLineNo);
- void stopCollectData(char *syyText, int iLineNo);
+ void setKey(char *syyText);
+ void unsetKey(char *syyText);
+ void startCollectData(char *syyText);
+ void stopCollectData(char *syyText);
private:
- std::string msKey;
- bool mbCollectingData;
+ std::string msKey;
+ bool mbCollectingData;
void execute();
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx Tue Feb 19 16:26:26 2013
@@ -35,7 +35,7 @@
/************ I N T E R F A C E I M P L E M E N T A T I O N ************/
convert_xcs::convert_xcs(l10nMem& crMemory)
- : convert_gen_impl(crMemory),
+ : convert_gen_impl(crMemory),
mbCollectingData(false)
{
}
@@ -69,19 +69,19 @@ void convert_xcs::execute()
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcs::setKey(char *syyText, int iLineno)
+void convert_xcs::setKey(char *syyText)
{
int nL;
- std::string sHead, sText = copySource(syyText, iLineno);
+ std::string sHead, sText = copySource(syyText);
// is it to be translated
if (sText.find("oor:localized=") == std::string::npos)
- return;
+ return;
// locate key (is any)
nL = sText.find("oor:name=\"");
if (nL == (int)std::string::npos)
- return;
+ return;
sHead = sText.substr(nL+10);
nL = sHead.find("\"");
msKey = sHead.substr(0,nL);
@@ -90,27 +90,27 @@ void convert_xcs::setKey(char *syyText,
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcs::unsetKey(char *syyText, int iLineno)
+void convert_xcs::unsetKey(char *syyText)
{
- copySource(syyText, iLineno);
+ copySource(syyText);
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcs::startCollectData(char *syyText, int iLineno)
+void convert_xcs::startCollectData(char *syyText)
{
- copySource(syyText, iLineno);
+ copySource(syyText);
if (!msKey.size())
- return;
+ return;
}
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcs::stopCollectData(char *syyText, int iLineno)
+void convert_xcs::stopCollectData(char *syyText)
{
- std::string sHead, sKey, sLang, sText, sCollectedText = copySource(syyText, iLineno, false);
+ std::string sHead, sKey, sLang, sText, sCollectedText = copySource(syyText, false);
int nL;
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l Tue Feb 19 16:26:26 2013
@@ -60,22 +60,22 @@
%%
"<prop"[^>]*> {
- LOCptr->setKey(yytext, genxcs_lineno);
+ LOCptr->setKey(yytext);
}
"</prop>" {
- LOCptr->unsetKey(yytext, genxcs_lineno);
+ LOCptr->unsetKey(yytext);
}
"<value"[^>]*> {
- LOCptr->startCollectData(yytext, genxcs_lineno);
+ LOCptr->startCollectData(yytext);
}
"</value>" {
- LOCptr->stopCollectData(yytext, genxcs_lineno);
+ LOCptr->stopCollectData(yytext);
}
.|\n {
- IMPLptr->collectData(yytext, genxcs_lineno);
+ IMPLptr->copySource(yytext);
}
%%
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx Tue Feb 19 16:26:26 2013
@@ -41,16 +41,16 @@ class convert_xcu : public convert_gen_i
convert_xcu(l10nMem& crMemory);
~convert_xcu();
- void pushKeyPart(TAG_TYPE eIsNode, char *syyText, int iLineNo);
- void popKeyPart (TAG_TYPE eIsNode, char *syyText, int iLineNo);
+ void pushKeyPart(TAG_TYPE eIsNode, char *syyText);
+ void popKeyPart (TAG_TYPE eIsNode, char *syyText);
- void startCollectData(char *syyText, int iLineNo);
- void stopCollectData(char *syyText, int iLineNo);
+ void startCollectData(char *syyText);
+ void stopCollectData(char *syyText);
private:
std::vector<std::string> mcStack;
- std::string msObj;
- bool mbCollectingData;
+ std::string msObj;
+ bool mbCollectingData;
void execute();
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx Tue Feb 19 16:26:26 2013
@@ -34,7 +34,7 @@
/************ I N T E R F A C E I M P L E M E N T A T I O N ************/
convert_xcu::convert_xcu(l10nMem& crMemory)
- : convert_gen_impl(crMemory),
+ : convert_gen_impl(crMemory),
mbCollectingData(false)
{
}
@@ -67,21 +67,21 @@ void convert_xcu::execute()
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcu::pushKeyPart(TAG_TYPE bIsNode, char *syyText, int iLineno)
+void convert_xcu::pushKeyPart(TAG_TYPE bIsNode, char *syyText)
{
- std::string sKey, sTag = copySource(syyText, iLineno);
+ std::string sKey, sTag = copySource(syyText);
int nL, nE;
// find key in tag
nL = sTag.find("oor:name=\"");
if (nL == (int)std::string::npos)
- return;
+ return;
// find end of key
nL += 10;
nE = sTag.find("\"", nL);
if (nE == (int)std::string::npos)
- return;
+ return;
sKey = sTag.substr(nL, nE - nL);
mcStack.push_back(sKey);
@@ -90,9 +90,9 @@ void convert_xcu::pushKeyPart(TAG_TYPE b
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcu::popKeyPart(TAG_TYPE bIsNode, char *syyText, int iLineno)
+void convert_xcu::popKeyPart(TAG_TYPE bIsNode, char *syyText)
{
- copySource(syyText, iLineno);
+ copySource(syyText);
// check for correct node/prop relations
if (mcStack.size())
@@ -102,10 +102,10 @@ void convert_xcu::popKeyPart(TAG_TYPE bI
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcu::startCollectData(char *syyText, int iLineno)
+void convert_xcu::startCollectData(char *syyText)
{
int nL;
- std::string sTag = copySource(syyText, iLineno);
+ std::string sTag = copySource(syyText);
// locate object name
for (nL = 1; sTag[nL] != ' '; ++nL) ;
@@ -117,21 +117,21 @@ void convert_xcu::startCollectData(char
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xcu::stopCollectData(char *syyText, int iLineno)
+void convert_xcu::stopCollectData(char *syyText)
{
int nL;
std::string useKey, useText = msCollector;
- copySource(syyText, iLineno);
+ copySource(syyText);
// time to do something ?
if (!mbCollectingData)
- return;
+ return;
mbCollectingData = false;
// locate key and extract it
for (nL = 0; nL < (int)mcStack.size(); ++nL)
- useKey += (nL > 0 ? "." : "") + mcStack[nL];
+ useKey += (nL > 0 ? "." : "") + mcStack[nL];
if (mbMergeMode)
{
@@ -143,7 +143,7 @@ void convert_xcu::stopCollectData(char *
for (int i = 0; i < nL; ++i)
{
sNewLine = "<value xml:lang=\"" + cExtraLangauges[i]->msLanguage + "\">" +
- cExtraLangauges[i]->msText + "</value>";
+ cExtraLangauges[i]->msText + "</value>";
writeSourceFile(sNewLine);
}
}
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXculex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXculex.l?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXculex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXculex.l Tue Feb 19 16:26:26 2013
@@ -60,39 +60,39 @@
%%
"<oor:component-data "[^>]*> {
- LOCptr->pushKeyPart(convert_xcu::TAG_COMPONENT, yytext, genxcu_lineno);
+ LOCptr->pushKeyPart(convert_xcu::TAG_COMPONENT, yytext);
}
"</oor:component-data>" {
- LOCptr->popKeyPart(convert_xcu::TAG_COMPONENT, yytext, genxcu_lineno);
+ LOCptr->popKeyPart(convert_xcu::TAG_COMPONENT, yytext);
}
"<prop oor:name=\""[^\"]*\" {
- LOCptr->pushKeyPart(convert_xcu::TAG_PROP, yytext, genxcu_lineno);
+ LOCptr->pushKeyPart(convert_xcu::TAG_PROP, yytext);
}
"</prop>" {
- LOCptr->popKeyPart(convert_xcu::TAG_PROP, yytext, genxcu_lineno);
+ LOCptr->popKeyPart(convert_xcu::TAG_PROP, yytext);
}
"<node oor:name=\""[^\"]*\" {
- LOCptr->pushKeyPart(convert_xcu::TAG_NODE, yytext, genxcu_lineno);
+ LOCptr->pushKeyPart(convert_xcu::TAG_NODE, yytext);
}
"</node>" {
- LOCptr->popKeyPart(convert_xcu::TAG_NODE, yytext, genxcu_lineno);
+ LOCptr->popKeyPart(convert_xcu::TAG_NODE, yytext);
}
"<value xml:lang=\""[^\"]*\"[^>]*">" {
- LOCptr->startCollectData(yytext, genxcu_lineno);
+ LOCptr->startCollectData(yytext);
}
"</value>" {
- LOCptr->stopCollectData(yytext, genxcu_lineno);
+ LOCptr->stopCollectData(yytext);
}
.|\n {
- IMPLptr->collectData(yytext, genxcu_lineno);
+ IMPLptr->copySource(yytext);
}
%%
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx Tue Feb 19 16:26:26 2013
@@ -39,13 +39,13 @@ class convert_xhp : public convert_gen_i
convert_xhp(l10nMem& crMemory);
~convert_xhp();
- void startCollectData(std::string sType, std::string& sCollectedText, int iLineNo);
- void stopCollectData(std::string sType, std::string& sCollectedText, int iLineNo);
+ void startCollectData(std::string sType, std::string& sCollectedText);
+ void stopCollectData(std::string sType, std::string& sCollectedText);
private:
- std::string msMergeType;
+ std::string msMergeType;
std::string msTag;
- bool mbCollectingData;
+ bool mbCollectingData;
void execute();
};
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx Tue Feb 19 16:26:26 2013
@@ -35,7 +35,7 @@
/************ I N T E R F A C E I M P L E M E N T A T I O N ************/
convert_xhp::convert_xhp(l10nMem& crMemory)
- : convert_gen_impl(crMemory),
+ : convert_gen_impl(crMemory),
mbCollectingData(false)
{
}
@@ -70,7 +70,7 @@ void convert_xhp::execute()
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xhp::startCollectData(std::string sType, std::string& sCollectedText, int iLineno)
+void convert_xhp::startCollectData(std::string sType, std::string& sCollectedText)
{
if (mbMergeMode)
writeSourceFile(msCollector+sCollectedText);
@@ -88,7 +88,7 @@ void convert_xhp::startCollectData(std::
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xhp::stopCollectData(std::string sType, std::string& sCollectedText, int iLineno)
+void convert_xhp::stopCollectData(std::string sType, std::string& sCollectedText)
{
std::string sKey;
int nL;
@@ -96,7 +96,7 @@ void convert_xhp::stopCollectData(std::s
// check tag match
if (sType != msMergeType)
- throw "Conflicting tags: " + msTag + msCollector + sCollectedText;
+ throw "Conflicting tags: " + msTag + msCollector + sCollectedText;
// locate key and extract it
nL = msTag.find("id=") +4;
@@ -109,10 +109,10 @@ void convert_xhp::stopCollectData(std::s
std::string sNewLine;
nL = cExtraLangauges.size();
- // write en-US entry
+ // write en-US entry
writeSourceFile(msCollector+sCollectedText);
- // and all other languages for that key
+ // and all other languages for that key
for (int i = 0; i < nL; ++i)
{
sNewLine = "\n<" + sType + " id=\"" + sKey + "\"" + " xml:lang=\"" +
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l Tue Feb 19 16:26:26 2013
@@ -61,37 +61,37 @@
"<title"[^>]*> {
std::string text(yytext);
- LOCptr->startCollectData(text.substr(1,5), text, genXhp_lineno);
+ LOCptr->startCollectData(text.substr(1,5), text);
}
"<bookmark "[^>]*> {
std::string text(yytext);
- LOCptr->startCollectData(text.substr(1,8), text, genXhp_lineno);
+ LOCptr->startCollectData(text.substr(1,8), text);
}
"<paragraph"[^>]*> {
std::string text(yytext);
- LOCptr->startCollectData(text.substr(1,9), text, genXhp_lineno);
+ LOCptr->startCollectData(text.substr(1,9), text);
}
"</paragraph>" {
std::string text(yytext);
- LOCptr->stopCollectData(text.substr(2,9), text, genXhp_lineno);
+ LOCptr->stopCollectData(text.substr(2,9), text);
}
"</bookmark>" {
std::string text(yytext);
- LOCptr->stopCollectData(text.substr(2,8), text, genXhp_lineno);
+ LOCptr->stopCollectData(text.substr(2,8), text);
}
"</title>" {
std::string text(yytext);
- LOCptr->stopCollectData(text.substr(2,5), text, genXhp_lineno);
+ LOCptr->stopCollectData(text.substr(2,5), text);
}
.|\n {
std::string text(yytext);
- IMPLptr->collectData(yytext, genXhp_lineno);
+ IMPLptr->copySource(yytext);
}
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx Tue Feb 19 16:26:26 2013
@@ -39,13 +39,13 @@ class convert_xrm : public convert_gen_i
convert_xrm(l10nMem& crMemory);
~convert_xrm();
- void startCollectData(std::string sType, std::string& sCollectedText, int iLineNo);
- void stopCollectData(std::string sType, std::string& sCollectedText, int iLineNo);
+ void startCollectData(std::string sType, std::string& sCollectedText);
+ void stopCollectData(std::string sType, std::string& sCollectedText);
private:
- std::string msTag;
- std::string msMergeType;
- bool mbCollectingData;
+ std::string msTag;
+ std::string msMergeType;
+ bool mbCollectingData;
void execute();
};
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx Tue Feb 19 16:26:26 2013
@@ -34,7 +34,7 @@
/************ I N T E R F A C E I M P L E M E N T A T I O N ************/
convert_xrm::convert_xrm(l10nMem& crMemory)
- : convert_gen_impl(crMemory),
+ : convert_gen_impl(crMemory),
mbCollectingData(false)
{
}
@@ -70,7 +70,7 @@ void convert_xrm::execute()
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xrm::startCollectData(std::string sType, std::string& sCollectedText, int iLineno)
+void convert_xrm::startCollectData(std::string sType, std::string& sCollectedText)
{
if (mbMergeMode)
writeSourceFile(msCollector+sCollectedText);
@@ -84,7 +84,7 @@ void convert_xrm::startCollectData(std::
/********************** I M P L E M E N T A T I O N **********************/
-void convert_xrm::stopCollectData(std::string sType, std::string& sCollectedText, int iLineno)
+void convert_xrm::stopCollectData(std::string sType, std::string& sCollectedText)
{
std::string sKey;
int nL;
@@ -92,7 +92,7 @@ void convert_xrm::stopCollectData(std::s
// check tag match
if (sType != msMergeType)
- throw "Conflicting tags: " + msTag + msCollector + sCollectedText;
+ throw "Conflicting tags: " + msTag + msCollector + sCollectedText;
// locate key and extract it
nL = msTag.find("id=") +4;
@@ -105,11 +105,11 @@ void convert_xrm::stopCollectData(std::s
std::string sNewLine;
nL = cExtraLangauges.size();
- // write en-US entry
+ // write en-US entry
writeSourceFile(msCollector+sCollectedText);
- // and all other languages for that key
- for (int i = 0; i < nL; ++i)
+ // and all other languages for that key
+ for (int i = 0; i < nL; ++i)
{
sNewLine = "\n<" + sType + " id=\"" + sKey + "\"" + " xml:lang=\"" +
cExtraLangauges[i]->msLanguage + "\">" +
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXrmlex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrmlex.l?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXrmlex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXrmlex.l Tue Feb 19 16:26:26 2013
@@ -61,26 +61,26 @@
"<p"[^>]*> {
std::string text(yytext);
- LOCptr->startCollectData(text.substr(1,1), text, genXrm_lineno);
+ LOCptr->startCollectData(text.substr(1,1), text);
}
"<h"[0-9][^>]*> {
std::string text(yytext);
- LOCptr->startCollectData(text.substr(1,2), text, genXrm_lineno);
+ LOCptr->startCollectData(text.substr(1,2), text);
}
"</p>" {
std::string text(yytext);
- LOCptr->stopCollectData(text.substr(2,1), text, genXrm_lineno);
+ LOCptr->stopCollectData(text.substr(2,1), text);
}
"</h"[0-9]> {
std::string text(yytext);
- LOCptr->stopCollectData(text.substr(2,2), text, genXrm_lineno);
+ LOCptr->stopCollectData(text.substr(2,2), text);
}
.|\n {
- IMPLptr->collectData(yytext, genXrm_lineno);
+ IMPLptr->copySource(yytext);
}
Modified: openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gHandler.cxx Tue Feb 19 16:26:26 2013
@@ -153,7 +153,7 @@ void handler::checkCommandLine(int argc,
" insert, uses the module file <source dir>/<module name> to\n"
" update the source files in the module"
"\n"
- " -v verbose mode, tells what gLang is doing\n"
+ " -v verbose mode, tells what gLang is doing\n"
" -m <modulename> name of the module, used in file naming\n"
" -s <source dir> extract: source file directory\n"
" merge: language staging input directory\n"
@@ -217,16 +217,16 @@ void handler::runExtractMerge(bool bMerg
// loop through all source files, and extract messages from each file
for (std::vector<std::string>::iterator siSource = msSourceFiles.begin(); siSource != msSourceFiles.end(); ++siSource)
{
- // tell system
- if (mbVerbose)
- std::cout << "gLang extracting text from file " << *siSource << std::endl;
+ // tell system
+ if (mbVerbose)
+ std::cout << "gLang extracting text from file " << *siSource << std::endl;
- // prepare translation memory
+ // prepare translation memory
mcMemory.setFileName(*siSource);
// get converter and extract files
- convert_gen convertObj(msSourceDir + *siSource, mcMemory, bMerge);
- convertObj.execute();
+ convert_gen convertObj(msSourceDir + *siSource, mcMemory, bMerge);
+ convertObj.execute();
}
// and generate language file
Modified: openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx Tue Feb 19 16:26:26 2013
@@ -35,15 +35,15 @@
/********************** I M P L E M E N T A T I O N **********************/
l10nMem_entry::l10nMem_entry(const std::string& srSourceFile, const std::string& srModuleName,
const std::string& srKey, const std::string& srObjectType,
- const std::string& srLanguage, const std::string& srText,
- const int iIndex)
+ const std::string& srLanguage, const std::string& srText,
+ const int iIndex)
: msSourceFile(srSourceFile),
msModuleName(srModuleName),
msKey(srKey),
- msObjectType(srObjectType),
+ msObjectType(srObjectType),
msLanguage(srLanguage),
msText(srText),
- miIndex(iIndex)
+ miIndex(iIndex)
{
}
@@ -79,14 +79,14 @@ void l10nMem::save(const std::string& sr
if (!outputFile.is_open())
throw std::string("Could not open ")+srTargetFile;
-
+
for (i = 0; i < (int)mcMemory.size(); ++i)
{
- outputFile << mcMemory[i].msModuleName << "\t" << mcMemory[i].msSourceFile << "\t"
- << mcMemory[i].msKey;
- if (mcMemory[i].miIndex)
- outputFile << "." << mcMemory[i].miIndex;
- outputFile << "." << mcMemory[i].msObjectType << "\t" << mcMemory[i].msLanguage << "\t"
+ outputFile << mcMemory[i].msModuleName << "\t" << mcMemory[i].msSourceFile << "\t"
+ << mcMemory[i].msKey;
+ if (mcMemory[i].miIndex)
+ outputFile << "." << mcMemory[i].miIndex;
+ outputFile << "." << mcMemory[i].msObjectType << "\t" << mcMemory[i].msLanguage << "\t"
<< mcMemory[i].msText << std::endl;
}
// JIX
Modified: openoffice/branches/l10n/main/l10ntools/source/gLang.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gLang.hxx?rev=1447794&r1=1447793&r2=1447794&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gLang.hxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gLang.hxx Tue Feb 19 16:26:26 2013
@@ -45,16 +45,16 @@ class l10nMem_entry
public:
l10nMem_entry(const std::string& srSourceFile, const std::string& srModuleName, const std::string& srKey,
const std::string& srObjectType, const std::string& srLanguage, const std::string& srText,
- const int iIndex);
+ const int iIndex);
~l10nMem_entry();
std::string msSourceFile;
std::string msModuleName;
std::string msKey;
- std::string msObjectType;
+ std::string msObjectType;
std::string msLanguage;
std::string msText;
- int miIndex;
+ int miIndex;
private:
};
@@ -69,7 +69,7 @@ class l10nMem
~l10nMem();
void save (const std::string& srTargetFile);
- void clear();
+ void clear();
void setFileName (const std::string& srSourceFile);
void setModuleName(const std::string& srModuleName);
void setEnUsKey (const std::string& srKey, const std::string& srObjectType, const std::string& srText, int iIndex = 0);
@@ -88,10 +88,10 @@ class l10nMem
class convert_gen
{
public:
- convert_gen(const std::string& srSourceFile, l10nMem& crMemory, const bool bMerge);
- ~convert_gen();
+ convert_gen(const std::string& srSourceFile, l10nMem& crMemory, const bool bMerge);
+ ~convert_gen();
- // do extract/merge
+ // do extract/merge
void execute();
};
@@ -114,7 +114,7 @@ class handler
std::string msSourceDir;
std::string msTargetDir;
std::vector<std::string> msSourceFiles;
- bool mbVerbose;
+ bool mbVerbose;
void runExtractMerge(bool bMerge);
void runGenerate();