openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1416218 [1/2] - /openoffice/branches/l10n/main/l10ntools/source/
Date Sun, 02 Dec 2012 18:06:48 GMT
Author: jani
Date: Sun Dec  2 18:06:44 2012
New Revision: 1416218

URL: http://svn.apache.org/viewvc?rev=1416218&view=rev
Log:
files for new l10n process

Added:
    openoffice/branches/l10n/main/l10ntools/source/gCon.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConSrcUtil.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXculex.l   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXrm.hxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXrmWrap.cxx   (with props)
    openoffice/branches/l10n/main/l10ntools/source/gConXrmlex.l   (with props)

Added: openoffice/branches/l10n/main/l10ntools/source/gCon.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gCon.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gCon.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gCon.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,171 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ ****************************   G C O N . C X X   ****************************
+ *****************************************************************************
+ * This is the generic conversion module, it handles all generic work of the
+ * conversion, and offer utility functions to the specific conversion classes
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_gen::convert_gen(const string& srSourceFile, l10nMem& crMemory)
+                        : msSourceFile(srSourceFile),
+                          mcMemory(crMemory)
+{
+  ifstream inputFile(msSourceFile.c_str(), ios::binary);
+
+  
+  if (!inputFile.is_open())
+    throw string("Could not open ")+msSourceFile;
+
+  // get length of file:
+  mnSourceReadIndex = 0;
+  inputFile.seekg (0, ios::end);
+  msSourceBuffer.resize((unsigned int)inputFile.tellg());
+  inputFile.seekg (0, ios::beg);
+
+  // get size, prepare string and read whole file
+  inputFile.read((char *)msSourceBuffer.c_str(), msSourceBuffer.size());
+  if ((unsigned int)inputFile.gcount() != msSourceBuffer.size())
+    throw string("cannot read whole file: "+msSourceFile);
+  inputFile.close();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_gen::~convert_gen()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_gen& convert_gen::getConverter(const string& srSourceFile, l10nMem& crMemory)
+{
+  // did the user give a .xxx with the source file ?
+  int nInx = srSourceFile.find_last_of(".");
+  if (nInx <= 0)
+    throw string("source file: ")+srSourceFile+" missing extension";
+
+  // find correct conversion class
+  string sExtension = srSourceFile.substr(nInx+1);
+
+  // did the user give a .xxx with the source file ?
+  if (sExtension == "hrc" || sExtension == "src") return *(new convert_src (srSourceFile, crMemory));
+  if (sExtension == "tree")                       return *(new convert_tree(srSourceFile, crMemory));
+  if (sExtension == "ulf")                        return *(new convert_ulf (srSourceFile, crMemory));
+  if (sExtension == "xcu")                        return *(new convert_xcu (srSourceFile, crMemory));
+  if (sExtension == "xcs")                        return *(new convert_xcs (srSourceFile, crMemory));
+  if (sExtension == "xrm")                        return *(new convert_xrm (srSourceFile, crMemory));
+  if (sExtension == "xhp")                        return *(new convert_xhp (srSourceFile, crMemory));
+  if (sExtension == "properties")                 return *(new convert_properties(srSourceFile, crMemory));
+
+  throw string("unknown extension on source file: ")+srSourceFile;
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_gen::lexRead(char *sBuf, int *nResult, int nMax_size)
+{
+  // did we hit eof
+  if (mnSourceReadIndex == -1)
+  {
+    *nResult = 0;
+    return;
+  }
+
+  // assume we can copy all that are left.
+  *nResult = msSourceBuffer.size() - mnSourceReadIndex;
+
+  // space enough for the whole line ?
+  if (*nResult <= nMax_size)
+  {
+    msSourceBuffer.copy(sBuf, *nResult, mnSourceReadIndex);
+    mnSourceReadIndex = -1;
+  }
+  else
+  {
+    msSourceBuffer.copy(sBuf, nMax_size, mnSourceReadIndex);
+    *nResult           = nMax_size;
+    mnSourceReadIndex += nMax_size;
+  }
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_gen::lineRead(bool *bEof, 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 == msSourceBuffer.npos)
+    nNextLF = msSourceBuffer.size()+1;
+
+  // copy string
+  line              = msSourceBuffer.substr(mnSourceReadIndex, nNextLF - mnSourceReadIndex-1);
+  mnSourceReadIndex = nNextLF +1;
+  *bEof             = false;
+  return;
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_gen::writeSourceFile(const string& line)
+{
+  cout << line;
+  // JIX
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_gen::trim(string& sLine)
+{
+  int nL;
+
+  // remove leading spaces
+  nL = sLine.find_first_not_of(" \t");
+  if (nL != string::npos)
+    sLine.erase(0, nL);
+
+  // remove trailing spaces
+  nL = sLine.find_last_not_of(" \t");
+  if (nL != string::npos)
+    sLine.erase(nL +1);
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gCon.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,63 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ ************************   G C O N P R O P . C X X   ************************
+ *****************************************************************************
+ * This is the conversion for .properties files
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_properties::convert_properties(const string& srSourceFile, l10nMem& crMemory)
+                                      : convert_gen(srSourceFile, crMemory)
+{
+  throw string("convert_properties not implemented");
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_properties::~convert_properties()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_properties::extract()
+{
+  throw string("convert_properties::extract not implemented");
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_properties::insert()
+{
+  throw string("convert_properties::insert not implemented");
+}
+

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConProp.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,80 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConSrc.hxx"
+
+
+
+
+/*****************************************************************************
+ *************************   G C O N S R C . C X X   *************************
+ *****************************************************************************
+ * This is the conversion for .src and .hrc files, it uses lex to analyze
+ *****************************************************************************/
+
+
+
+/*****************************   G L O B A L S   *****************************/
+convert_src_impl * convert_src::mcpImpl;
+
+
+
+/************   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(const string& srSourceFile, l10nMem& crMemory)
+                                : convert_gen(srSourceFile, crMemory) 
+                            {mcpImpl = new convert_src_impl(srSourceFile, crMemory);}
+convert_src::~convert_src() {delete mcpImpl;}
+void convert_src::extract() {mcpImpl->extract();}
+void convert_src::insert()  {mcpImpl->insert();}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_src_impl::convert_src_impl(const string& srSourceFile, l10nMem& crMemory)
+                                  : convert_gen           (srSourceFile, crMemory)
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_src_impl::~convert_src_impl()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_src_impl::extract()
+{
+  // run lex parser and build token tree
+  runLex();
+
+  //JIX
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_src_impl::insert()
+{
+  //JIX
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConSrc.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,84 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+#ifndef GCONSRCHXX
+#define GCONSRCHXX
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N S R C . H X X   *************************
+ *****************************************************************************
+ * This is the class header for .src and .hrc conversion
+ *****************************************************************************/
+
+
+
+/*****************   T E M P L A T E   D E F I N I T I O N   *****************/
+#if 0
+template<typename T>
+  void RemoveChars(std::basic_string<T> & Str, const T *CharsToRemove)
+  {
+    std::basic_string<T>::size_type pos = 0;
+    while ( (pos = Str.find_first_of(CharsToRemove, pos)) != std::basic_string<T>::npos)
+        Str.erase(pos, 1); 
+  }
+#endif
+
+
+
+/********************   C L A S S   D E F I N I T I O N   ********************/
+class convert_src_impl : public convert_gen
+{
+  public:
+    typedef enum
+    {
+      IGNORED      = 400,
+      COMMEND,        DEFINEDRES, ANYTOKEN,  UNKNOWNTOKEN,  UNKNOWNCONSTRUCTION, UNKNOWNCHAR,
+      FILTER_LEVEL = 500,
+      CONDITION,      EMPTYLINE,  RESSOURCE, RESSOURCEEXPR, SMALRESSOURCE,       TEXTLINE,
+      LONGTEXTLINE,   TEXT,       LEVELUP,   LEVELDOWN,     APPFONTMAPPING,      ASSIGNMENT, 
+      LISTASSIGNMENT, LISTTEXT,   RSCDEFINE, RSCDEFINELEND, NEWTEXTINRES,        UIENTRIES, 
+      PRAGMA,         _LISTTEXT,  TEXTREFID, LISTRESID,     _LISTRESID,          NORMDEFINE
+    } LEX_TOKENS;
+
+    convert_src_impl(const string& srSourceFile, l10nMem& crMemory);
+    ~convert_src_impl();
+    
+    void addTokenToSet(LEX_TOKENS nToken, string srYYtext);
+    void addCommentToSet(LEX_TOKENS nToken, string srYYtext);
+
+  private:
+    class tokenStorageEntry
+    {
+      public:
+        tokenStorageEntry(LEX_TOKENS nToken, string& sYYtext): mnToken(nToken), msYYtext(sYYtext){};
+        LEX_TOKENS mnToken;
+        string     msYYtext;
+    };
+
+    void runLex();
+    void extract();
+    void insert();
+
+    friend class convert_src;
+};
+#endif

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConSrc.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConSrcUtil.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrcUtil.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrcUtil.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrcUtil.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,91 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConSrc.hxx"
+
+
+
+/*****************************************************************************
+ *********************   G C O N S R C U T I L . C X X   *********************
+ *****************************************************************************
+ * This is the conversion for .src and .hrc files
+ * this is the actual conversion based on the lex tree
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+#if 0
+
+TARGET
+  utf8conv
+  export2
+  merge
+
+
+transex3
+  export
+  srciter
+  file
+  directory
+        srclex.l (src_yy)
+        src_yy_wrapper
+
+helpex
+        helpmerge
+        xmlparse
+        helpex
+
+ulfex
+  lngmerge
+        lngex
+
+cfgex
+  cfgmerge
+        cfglex.l (cfg_yy)
+        cfg_yy_wrapper
+
+xrmex
+        xrmmerge
+        xrmlex.l (xrm_yy)
+        xrm_yy_wrapper
+
+xhtex
+       <python>
+
+xtxex
+       <python>
+
+
+.hrc .src    -->  transex3 -UTF8 -e      
+.tree        -->  xhtex
+m  .xtx         -->  xtxex
+.ulf         -->  ulfex  -e
+m  .xxl .xrb    -->  xmlex -UTF8 -e
+m  .xgf         -->  xmlex -UTF8 -e -t:xgf
+.xcu .xcd    -->  cfgex -UTF8 -e
+.xcs         -->  cfgex -UTF8 -e -f
+.xrm         -->  xrmex -UTF8 -e
+.xhp         -->  helpex -e
+.properties  -->  jpropex  -e
+
+
+#endif

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConSrcUtil.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,102 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConSrc.hxx"
+
+
+
+/*****************************************************************************
+ *********************   G C O N S R C W R A P . C X X   *********************
+ *****************************************************************************
+ * This includes the c code generated by flex
+ *****************************************************************************/
+
+
+
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+#include "gConSrc_yy.c"
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_src_impl::addTokenToSet(LEX_TOKENS nToken, string srYYtext)
+{
+//JIX
+#if 0
+  tokenStorage newToken;
+
+  newToken.mnToken = nToken;
+  newToken.msYYtext = srYYtext;
+
+  mcTokenSet.push_back(newToken);
+#endif
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_src_impl::addCommentToSet(LEX_TOKENS nToken, string srYYtext)
+{
+  char buf[2];
+  bool check_comment_terminate;
+
+
+  // loop and collect whole comment
+  for (check_comment_terminate = false, buf[1] = '\0';;)
+  {
+    buf[0] = yyinput();
+
+    // end of file ?
+    if (!buf[0])
+      break;
+
+    // remember byte
+    srYYtext.append(buf);
+
+    // did we receive ยด*' ?
+    if (check_comment_terminate)
+    {
+      // end of comment ?
+      if (buf[0] == '/')
+        break;
+
+      // it was not the end of comment
+      check_comment_terminate = false;
+    }
+    else
+      // Start on end of comment ?
+      if (buf[0] == '*')
+        check_comment_terminate = true;
+  }
+
+  addTokenToSet(COMMEND, srYYtext);
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_src_impl::runLex()
+{
+  genSrc_lex();
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConSrcWrap.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l Sun Dec  2 18:06:44 2012
@@ -0,0 +1,154 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+/*****************************************************************************
+ **********************   L E X   D E F I N I T I O N   **********************
+ *****************************************************************************
+ * lex grammar for parsing ressource source files (*.src and *.hrc files)
+ * file is converted to gConSrc_yy.cxx with "flex"
+ *****************************************************************************/
+
+
+
+/***************   O V E R W R I T I N G   F U N C T I O N S   ***************/
+%{
+/* enlarge token buffer to tokenize whole strings */
+#undef  YYLMAX
+#define YYLMAX 64000
+
+/* change reader function (input) to our own version */
+#define YY_INPUT(buf,result,max_size) { convert_src::mcpImpl->lexRead(buf, &result, max_size); }
+%}
+
+
+
+/*****************************   O P T I O N S   *****************************/
+/* 8bit               --> allow 8bit characters in the input stream   */
+/* noyywrap           --> yywrap is not called (single file scan)     */
+/* never-interactive  --> no check for console output                 */
+/* prefix=            --> yyFlexLexer change name                     */
+/* --- 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_"
+%p 24000
+%e 1200
+%n 500
+
+
+
+/*******************   R U L E S   D E F I N I T I O N S   *******************/
+%%
+
+^[\t ]*"#pragma".*   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::PRAGMA, string(yytext)); }
+
+^[ \t]*\n   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::EMPTYLINE, string(yytext)); }
+
+[\t ]+               |
+^[\t ]*"#include".*  |
+^[\t ]*"#undef".*    |
+"//".*               |
+";"                  |
+"<"                  |
+">"                  |
+\n   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::IGNORED, string(yytext)); }
+
+"/*"   {
+  convert_src::mcpImpl->addCommentToSet(convert_src_impl::COMMEND, string(yytext)); }
+
+^[\t ]*"#ifndef".+$   |
+^[\t ]*"#ifdef".+$    |
+^[\t ]*"#if".+$       |
+^[\t ]*"#elif".+$     |
+^[\t ]*"#else".+$     |
+^[\t ]*"#endif".+$    {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::CONDITION, string(yytext)); }
+
+[a-zA-Z]+[\t ]+[^={\n]+[\t ]   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::DEFINEDRES, string(yytext)); /* defined Res */ }
+
+[a-zA-Z]+[ \t]+[^={;\n]+\n[ \t]*"#".*\n[ \t]*"{"        |
+[a-zA-Z]+[ \t]+[^={;\n]+\n?([ \t]*"//".*\n)*[ \t]*"{"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::RESSOURCE, string(yytext)); /* RESSOURCE // String TTT_XX ... */ }
+
+^[\t ]*[a-zA-Z_]+[\t ]*"\\"?[\t ]*\n?[ \t]*"{"[\t ]*"\\"?   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::SMALRESSOURCE, string(yytext)); /* SMALRESSOURCE // String ... */ }
+
+[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?=[ \t]*L?\".*\".*\n?   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::TEXTLINE, string(yytext)); /* TEXTLINE // TextTyp = "A Text" */ }
+
+[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?(\n[ \t]*)?=([ \t]*\n)?(([a-zA-Z0-9_]+)|(\".*\")|([ \t\n]*))*\".*\"(([a-zA-Z0-9_]+)|(\".*\")|([ \t\n]*))*;   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::LONGTEXTLINE, string(yytext)); /* LONGTEXTLINE // TextTyp = "A Text" HHH_XXX "A Text" ZZZ_TTT ... */ }
+
+\".*\"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::TEXT, string(yytext)); /* TEXT // "A Text" */ }
+
+"{"[ \t]*\\?   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::LEVELUP, string(yytext)); /* LEVELUP */ }
+
+"}"[ \t]*;([ \t]*\\)?   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::LEVELDOWN, string(yytext)); /* LEVELDOWN */ }
+
+[a-zA-Z0-9_]+[ \t]*"="[ \t]*"MAP_APPFONT"[ \t]*"(".+")".*   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::APPFONTMAPPING, string(yytext)); /* APPFONTMAPPING  Typ = MAP_APPFONT( ... ) */ }
+
+[ \t]*[a-zA-Z0-9_]+[ \t]*=[ \t]*[0123456789]{1,5}[ \t]*";"?\\?   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::TEXTREFID, string(yytext)); /* TEXTREFID // TextTyp = 12345 */ }
+
+[a-zA-Z0-9_]+[ \t]*"=".*                          | 
+[a-zA-Z0-9_]+[ \t]*"="[\t ]*([ \t]*"//".*\n)*.*   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::ASSIGNMENT, string(yytext)); /* ASSIGNMENT  Typ = ...  */ }
+
+[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]*"<"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::LISTASSIGNMENT, string(yytext)); /* LISTASSIGNMENT  Typ [ ... ] = ... */ }
+
+"StringList"+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]*   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::LISTASSIGNMENT, string(yytext)); /* LISTASSIGNMENT  Typ [ ... ] = ... */ }
+
+"UIEntries"[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::UIENTRIES, string(yytext)); /* UIENTRIES */ }
+
+"<"?[ \t]*L?\".*\".*">"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::LISTTEXT, string(yytext)); /* LISTTEXT */ }
+
+[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.*"\\"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::RSCDEFINE, string(yytext)); /* RSCDEFINE  #define ... */ }
+
+[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.+   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::NORMDEFINE, string(yytext)); /* #define ... */ }
+
+"\\"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::RSCDEFINELEND, string(yytext)); /* RSCDEFINELEND */ }
+
+[a-zA-Z0-9_]+[ \t]*;   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::ANYTOKEN, string(yytext)); /* allowed other tokens like "49 ;" or "SFX_... ;" */ }
+
+.   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::UNKNOWNCHAR, string(yytext)); /* YYWarning( "Unknown Char" ); */ }
+
+"{"?[ \t]*\".*\"[ \t]*";"[ \t]*"}"   {
+  convert_src::mcpImpl->addTokenToSet(convert_src_impl::_LISTTEXT, string(yytext)); /* _LISTTEXT */ }
+
+%%

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConSrclex.l
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,64 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ ************************   G C O N T R E E . C X X   ************************
+ *****************************************************************************
+ * This is the conversion for .tree files
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_tree::convert_tree(const string& srSourceFile, l10nMem& crMemory)
+                          : convert_gen(srSourceFile, crMemory)
+{
+// extension,     program,     parameter,          collectMode, xxx
+// ".tree",       "xhtex",     "",                 "negative",  "noiso"
+  throw string("convert_tree not implemented");
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_tree::~convert_tree()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_tree::extract()
+{
+  throw string("convert_tree::extract not implemented");
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_tree::insert()
+{
+  throw string("convert_tree::insert not implemented");
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConTree.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,176 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N U L F . C X X   *************************
+ *****************************************************************************
+ * This is the conversion for .ulf files
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_ulf::convert_ulf(const string& srSourceFile, l10nMem& crMemory)
+                        : convert_gen(srSourceFile, crMemory)
+{
+}
+
+
+
+/*****************************************************************************/
+convert_ulf::~convert_ulf()
+{
+}
+
+
+
+/*****************************************************************************/
+void convert_ulf::extract()
+{
+  handleLines(false);
+}
+
+
+
+/*****************************************************************************/
+void convert_ulf::insert()
+{
+  handleLines(true);
+}
+
+
+
+/*****************************************************************************/
+void convert_ulf::handleLines(bool bMergeMode)
+{
+  bool   bEof, bMultiLineComment = false;
+  int    nL;
+  string sWorkLine, sOrgLine, sLanguage, sKey, sText;
+
+
+  // loop through all lines
+  for (;;)
+  {
+    lineRead(&bEof, sOrgLine);
+    if (bEof)
+      break;
+
+    // copy line so the original can be copied
+    sWorkLine  = sOrgLine;
+    sOrgLine  += "\n";
+
+    // check for end of multiLineComment
+    if (bMultiLineComment)
+    {
+      nL = sWorkLine.find("*/");
+      if (nL == string::npos)
+        sWorkLine.erase();
+      else
+      {
+        bMultiLineComment = false;
+        sWorkLine.erase(0,nL+2);
+      }
+    }
+
+    // check for start of comment
+    nL = sWorkLine.find("/*");
+    if (nL != string::npos)
+    {
+      int nL2 = sWorkLine.find("*/");
+      if (nL2 != string::npos)
+        sWorkLine.erase(nL, nL2+2-nL);
+      else
+      {
+        bMultiLineComment = true;
+        sWorkLine.erase(nL);
+      }
+    }
+
+    // remove leading/trailing blanks and handle empty lines
+    trim(sWorkLine);
+    if (!sWorkLine.size())
+    {
+      if (bMergeMode)
+        writeSourceFile(sOrgLine);
+      continue;
+    }
+
+    // the format is:
+    // [key]
+    // language = "text"
+
+    // check for key
+    if (sWorkLine[0] == '[')
+    {
+      sKey = sWorkLine.substr(1, sWorkLine.size()-2);
+
+      // copy line if merging
+      if (bMergeMode)
+        writeSourceFile(sOrgLine);
+    }
+    else
+    {
+      // must be language line
+      nL = sWorkLine.find_first_of("=");
+      if (nL == string::npos)
+        throw "unknown format in " + msSourceFile + " missing = in line: " + sOrgLine;
+      sLanguage = sWorkLine.substr(0, nL);
+      trim(sLanguage);
+
+      nL = sWorkLine.find_first_of("\"");
+      if (nL == string::npos)
+        throw "unknown format: <<" + sOrgLine + ">> missing '='";
+      sText = sWorkLine.substr(nL+1, sWorkLine.size()-2);
+      trim(sText);
+
+      // handle only en-US
+      if (sLanguage != "en-US")
+        continue;
+
+      // copy line if merging or add to translation
+      if (bMergeMode)
+      {
+        // get all languages (includes en-US)
+        vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
+        string                   sNewLine;
+        int                      nL = cExtraLangauges.size();
+
+
+         writeSourceFile(sOrgLine);
+        for (int i = 0; i < nL; ++i)
+        {
+          sNewLine = cExtraLangauges[i]->msLanguage +
+                     " = \"" +
+                     cExtraLangauges[i]->msText +
+                     "\"\n";
+
+          writeSourceFile(sNewLine);
+        }
+      }
+      else
+        mcMemory.setEnUsKey(sKey, sText);
+    }
+  }
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConUlf.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,86 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConXcs.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N X C S . C X X   *************************
+ *****************************************************************************
+ * This is the conversion for .xcs files
+ *****************************************************************************/
+
+
+
+/*****************************   G L O B A L S   *****************************/
+convert_xcs_impl * convert_xcs::mcpImpl;
+
+
+
+/************   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(const string& srSourceFile, l10nMem& crMemory)
+                        : convert_gen(srSourceFile, crMemory) 
+                          {mcpImpl = new convert_xcs_impl(srSourceFile, crMemory);}
+convert_xcs::~convert_xcs() {delete mcpImpl;}
+void convert_xcs::extract() {mcpImpl->extract();}
+void convert_xcs::insert()  {mcpImpl->insert();}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xcs_impl::convert_xcs_impl(const string& srSourceFile, l10nMem& crMemory)
+                                  : convert_gen (srSourceFile, crMemory)
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xcs_impl::~convert_xcs_impl()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcs_impl::extract()
+{
+  // generate l10mMem
+  mbMergeMode = false;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcs_impl::insert()
+{
+  // generate source files.
+  mbMergeMode = true;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXcs.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,58 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+#ifndef GCONXCS_HXX
+#define GCONXCS_HXX
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N X C S . H X X   *************************
+ *****************************************************************************
+ * This is the class header for .xcs conversion
+ *****************************************************************************/
+
+
+
+/********************   C L A S S   D E F I N I T I O N   ********************/
+class convert_xcs_impl : public convert_gen
+{
+  public:
+    convert_xcs_impl(const string& srSourceFile, l10nMem& crMemory);
+    ~convert_xcs_impl();
+
+    void startCollectData(string& sCollectedText);
+    void stopCollectData(string& sCollectedText);
+    void collectData(string& sCollectedText);
+
+  private:
+    bool mbMergeMode;
+
+    bool mbCollectingData;
+    string msCollector;
+
+    void extract();
+    void insert();
+    void runLex();
+
+    friend class convert_xcs;
+};
+#endif
\ No newline at end of file

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXcs.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,120 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConXcs.hxx"
+
+
+
+/*****************************************************************************
+ *********************   G C O N X C S W R A P . C X X   *********************
+ *****************************************************************************
+ * This includes the c code generated by flex
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+#include "gConXcs_yy.c"
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcs_impl::runLex()
+{
+  genxcs_lex();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcs_impl::startCollectData(string& sCollectedText)
+{
+  if (mbMergeMode && msCollector.size())
+    writeSourceFile(msCollector);
+
+  mbCollectingData = true;
+  msCollector      = sCollectedText;
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcs_impl::stopCollectData(string& sCollectedText)
+{
+  string sHead, sKey, sLang, sText;
+  int    nL;
+
+
+  // get type of tag
+  msCollector += sCollectedText;
+  nL = msCollector.find("<p");
+  if (nL != string::npos)
+    sHead = msCollector.substr(nL+1, 1);
+  else
+  {
+    nL = msCollector.find("<h");
+    sHead = msCollector.substr(nL+1, 2);
+  }
+
+  // locate key and extract it
+  nL    = msCollector.find("id=") +4;
+  sKey  = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+  nL    = msCollector.find("xml:lang=\"") + 10;
+  sLang = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+  nL    = msCollector.find(">") +1;
+  sText = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+
+  if (mbMergeMode)
+  {
+    // get all languages (includes en-US)
+    vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
+    string                   sNewLine;
+    int                      nL = cExtraLangauges.size();
+
+    writeSourceFile(msCollector);
+    msCollector.clear();
+    for (int i = 0; i < nL; ++i)
+    {
+      sNewLine = "\n<" + sHead + " id=\"" + sKey + "\"" + " xml:lang=\"" +
+                 cExtraLangauges[i]->msLanguage + "\">" +
+                 cExtraLangauges[i]->msText +
+                 "</" + sHead + ">";
+
+      writeSourceFile(sNewLine);
+    }
+  }
+  else
+    mcMemory.setEnUsKey(sKey, sText);
+
+  mbCollectingData = false;
+}  
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcs_impl::collectData(string& sCollectedText)
+{
+  msCollector += sCollectedText;
+  if (mbMergeMode && sCollectedText == "\n")
+  {
+    writeSourceFile(msCollector);
+    msCollector.clear();
+  }
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXcsWrap.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l Sun Dec  2 18:06:44 2012
@@ -0,0 +1,80 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+/*****************************************************************************
+ **********************   L E X   D E F I N I T I O N   **********************
+ *****************************************************************************
+ * lex grammar for parsing ressource source files (*.xrm files)
+ * file is converted to gConXcs_yy.cxx with "flex"
+ *****************************************************************************/
+
+
+ 
+/***************   O V E R W R I T I N G   F U N C T I O N S   ***************/
+%{
+/* enlarge token buffer to tokenize whole strings */
+#undef  YYLMAX
+#define YYLMAX 64000
+
+/* change reader function (input) to our own version */
+#define YY_INPUT(buf,result,max_size) { convert_xcs::mcpImpl->lexRead(buf, &result, max_size); }
+%}
+
+
+
+/*****************************   O P T I O N S   *****************************/
+/* 8bit               --> allow 8bit characters in the input stream          */
+/* noyywrap           --> yywrap is not called (single file scan)            */
+/* never-interactive  --> no check for console output                        */
+/* prefix=            --> yyFlexLexer change name                            */
+/* --- 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="genxcs_"
+%p 24000
+%e 1200
+%n 500
+
+
+
+/*******************   R U L E S   D E F I N I T I O N S   *******************/
+%%
+
+"<p"[^>]*>      |
+"<h"[0-9][^>]*> {
+  string text(yytext);
+  convert_xcs::mcpImpl->startCollectData(text);
+}
+
+"</p>"      |
+"</h"[0-9]> {
+  string text(yytext);
+  convert_xcs::mcpImpl->stopCollectData(text);
+}
+
+.|\n {
+  string text(yytext);
+  convert_xcs::mcpImpl->collectData(text);
+}
+
+
+%%

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXcslex.l
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,102 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConXcu.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N X C U . C X X   *************************
+ *****************************************************************************
+ * This is the conversion for .xcu files
+ *****************************************************************************/
+
+
+
+/*****************************   G L O B A L S   *****************************/
+convert_xcu_impl * convert_xcu::mcpImpl;
+
+
+
+/************   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(const string& srSourceFile, l10nMem& crMemory)
+                        : convert_gen(srSourceFile, crMemory) 
+                          {mcpImpl = new convert_xcu_impl(srSourceFile, crMemory);}
+convert_xcu::~convert_xcu() {delete mcpImpl;}
+void convert_xcu::extract() {mcpImpl->extract();}
+void convert_xcu::insert()  {mcpImpl->insert();}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+xcu_stack_entry::xcu_stack_entry(TAG_TYPE sIsNode, string& sName)
+                                : mbIsNode (sIsNode),
+                                  msName   (sName)
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+xcu_stack_entry::~xcu_stack_entry()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xcu_impl::convert_xcu_impl(const string& srSourceFile, l10nMem& crMemory)
+                                  : convert_gen (srSourceFile, crMemory)
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xcu_impl::~convert_xcu_impl()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::extract()
+{
+  // generate l10mMem
+  mbMergeMode = false;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::insert()
+{
+  // generate source files.
+  mbMergeMode = true;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXcu.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,78 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+#ifndef GCONXCU_HXX
+#define GCONXCU_HXX
+#include "gLang.hxx"
+#include <stack>
+
+
+
+/*****************************************************************************
+ *************************   G C O N X C U . H X X   *************************
+ *****************************************************************************
+ * This is the class header for .xcu conversion
+ *****************************************************************************/
+typedef enum {TAG_COMPONENT, TAG_PROP, TAG_NODE } TAG_TYPE;
+
+
+
+/********************   C L A S S   D E F I N I T I O N   ********************/
+class xcu_stack_entry
+{
+  public:
+    xcu_stack_entry(TAG_TYPE sIsNode, string& sName);
+    ~xcu_stack_entry();
+
+    TAG_TYPE mbIsNode;
+    string   msName;
+};
+
+
+
+
+/********************   C L A S S   D E F I N I T I O N   ********************/
+class xcu_stack_entry;
+class convert_xcu_impl : public convert_gen
+{
+  public:
+    convert_xcu_impl(const string& srSourceFile, l10nMem& crMemory);
+    ~convert_xcu_impl();
+
+    void pushKeyPart(TAG_TYPE eIsNode, string &sTag);
+    void popKeyPart (TAG_TYPE eIsNode, string &sTag);
+
+    void startCollectData(string& sCollectedText);
+    void stopCollectData(string& sCollectedText);
+    void collectData(string& sCollectedText);
+
+  private:
+    stack<xcu_stack_entry> mcStack;
+    bool                   mbMergeMode;
+    bool                   mbCollectingData;
+    string                 msCollector;
+
+    void extract();
+    void insert();
+    void runLex();
+
+    friend class convert_xcu;
+};
+#endif
\ No newline at end of file

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXcu.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,154 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConXcu.hxx"
+
+
+
+/*****************************************************************************
+ *********************   G C O N X C U W R A P . C X X   *********************
+ *****************************************************************************
+ * This includes the c code generated by flex
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+#include "gConXcu_yy.c"
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::runLex()
+{
+  genxcu_lex();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::pushKeyPart(TAG_TYPE bIsNode, string& sTag)
+{
+  // remember text for merge
+  msCollector += sTag;
+
+  xcu_stack_entry newTag(bIsNode, sTag);
+
+  mcStack.push(newTag);
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::popKeyPart(TAG_TYPE bIsNode, string &sTag)
+{
+  // remember text for merge
+  msCollector += sTag;
+
+  // check for correct node/prop relations
+  if (bIsNode != mcStack.top().mbIsNode)
+    throw "node/prob mismatch in file " + msSourceFile;
+
+  mcStack.pop();
+
+  if (mbMergeMode && msCollector.size())
+    writeSourceFile(msCollector);
+  msCollector.clear();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::startCollectData(string& sCollectedText)
+{
+  if (mbMergeMode && msCollector.size())
+    writeSourceFile(msCollector);
+
+  mbCollectingData = true;
+  msCollector.clear();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::stopCollectData(string& sCollectedText)
+{
+  string sHead, sKey, sLang, sText;
+  int    nL;
+
+#if 0
+  // get type of tag
+  msCollector += sCollectedText;
+  nL = msCollector.find("<p");
+  if (nL != string::npos)
+    sHead = msCollector.substr(nL+1, 1);
+  else
+  {
+    nL = msCollector.find("<h");
+    sHead = msCollector.substr(nL+1, 2);
+  }
+
+  // locate key and extract it
+  nL    = msCollector.find("id=") +4;
+  sKey  = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+  nL    = msCollector.find("xml:lang=\"") + 10;
+  sLang = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+  nL    = msCollector.find(">") +1;
+  sText = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+
+  if (mbMergeMode)
+  {
+    // get all languages (includes en-US)
+    vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
+    string                   sNewLine;
+    int                      nL = cExtraLangauges.size();
+
+    writeSourceFile(msCollector);
+    msCollector.clear();
+    for (int i = 0; i < nL; ++i)
+    {
+      sNewLine = "\n<" + sHead + " id=\"" + sKey + "\"" + " xml:lang=\"" +
+                 cExtraLangauges[i]->msLanguage + "\">" +
+                 cExtraLangauges[i]->msText +
+                 "</" + sHead + ">";
+
+      writeSourceFile(sNewLine);
+    }
+  }
+  else
+    mcMemory.setEnUsKey(sKey, sText);
+#endif
+  mbCollectingData = false;
+  msCollector.clear();
+}  
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xcu_impl::collectData(string& sCollectedText)
+{
+  msCollector += sCollectedText;
+  if (sCollectedText == "\n")
+  {
+    if (mbMergeMode)
+      writeSourceFile(msCollector);
+    msCollector.clear();
+  }
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXculex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXculex.l?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXculex.l (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXculex.l Sun Dec  2 18:06:44 2012
@@ -0,0 +1,107 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+ 
+
+/*****************************************************************************
+ **********************   L E X   D E F I N I T I O N   **********************
+ *****************************************************************************
+ * lex grammar for parsing ressource source files (*.xrm files)
+ * file is converted to gConXcu_yy.cxx with "flex"
+ *****************************************************************************/
+
+
+ 
+/***************   O V E R W R I T I N G   F U N C T I O N S   ***************/
+%{
+/* enlarge token buffer to tokenize whole strings */
+#undef  YYLMAX
+#define YYLMAX 64000
+
+/* change reader function (input) to our own version */
+#define YY_INPUT(buf,result,max_size) { convert_xcu::mcpImpl->lexRead(buf, &result, max_size); }
+%}
+
+
+
+/*****************************   O P T I O N S   *****************************/
+/* 8bit               --> allow 8bit characters in the input stream          */
+/* noyywrap           --> yywrap is not called (single file scan)            */
+/* never-interactive  --> no check for console output                        */
+/* prefix=            --> yyFlexLexer change name                            */
+/* --- 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="genxcu_"
+%p 24000
+%e 1200
+%n 500
+
+
+
+/*******************   R U L E S   D E F I N I T I O N S   *******************/
+%%
+
+"<oor:component-data "[^>]*> {
+  string text(yytext);
+  convert_xcu::mcpImpl->pushKeyPart(TAG_COMPONENT, text);
+}
+
+
+"</oor:component-data>" {
+  string text(yytext);
+  convert_xcu::mcpImpl->popKeyPart(TAG_COMPONENT, text);
+}
+
+"<prop oor:name=\""[^\"]*\" {
+  string text(yytext);
+  convert_xcu::mcpImpl->pushKeyPart(TAG_PROP, text);
+}
+
+"</prop>" {
+  string text(yytext);
+  convert_xcu::mcpImpl->popKeyPart(TAG_PROP, text);
+}
+
+"<node oor:name=\""[^\"]*\" {
+  string text(yytext);
+  convert_xcu::mcpImpl->pushKeyPart(TAG_NODE, text);
+}
+
+"</node>" {
+  string text(yytext);
+  convert_xcu::mcpImpl->popKeyPart(TAG_NODE, text);
+}
+  
+"<value xml:lang=\""[^\"]*\"[^>]*">" {
+  string text(yytext);
+  convert_xcu::mcpImpl->startCollectData(text);
+}
+
+"</value>" {
+  string text(yytext);
+  convert_xcu::mcpImpl->stopCollectData(text);
+}
+
+.|\n {
+  string text(yytext);
+  convert_xcu::mcpImpl->collectData(text);
+}
+%%

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXculex.l
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,86 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConXhp.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N X H P . C X X   *************************
+ *****************************************************************************
+ * This is the conversion for .xhp files
+ *****************************************************************************/
+
+
+
+/*****************************   G L O B A L S   *****************************/
+convert_xhp_impl * convert_xhp::mcpImpl;
+
+
+
+/************   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(const string& srSourceFile, l10nMem& crMemory)
+                        : convert_gen(srSourceFile, crMemory) 
+                          {mcpImpl = new convert_xhp_impl(srSourceFile, crMemory);}
+convert_xhp::~convert_xhp() {delete mcpImpl;}
+void convert_xhp::extract() {mcpImpl->extract();}
+void convert_xhp::insert()  {mcpImpl->insert();}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xhp_impl::convert_xhp_impl(const string& srSourceFile, l10nMem& crMemory)
+                                  : convert_gen (srSourceFile, crMemory)
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xhp_impl::~convert_xhp_impl()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xhp_impl::extract()
+{
+  // generate l10mMem
+  mbMergeMode = false;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xhp_impl::insert()
+{
+  // generate source files.
+  mbMergeMode = true;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXhp.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,58 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+#ifndef GCONXHP_HXX
+#define GCONXHP_HXX
+#include "gLang.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N X H P . H X X   *************************
+ *****************************************************************************
+ * This is the class definition header xhp converter
+ *****************************************************************************/
+
+
+
+/********************   C L A S S   D E F I N I T I O N   ********************/
+class convert_xhp_impl : public convert_gen
+{
+  public:
+    convert_xhp_impl(const string& srSourceFile, l10nMem& crMemory);
+    ~convert_xhp_impl();
+
+    void startCollectData(string& sCollectedText);
+    void stopCollectData(string& sCollectedText);
+    void collectData(string& sCollectedText);
+
+  private:
+    bool mbMergeMode;
+
+    bool mbCollectingData;
+    string msCollector;
+
+    void extract();
+    void insert();
+    void runLex();
+
+    friend class convert_xhp;
+};
+#endif
\ No newline at end of file

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXhp.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,125 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConXhp.hxx"
+
+
+
+/*****************************************************************************
+ *********************   G C O N X H P W R A P . C X X   *********************
+ *****************************************************************************
+ * This includes the c code generated by flex
+ *****************************************************************************/
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+#include "gConXhp_yy.c"
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xhp_impl::runLex()
+{
+  genXhp_lex();
+
+  if (mbMergeMode && msCollector.size())
+    writeSourceFile(msCollector);
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xhp_impl::startCollectData(string& sCollectedText)
+{
+  if (mbMergeMode && msCollector.size())
+    writeSourceFile(msCollector);
+
+  mbCollectingData = true;
+  msCollector      = sCollectedText;
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xhp_impl::stopCollectData(string& sCollectedText)
+{
+  string sHead, sKey, sLang, sText;
+  int    nL;
+
+
+  // get type of tag
+  msCollector += sCollectedText;
+  nL = msCollector.find("<p");
+  if (nL != string::npos)
+    sHead = msCollector.substr(nL+1, 1);
+  else
+  {
+    nL = msCollector.find("<h");
+    sHead = msCollector.substr(nL+1, 2);
+  }
+
+  // locate key and extract it
+  nL    = msCollector.find("id=") +4;
+  sKey  = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+  nL    = msCollector.find("xml:lang=\"") + 10;
+  sLang = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+  nL    = msCollector.find(">") +1;
+  sText = msCollector.substr(nL, msCollector.find("\"", nL+1) - nL);
+
+  if (mbMergeMode)
+  {
+    // get all languages (includes en-US)
+    vector<l10nMem_entry *>& cExtraLangauges = mcMemory.getLanguagesForKey(sKey);
+    string                   sNewLine;
+    int                      nL = cExtraLangauges.size();
+
+    writeSourceFile(msCollector);
+    msCollector.clear();
+    for (int i = 0; i < nL; ++i)
+    {
+      sNewLine = "\n<" + sHead + " id=\"" + sKey + "\"" + " xml:lang=\"" +
+                 cExtraLangauges[i]->msLanguage + "\">" +
+                 cExtraLangauges[i]->msText +
+                 "</" + sHead + ">";
+
+      writeSourceFile(sNewLine);
+    }
+  }
+  else
+    mcMemory.setEnUsKey(sKey, sText);
+
+  mbCollectingData = false;
+  msCollector.clear();
+}  
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xhp_impl::collectData(string& sCollectedText)
+{
+  msCollector += sCollectedText;
+  if (sCollectedText == "\n")
+  {
+    if (mbMergeMode)
+      writeSourceFile(msCollector);
+    msCollector.clear();
+  }
+}

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXhpWrap.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l Sun Dec  2 18:06:44 2012
@@ -0,0 +1,80 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+/*****************************************************************************
+ **********************   L E X   D E F I N I T I O N   **********************
+ *****************************************************************************
+ * lex grammar for parsing ressource source files (*.xrm files)
+ * file is converted to gConXrm_yy.cxx with "flex"
+ *****************************************************************************/
+
+
+ 
+/***************   O V E R W R I T I N G   F U N C T I O N S   ***************/
+%{
+/* enlarge token buffer to tokenize whole strings */
+#undef  YYLMAX
+#define YYLMAX 64000
+
+/* change reader function (input) to our own version */
+#define YY_INPUT(buf,result,max_size) { convert_xhp::mcpImpl->lexRead(buf, &result, max_size); }
+%}
+
+
+
+/*****************************   O P T I O N S   *****************************/
+/* 8bit               --> allow 8bit characters in the input stream          */
+/* noyywrap           --> yywrap is not called (single file scan)            */
+/* never-interactive  --> no check for console output                        */
+/* prefix=            --> yyFlexLexer change name                            */
+/* --- 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="genXhp_"
+%p 24000
+%e 1200
+%n 500
+
+
+
+/*******************   R U L E S   D E F I N I T I O N S   *******************/
+%%
+
+"<p"[^>]*>      |
+"<h"[0-9][^>]*> {
+  string text(yytext);
+  convert_xhp::mcpImpl->startCollectData(text);
+}
+
+"</p>"      |
+"</h"[0-9]> {
+  string text(yytext);
+  convert_xhp::mcpImpl->stopCollectData(text);
+}
+
+.|\n {
+  string text(yytext);
+  convert_xhp::mcpImpl->collectData(text);
+}
+
+
+%%

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXhplex.l
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx?rev=1416218&view=auto
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx (added)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx Sun Dec  2 18:06:44 2012
@@ -0,0 +1,86 @@
+/**************************************************************
+ * 
+ * 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
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+using namespace std;
+#include "gConXrm.hxx"
+
+
+
+/*****************************************************************************
+ *************************   G C O N X R M . C X X   *************************
+ *****************************************************************************
+ * This is the conversion for .xrm files
+ *****************************************************************************/
+
+
+
+/*****************************   G L O B A L S   *****************************/
+convert_xrm_impl * convert_xrm::mcpImpl;
+
+
+
+/************   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(const string& srSourceFile, l10nMem& crMemory)
+                        : convert_gen(srSourceFile, crMemory) 
+                          {mcpImpl = new convert_xrm_impl(srSourceFile, crMemory);}
+convert_xrm::~convert_xrm() {delete mcpImpl;}
+void convert_xrm::extract() {mcpImpl->extract();}
+void convert_xrm::insert()  {mcpImpl->insert();}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xrm_impl::convert_xrm_impl(const string& srSourceFile, l10nMem& crMemory)
+                                  : convert_gen (srSourceFile, crMemory)
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+convert_xrm_impl::~convert_xrm_impl()
+{
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xrm_impl::extract()
+{
+  // generate l10mMem
+  mbMergeMode = false;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+
+
+/**********************   I M P L E M E N T A T I O N   **********************/
+void convert_xrm_impl::insert()
+{
+  // generate source files.
+  mbMergeMode = true;
+
+  // run lex parser and build token tree
+  runLex();
+}
+
+

Propchange: openoffice/branches/l10n/main/l10ntools/source/gConXrm.cxx
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message